[syslog-ng]chmod() and template escaping for pipes
Balazs Scheidler
bazsi@balabit.hu
Sat, 14 Apr 2001 09:58:38 +0200
Hi,
The patch below adds chmod() calls for created directories and files so they
are created with modes independent from the current umask. The other change
adds the template-escape() option for pipes. This will be integrated into
the next release.
Index: affile.c
===================================================================
RCS file: /var/cvs/syslog-ng/src/affile.c,v
retrieving revision 1.35
diff -u -r1.35 affile.c
--- affile.c 2001/03/30 15:02:31 1.35
+++ affile.c 2001/04/14 07:56:51
@@ -78,6 +78,7 @@
if (mkdir(name->data, dir_mode) == -1)
return 0;
chown(name->data, dir_uid, dir_gid);
+ chmod(name->data, dir_mode);
}
*p = '/';
p = strchr(p + 1, '/');
@@ -85,6 +86,7 @@
*fd = open(name->data, flags, mode);
}
chown(name->data, uid, gid);
+ chmod(name->data, mode);
return *fd != -1;
}
Index: cfg-grammar.y
===================================================================
RCS file: /var/cvs/syslog-ng/src/cfg-grammar.y,v
retrieving revision 1.41
diff -u -r1.41 cfg-grammar.y
--- cfg-grammar.y 2001/03/30 15:02:31 1.41
+++ cfg-grammar.y 2001/04/14 07:56:51
@@ -398,6 +398,7 @@
| KW_GROUP '(' string ')' { affile_set_group(last_dest_driver, $3); free($3); }
| KW_PERM '(' NUMBER ')' { affile_set_perm(last_dest_driver, $3); }
| KW_FILE_TEMPLATE '(' string ')' { affile_set_file_template(last_dest_driver, $3); free($3); }
+ | KW_TEMPLATE_ESCAPE '(' yesno ')' { affile_set_template_escape(last_dest_driver, $3); }
;
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1