]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't check log dir permission if the log file already exists
authorTimo Sirainen <tss@iki.fi>
Sat, 8 Feb 2003 15:30:10 +0000 (17:30 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 8 Feb 2003 15:30:10 +0000 (17:30 +0200)
--HG--
branch : HEAD

src/master/master-settings.c

index 7f57cb7a11961cff6381f33d8b16c1a908a041c3..f292af041b7e0879b2542a058aca0434b5ef37a4 100644 (file)
@@ -293,16 +293,19 @@ static void settings_verify(struct settings *set)
                }
        }
 
-       if (set->log_path != NULL) {
+       if (set->log_path != NULL && access(set->log_path, W_OK) < 0) {
                dir = get_directory(set->log_path);
                if (access(dir, W_OK) < 0)
-                       i_fatal("Can't access log directory %s: %m", dir);
+                       i_fatal("Can't write to log directory %s: %m", dir);
        }
 
-       if (set->info_log_path != NULL) {
+       if (set->info_log_path != NULL &&
+           access(set->info_log_path, W_OK) < 0) {
                dir = get_directory(set->info_log_path);
-               if (access(dir, W_OK) < 0)
-                       i_fatal("Can't access info log directory %s: %m", dir);
+               if (access(dir, W_OK) < 0) {
+                       i_fatal("Can't write to info log directory %s: %m",
+                               dir);
+               }
        }
 
 #ifdef HAVE_SSL