summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2007-04-09 04:19:36 +0000
committerBrian Cameron <bcameron@src.gnome.org>2007-04-09 04:19:36 +0000
commit0675be47df9c268615475d16df5aeae6e3cd28e5 (patch)
tree31cf3306042846dae8650200ea951177569cd468
parentaea71cbf7d3c8592d22f8a5de4092f6f38816dfa (diff)
downloadgdm-0675be47df9c268615475d16df5aeae6e3cd28e5.tar.gz
Deprecated GDM_KEY_PID_FILE and now use /var/run/gdm.pid. This fixes bug
2007-04-09 Brian Cameron <brian.cameron@sun.com> * configure.ac, daemon/gdm.[ch], gui/gdmlogin.c, gui/gdmcomm.c, gui/gdmXnestchooser.c, gui/greeter/greeter.c: Deprecated GDM_KEY_PID_FILE and now use /var/run/gdm.pid. This fixes bug #162849. Backported from head, patch by William Jon McCann <mccann@jhu.edu>. * NEWS: Minor correction to comment. svn path=/branches/gnome-2-16/; revision=4791
-rw-r--r--NEWS5
-rw-r--r--configure.ac15
-rw-r--r--daemon/gdm.c13
-rw-r--r--daemon/gdm.h7
-rw-r--r--gui/gdmXnestchooser.c2
-rw-r--r--gui/gdmcomm.c2
-rw-r--r--gui/gdmlogin.c1
-rw-r--r--gui/greeter/greeter.c1
8 files changed, 30 insertions, 16 deletions
diff --git a/NEWS b/NEWS
index 408efea0..1ee1ad82 100644
--- a/NEWS
+++ b/NEWS
@@ -12,8 +12,9 @@ Ahh news...
- Fix for a recently reported security issue that has ID
CVE-2006-6105. This fixes a problem where a user can
- enter strings like "%08x" into the gdmchooser "Add"j
- host button and print out memory. (Brian Cameron)
+ enter strings like "%08x" into the gdmchooser entry and
+ press the "Add" host button to print out memory contents.
+ (Brian Cameron)
- Fix for TryExec check in gdmsession to make sure that any
arguments are not passed to g_find_program_in_path since
diff --git a/configure.ac b/configure.ac
index b8389fd1..a52e8bf0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1055,6 +1055,21 @@ if test "x$USER_POST_PATH" != "x"; then
GDM_USER_PATH="$GDM_USER_PATH:$USER_POST_PATH"
fi
+dnl ---------------------------------------------------------------------------
+dnl - PID file
+dnl ---------------------------------------------------------------------------
+
+AC_ARG_WITH(pid-file, [ --with-pid-file=<file> pid file])
+
+if ! test -z "$with_pid_file"; then
+ GDM_PID_FILE=$with_pid_file
+else
+ GDM_PID_FILE=/var/run/gdm.pid
+fi
+
+AC_SUBST(GDM_PID_FILE)
+AC_DEFINE_UNQUOTED(GDM_PID_FILE, "$GDM_PID_FILE", [pid file])
+
AC_SUBST(HALT_COMMAND)
AC_DEFINE_UNQUOTED(HALT_COMMAND,"$HALT_COMMAND")
AC_SUBST(REBOOT_COMMAND)
diff --git a/daemon/gdm.c b/daemon/gdm.c
index a4a4cfea..a4fc7adc 100644
--- a/daemon/gdm.c
+++ b/daemon/gdm.c
@@ -186,7 +186,7 @@ gdm_daemonify (void)
pid = fork ();
if (pid > 0) {
- gchar *pidfile = gdm_get_value_string (GDM_KEY_PID_FILE);
+ gchar *pidfile = GDM_PID_FILE;
errno = 0;
if ((pf = gdm_safe_fopen_w (pidfile)) != NULL) {
@@ -386,7 +386,7 @@ gdm_final_cleanup (void)
closelog ();
- pidfile = gdm_get_value_string (GDM_KEY_PID_FILE);
+ pidfile = GDM_PID_FILE;
if (pidfile != NULL) {
VE_IGNORE_EINTR (g_unlink (pidfile));
}
@@ -1502,7 +1502,7 @@ main (int argc, char *argv[])
/* get the name of the root user */
gdm_root_user ();
- pidfile = gdm_get_value_string (GDM_KEY_PID_FILE);
+ pidfile = GDM_PID_FILE;
/* Check if another gdm process is already running */
if (g_access (pidfile, R_OK) == 0) {
@@ -1517,8 +1517,6 @@ main (int argc, char *argv[])
kill (pidv, 0) == 0 &&
linux_only_is_running (pidv)) {
/* make sure the pid file doesn't get wiped */
- gdm_set_value_string (GDM_KEY_PID_FILE, NULL);
- pidfile = NULL;
VE_IGNORE_EINTR (fclose (pf));
gdm_fail (_("GDM already running. Aborting!"));
}
@@ -3182,7 +3180,10 @@ gdm_handle_user_message (GdmConnection *conn, const gchar *msg, gpointer data)
done_prefetch = TRUE;
}
return;
- }
+ } else if (strcmp (splitstr[0], GDM_KEY_PID_FILE) == 0) {
+ gdm_connection_printf (conn, "OK %s\n", GDM_PID_FILE);
+ return;
+ }
if (splitstr[0] != NULL) {
/*
diff --git a/daemon/gdm.h b/daemon/gdm.h
index aefd95d5..c00e2f8f 100644
--- a/daemon/gdm.h
+++ b/daemon/gdm.h
@@ -1,4 +1,4 @@
-/* GDM - The GNOME Display Manager
+S
* Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
*
* This program is free software; you can redistribute it and/or modify
@@ -184,8 +184,7 @@ enum {
*
* + The gui/gdmsetup.c program should be updated to support the new option
* unless there's a good reason not to (like it is a configuration value
- * that only someone who really knows what they are doing should change
- * like GDM_KEY_PID_FILE).
+ * that only someone who really knows what they are doing should change).
*
* + Currently GDM treats any key in the "gui" and "greeter" categories,
* and security/PamStack as available for per-display configuration.
@@ -227,7 +226,7 @@ enum {
#define GDM_KEY_KILL_INIT_CLIENTS "daemon/KillInitClients=true"
#define GDM_KEY_LOG_DIR "daemon/LogDir=" LOGDIR
#define GDM_KEY_PATH "daemon/DefaultPath=" GDM_USER_PATH
-#define GDM_KEY_PID_FILE "daemon/PidFile=/var/run/gdm.pid"
+#define GDM_KEY_PID_FILE "daemon/PidFile=" GDM_PID_FILE
#define GDM_KEY_POSTSESSION "daemon/PostSessionScriptDir=" GDMCONFDIR "/PostSession/"
#define GDM_KEY_PRESESSION "daemon/PreSessionScriptDir=" GDMCONFDIR "/PreSession/"
#define GDM_KEY_POSTLOGIN "daemon/PostLoginScriptDir=" GDMCONFDIR "/PreSession/"
diff --git a/gui/gdmXnestchooser.c b/gui/gdmXnestchooser.c
index 3a95f173..eb0d11cf 100644
--- a/gui/gdmXnestchooser.c
+++ b/gui/gdmXnestchooser.c
@@ -501,7 +501,7 @@ main (int argc, char *argv[])
xdmcp_enabled = gdm_config_get_bool (GDM_KEY_XDMCP);
honor_indirect = gdm_config_get_bool (GDM_KEY_INDIRECT);
- pidfile = gdm_config_get_string (GDM_KEY_PID_FILE);
+ pidfile = GDM_PID_FILE;
xnest = gdm_config_get_string (GDM_KEY_XNEST);
/* At this point we are done using the socket, so close it */
diff --git a/gui/gdmcomm.c b/gui/gdmcomm.c
index a5d5080e..0e8ec352 100644
--- a/gui/gdmcomm.c
+++ b/gui/gdmcomm.c
@@ -593,7 +593,7 @@ gdmcomm_check (gboolean show_dialog)
struct stat s;
int statret;
- pidfile = gdm_config_get_string (GDM_KEY_PID_FILE);
+ pidfile = GDM_PID_FILE;
pid = 0;
if (pidfile != NULL)
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index 62df97de..58c71d2c 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -3042,7 +3042,6 @@ gdm_read_config (void)
/* Keys not to include in reread_config */
gdm_config_get_bool (GDM_KEY_LOCK_POSITION);
- gdm_config_get_string (GDM_KEY_PID_FILE);
gdm_config_get_int (GDM_KEY_POSITION_X);
gdm_config_get_int (GDM_KEY_POSITION_Y);
gdm_config_get_string (GDM_KEY_PRE_FETCH_PROGRAM);
diff --git a/gui/greeter/greeter.c b/gui/greeter/greeter.c
index c0f80579..97c5d307 100644
--- a/gui/greeter/greeter.c
+++ b/gui/greeter/greeter.c
@@ -798,7 +798,6 @@ gdm_read_config (void)
/* Keys not to include in reread_config */
gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR);
- gdm_config_get_string (GDM_KEY_PID_FILE);
gdm_config_get_string (GDM_KEY_PRE_FETCH_PROGRAM);
gdmcomm_comm_bulk_stop ();