[gdm] Make /var/log/gdm if it doesn't exist. Fixes bug #589862.



commit 6a8cfcec813a5eab4c495074696cf3c65690c025
Author: Brian Cameron <Brian Cameron sun com>
Date:   Mon Oct 19 16:55:02 2009 -0500

    Make /var/log/gdm if it doesn't exist.  Fixes bug #589862.

 daemon/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/daemon/main.c b/daemon/main.c
index 0fb3915..8577ba7 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -267,7 +267,11 @@ check_logdir (void)
 
         r = g_stat (log_path, &statbuf);
         if (r < 0 || ! S_ISDIR (statbuf.st_mode))  {
-                gdm_fail (_("Logdir %s does not exist or isn't a directory."), log_path);
+                if (g_mkdir (log_path, 0755) < 0) {
+                        gdm_fail (_("Logdir %s does not exist or isn't a directory."),
+                                  log_path);
+                }
+                g_chmod (log_path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
         }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]