[syslog-ng]warning
Balazs Scheidler
bazsi@balabit.hu
Tue, 2 Apr 2002 09:02:07 +0200
On Mon, Apr 01, 2002 at 07:05:41PM -0600, John_Delisle@ceridian.ca wrote:
>
> One thing to watch for in the latest version of syslog-ng -
>
> If you create a destination of /dev/null it changes the permissions on
> /dev/null to 0600 by default. This causes all sorts of problems. Perhaps
> a warning is in order?
What do you think about this patch? I'm not sure about it, as it might bug
somebody.
Index: affile.c
===================================================================
RCS file: /var/cvs/syslog-ng/src/affile.c,v
retrieving revision 1.47
diff -u -r1.47 affile.c
--- affile.c 2002/03/19 09:26:16 1.47
+++ affile.c 2002/04/02 07:00:55
@@ -67,6 +67,9 @@
werror("Spurious path %S, logfile not created\n", name);
return 0;
}
+ if (strncmp(name->data, "/dev", 4) == 0) {
+ werror("Changing permissions on special file %S\n", name);
+ }
*fd = open(name->data, flags, mode != -1 ? mode : 0600);
if (create_dirs && *fd == -1 && errno == ENOENT) {
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1