From d9fb1211986e54838de90764648af379f202bf36 Mon Sep 17 00:00:00 2001 From: Matthias Saou Date: Fri, 14 Sep 2007 14:17:56 +0000 Subject: [PATCH] Include patch from Shinji Tanaka to fix conf include. --- keepalived-1.1.14-include.patch | 45 +++++++++++++++++++++++++++++++++ keepalived.spec | 8 +++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 keepalived-1.1.14-include.patch diff --git a/keepalived-1.1.14-include.patch b/keepalived-1.1.14-include.patch new file mode 100644 index 0000000..3f946d9 --- /dev/null +++ b/keepalived-1.1.14-include.patch @@ -0,0 +1,45 @@ +diff -Naupr keepalived-1.1.14.orig/lib/parser.c keepalived-1.1.14/lib/parser.c +--- keepalived-1.1.14.orig/lib/parser.c 2007-09-13 17:14:16.000000000 +0200 ++++ keepalived-1.1.14/lib/parser.c 2007-09-14 16:14:26.000000000 +0200 +@@ -33,6 +33,7 @@ + + /* global vars */ + vector keywords; ++vector current_keywords; + FILE *current_stream; + char *current_conf_file; + int reload = 0; +@@ -213,7 +214,7 @@ void read_conf_file(char *conf_file) + char *confpath = strdup(globbuf.gl_pathv[i]); + dirname(confpath); + chdir(confpath); +- process_stream(keywords); ++ process_stream(current_keywords); + fclose(stream); + + chdir(prev_path); +@@ -388,6 +389,8 @@ process_stream(vector keywords_vec) + char *str; + char *buf; + vector strvec; ++ vector prev_keywords = current_keywords; ++ current_keywords = keywords_vec; + + buf = zalloc(MAXBUF); + while (read_line(buf, MAXBUF)) { +@@ -423,6 +426,7 @@ process_stream(vector keywords_vec) + free_strvec(strvec); + } + ++ current_keywords = prev_keywords; + free(buf); + return; + } +@@ -442,6 +446,7 @@ init_data(char *conf_file, vector (*init + #endif + + /* Stream handling */ ++ current_keywords = keywords; + read_conf_file((conf_file) ? conf_file : CONF); + free_keywords(keywords); + } diff --git a/keepalived.spec b/keepalived.spec index 6eab168..cebb804 100644 --- a/keepalived.spec +++ b/keepalived.spec @@ -4,13 +4,14 @@ Summary: HA monitor built upon LVS, VRRP and service pollers Name: keepalived Version: 1.1.14 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: Applications/System URL: http://www.keepalived.org/ Source: http://www.keepalived.org/software/keepalived-%{version}.tar.gz Patch0: keepalived-1.1.14-genhashman.patch Patch1: keepalived-1.1.14-installmodes.patch +Patch2: keepalived-1.1.14-include.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires(post): /sbin/chkconfig Requires(preun): /sbin/service, /sbin/chkconfig @@ -40,6 +41,7 @@ healthchecks and LVS directors failover. %setup -q %patch0 -p1 -b .genhashman %patch1 -p1 -b .installmodes +%patch2 -p1 -b .include # Fix file mode (600 as of 1.1.13) %{__chmod} a+r doc/samples/sample.misccheck.smbcheck.sh # Included as doc, so disable its dependencies @@ -102,6 +104,10 @@ fi %changelog +* Fri Sep 14 2007 Matthias Saou 1.1.14-2 +- Include patch from Shinji Tanaka to fix conf include from inside some + directives like vrrp_instance. + * Thu Sep 13 2007 Matthias Saou 1.1.14-1 - Update to 1.1.14. - Remove all upstreamed patches.