summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2009-01-06 00:30:11 +0000
committerBrian Cameron <bcameron@src.gnome.org>2009-01-06 00:30:11 +0000
commit3600fb4170487f8e4352ca711349272cb8fa3cc1 (patch)
tree68a0e3e98a997449b7d60663bf00c157bb64eb47
parent4e7d75fae3210d524b1cce8b7fdc2174e6a27fe3 (diff)
downloadgdm-3600fb4170487f8e4352ca711349272cb8fa3cc1.tar.gz
Update SDTLOGIN logic so that the "/var/dt" directory gets created if it
2008-01-05 Brian Cameron <brian.cameron@sun.com> * 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
-rw-r--r--ChangeLog8
-rw-r--r--daemon/gdm-daemon-config.c2
-rw-r--r--daemon/gdm.c14
-rw-r--r--daemon/gdm.h3
-rw-r--r--daemon/server.c4
-rw-r--r--daemon/verify-pam.c8
6 files changed, 29 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index c73664c3..784717b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2008-01-05 Brian Cameron <brian.cameron@sun.com>
+ * 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 <brian.cameron@sun.com>
+
* daemon/verify-pam.c: Make sure that pwent gets set before
calling audit_fail_login, otherwise the audit record is not
set properly.
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;
}