diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2004-07-26 22:44:25 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2004-07-26 22:44:25 +0000 |
commit | 9971dd3529c07022231fd722cb593f6609dd9d70 (patch) | |
tree | d65bea9a4e415d94bcc6204526c48d9e10577521 | |
parent | 956b25ecaa203291b5abdfc43451ae34da4ebdc7 (diff) |
Fix opening of log file with '-user nobody'. Problem reported by Olegrel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_1XORG-6_8_2XORG-6_8_1_904XORG-6_8_1_903XORG-6_8_1_902XORG-6_8_1_901XORG-6_8_1XORG-6_8_0XORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1XORG-6_8-branch
Safiullin and Mike Pechkin.
-rw-r--r-- | difs/main.c | 2 | ||||
-rw-r--r-- | os/error.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/difs/main.c b/difs/main.c index b7d8a4c..370005e 100644 --- a/difs/main.c +++ b/difs/main.c @@ -95,7 +95,6 @@ main(int argc, char *argv[]) /* init stuff */ ProcessCmdLine(argc, argv); - InitErrors(); /* * Do this first thing, to get any options that only take effect at @@ -104,6 +103,7 @@ main(int argc, char *argv[]) if (ReadConfigFile(configfilename) != FSSuccess) { FatalError("couldn't read config file\n"); } + InitErrors(); /* make sure at least world write access is disabled */ if (((oldumask = umask(022)) & 002) == 002) @@ -86,6 +86,7 @@ Bool UseSyslog; Bool log_open = FALSE; #endif char ErrorFile[PATH_MAX]; +static char CurrentErrorFile[PATH_MAX]; static void abort_server(void) @@ -112,7 +113,7 @@ InitErrors(void) } #endif - if (ErrorFile[0]) { + if (ErrorFile[0] && strcmp(CurrentErrorFile, ErrorFile) != 0) { i = creat(ErrorFile, 0666); if (i != -1) { dup2(i, 2); @@ -120,6 +121,7 @@ InitErrors(void) } else { ErrorF("can't open error file \"%s\"\n", ErrorFile); } + strncpy(CurrentErrorFile, ErrorFile, sizeof CurrentErrorFile); } } |