From 3600fb4170487f8e4352ca711349272cb8fa3cc1 Mon Sep 17 00:00:00 2001 From: Brian Cameron Date: Tue, 6 Jan 2009 00:30:11 +0000 Subject: Update SDTLOGIN logic so that the "/var/dt" directory gets created if it 2008-01-05 Brian Cameron * daemon/gdm.[hc], daemon/verify-pam.c, daemon/server.c: Update SDTLOGIN logic so that the "/var/dt" directory gets created if it is missing. * daemon/server.c, daemon/gdm-daemon-config.c: Use "#ifdef __sun" instead of "#ifdef sun". svn path=/branches/gnome-2-20/; revision=6651 --- ChangeLog | 8 ++++++++ daemon/gdm-daemon-config.c | 2 +- daemon/gdm.c | 14 ++++++++++++-- daemon/gdm.h | 3 ++- daemon/server.c | 4 ++-- daemon/verify-pam.c | 8 ++++---- 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c73664c3..784717b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-01-05 Brian Cameron + + * daemon/gdm.[hc], daemon/verify-pam.c, daemon/server.c: + Update SDTLOGIN logic so that the "/var/dt" directory + gets created if it is missing. + * daemon/server.c, daemon/gdm-daemon-config.c: Use "#ifdef __sun" + instead of "#ifdef sun". + 2008-01-05 Brian Cameron * daemon/verify-pam.c: Make sure that pwent gets set before diff --git a/daemon/gdm-daemon-config.c b/daemon/gdm-daemon-config.c index 68f41cd1..dbcd5d40 100644 --- a/daemon/gdm-daemon-config.c +++ b/daemon/gdm-daemon-config.c @@ -1051,7 +1051,7 @@ gdm_daemon_config_get_xservers (void) } /* PRIO_MIN and PRIO_MAX are not defined on Solaris, but are -20 and 20 */ -#if sun +#if __sun #ifndef PRIO_MIN #define PRIO_MIN -20 #endif diff --git a/daemon/gdm.c b/daemon/gdm.c index 5721ff91..cd5c1444 100644 --- a/daemon/gdm.c +++ b/daemon/gdm.c @@ -1707,8 +1707,18 @@ main (int argc, char *argv[]) gdm_daemonify (); #ifdef __sun - g_unlink (SDTLOGIN_DIR); - g_mkdir (SDTLOGIN_DIR, 0700); + { + struct stat statbuf; + int r; + + r = stat (GDM_DT_DIR, &statbuf); + if (r < 0) { + g_mkdir (GDM_DT_DIR, 0755); + } + + g_unlink (GDM_SDTLOGIN_DIR); + g_mkdir (GDM_SDTLOGIN_DIR, 0700); + } #endif /* Signal handling */ diff --git a/daemon/gdm.h b/daemon/gdm.h index 1e8e2345..d586e9e2 100644 --- a/daemon/gdm.h +++ b/daemon/gdm.h @@ -68,7 +68,8 @@ enum { #define GDM_CUSTOM_COMMAND_MAX 10 /* maximum number of supported custom commands */ #ifdef __sun -#define SDTLOGIN_DIR "/var/dt/sdtlogin" +#define GDM_DT_DIR "/var/dt" +#define GDM_SDTLOGIN_DIR "/var/dt/sdtlogin" #endif /* If id == NULL, then get the first X server */ diff --git a/daemon/server.c b/daemon/server.c index da01ddfd..71bfb307 100644 --- a/daemon/server.c +++ b/daemon/server.c @@ -1320,12 +1320,12 @@ gdm_server_spawn (GdmDisplay *d, const char *vtarg) setgroups (1, groups); } -#if sun +#if __sun { /* Remove old communication pipe, if present */ char old_pipe[MAXPATHLEN]; - sprintf (old_pipe, "%s/%d", SDTLOGIN_DIR, d->name); + sprintf (old_pipe, "%s/%d", GDM_SDTLOGIN_DIR, d->name); g_unlink (old_pipe); } #endif diff --git a/daemon/verify-pam.c b/daemon/verify-pam.c index 7c8ad4e2..140d3395 100644 --- a/daemon/verify-pam.c +++ b/daemon/verify-pam.c @@ -360,17 +360,17 @@ solaris_xserver_cred (char *login, GdmDisplay *d, struct passwd *pwent) displayNumber = atoi (tmp); } - sprintf (pipe, "%s/%d", SDTLOGIN_DIR, displayNumber); + sprintf (pipe, "%s/%d", GDM_SDTLOGIN_DIR, displayNumber); - if (g_stat (SDTLOGIN_DIR, &statbuf) == 0) { + if (g_stat (GDM_SDTLOGIN_DIR, &statbuf) == 0) { if (! statbuf.st_mode & S_IFDIR) { gdm_debug ("solaris_xserver_cred: %s is not a directory\n", - SDTLOGIN_DIR); + GDM_SDTLOGIN_DIR); return; } } else { - gdm_debug ("solaris_xserver_cred: %s does not exist\n", SDTLOGIN_DIR); + gdm_debug ("solaris_xserver_cred: %s does not exist\n", GDM_SDTLOGIN_DIR); return; } -- cgit v1.2.1