]> git.pld-linux.org Git - packages/syslog-ng.git/blob - syslog-ng-fixes.patch
- improved configtest formatting
[packages/syslog-ng.git] / syslog-ng-fixes.patch
1 --- syslog-ng-3.0.1/src/misc.c~ 2008-11-05 20:57:42.000000000 +0100
2 +++ syslog-ng-3.0.1/src/misc.c  2009-01-16 11:43:30.896633603 +0100
3 @@ -274,7 +274,7 @@
4    struct passwd *pw;
5  
6    *uid = 0;
7 -  if (*user)
8 +  if (!*user)
9      return FALSE;
10      
11    pw = getpwnam(user);
12 commit 11f8d45b016107a686dbfa29497960ae3f6145ac
13 Author: Balazs Scheidler <bazsi@balabit.hu>
14 Date:   Fri Jan 16 14:44:53 2009 +0100
15
16     [config parser] "syslog" became a reserved word, make it possible to use that as a facility name
17     
18         In syslog-ng 3.0, "syslog" became a reserved word, thus the facility()
19         filter couldn't use it as name for the facility named syslog.
20     
21         To avoid having to quote this word, I added a kludge to the
22         config grammar, to make it recognize syslog as a facility name
23         based on context.
24
25 diff --git a/src/cfg-grammar.y b/src/cfg-grammar.y
26 index c40b7fb..d54ba8f 100644
27 --- a/src/cfg-grammar.y
28 +++ b/src/cfg-grammar.y
29 @@ -277,6 +277,7 @@ cfg_check_template(LogTemplate *template)
30  
31  %type  <cptr> string
32  %type  <cptr> string_or_number
33 +%type  <cptr> facility_string
34  %type   <ptr> string_list
35  %type   <ptr> string_list_build
36  
37 @@ -464,7 +465,7 @@ source_affile_option
38                affile_sd_set_pri_level(last_driver, level); 
39              free($3);
40            }
41 -        | KW_FACILITY '(' string ')'    
42 +        | KW_FACILITY '(' facility_string ')'
43  
44            {
45              int facility = -1;
46 @@ -1305,7 +1306,7 @@ filter_fac_list
47         ;
48  
49  filter_fac
50 -       : string                                
51 +       : facility_string
52           { 
53             int n = syslog_name_lookup_facility_by_name($1);
54             if (n == -1)
55 @@ -1499,6 +1500,11 @@ string_list_build
56          |                                      { $$ = NULL; }
57          ;
58  
59 +facility_string
60 +        : string                                { $$ = $1; };
61 +        | KW_SYSLOG                             { $$ = strdup("syslog"); }
62 +        ;
63 +
64  %%
65  
66  extern int linenum;
This page took 0.037257 seconds and 3 git commands to generate.