[syslog-ng] More on syslog-ng changing ownership and perms of source file

Jim Segrave jes at j-e-s.net
Wed Nov 29 14:01:19 UTC 2017


I added the line:

         | file_dir_perm_option

to the source_affile_option in ./modules/affile/affile-grammar.y:419 would allow setting ownership and permissions on source files (or opting for no-change)

This would gave:

source_affile_option
         : KW_FOLLOW_FREQ '(' LL_FLOAT ')'               { affile_sd_set_follow_freq(last_driver, (long) ($3 * 1000)); }
         | KW_FOLLOW_FREQ '(' LL_NUMBER ')'              { affile_sd_set_follow_freq(last_driver, ($3 * 1000)); }
         | KW_PAD_SIZE '(' LL_NUMBER ')'                 { ((AFFileSourceDriver *) last_driver)->pad_size = $3; }
         | file_dir_perm_option
         | multi_line_option
         | source_reader_option
         ;

I did this with the syslog-ng.3.6.4 source and it now does the following:

The owner group and permissions are changed only if the file source line specifies a value (not -1) for one of these items. In other words, it does not use any default value
from the configuration, it simply leaves things as it found them.

-- 
Jim Segrave
jes at j-e-s.net



More information about the syslog-ng mailing list