diff options
author | Brian Cameron <brian.cameron@sun.com> | 2006-03-13 21:18:24 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2006-03-13 21:18:24 +0000 |
commit | 8a82034e911fc6a6cfd508792333bfb09e422e9a (patch) | |
tree | f18f27e1178922a354e8f670e203833fa387a8ab | |
parent | 8ca9bca9f56d31a5710a5914f07f968928db30bd (diff) | |
download | gdm-8a82034e911fc6a6cfd508792333bfb09e422e9a.tar.gz |
Add new GET_CUSTOM_CONFIG_FILE gdmflexiserver command so gdmsetup can edit
2006-03-05 Brian Cameron <brian.cameron@sun.com>
* daemon/gdm.[ch], daemon/gdmconfig.[ch], gui/gdmcommon.[ch],
gui/gdmsetup.c: Add new GET_CUSTOM_CONFIG_FILE gdmflexiserver
command so gdmsetup can edit the actual custom config file
being used by the daemon.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | daemon/gdm.c | 9 | ||||
-rw-r--r-- | daemon/gdm.h | 14 | ||||
-rw-r--r-- | daemon/gdmconfig.c | 11 | ||||
-rw-r--r-- | daemon/gdmconfig.h | 1 | ||||
-rw-r--r-- | gui/gdmcommon.c | 25 | ||||
-rw-r--r-- | gui/gdmcommon.h | 1 | ||||
-rw-r--r-- | gui/gdmsetup.c | 7 |
8 files changed, 71 insertions, 4 deletions
@@ -1,5 +1,12 @@ 2006-03-05 Brian Cameron <brian.cameron@sun.com> + * daemon/gdm.[ch], daemon/gdmconfig.[ch], gui/gdmcommon.[ch], + gui/gdmsetup.c: Add new GET_CUSTOM_CONFIG_FILE gdmflexiserver + command so gdmsetup can edit the actual custom config file + being used by the daemon. + +2006-03-05 Brian Cameron <brian.cameron@sun.com> + * gui/greeter/greeter_canvas_item: Now open Options menu below the button if possible, and above if there is no room below. Previously it always showed above, which would break if the diff --git a/daemon/gdm.c b/daemon/gdm.c index 6a65798c..f5967835 100644 --- a/daemon/gdm.c +++ b/daemon/gdm.c @@ -1237,7 +1237,7 @@ struct poptOption options [] = { { "no-console", '\0', POPT_ARG_NONE, &no_console, 0, N_("No console (static) servers to be run"), NULL }, { "config", '\0', POPT_ARG_STRING, - &config_file, 0, N_("Alternative configuration file"), N_("CONFIGFILE") }, + &config_file, 0, N_("Alternative defaults configuration file"), N_("CONFIGFILE") }, { "preserve-ld-vars", '\0', POPT_ARG_NONE, &preserve_ld_vars, 0, N_("Preserve LD_* variables"), NULL }, { "version", '\0', POPT_ARG_NONE, @@ -3142,6 +3142,13 @@ gdm_handle_user_message (GdmConnection *conn, const gchar *msg, gpointer data) g_string_append (msg, "\n"); gdm_connection_printf (conn, "OK %s\n", config_file); g_string_free (msg, TRUE); + } else if (strcmp (msg, GDM_SUP_GET_CUSTOM_CONFIG_FILE) == 0) { + GString *msg; + + msg = g_string_new ("OK"); + g_string_append (msg, "\n"); + gdm_connection_printf (conn, "OK %s\n", gdm_get_custom_config_file ()); + g_string_free (msg, TRUE); } else if (strcmp (msg, GDM_SUP_QUERY_LOGOUT_ACTION) == 0) { const gchar *sep = " "; GdmDisplay *disp; diff --git a/daemon/gdm.h b/daemon/gdm.h index 4a14efe5..4a583467 100644 --- a/daemon/gdm.h +++ b/daemon/gdm.h @@ -988,7 +988,7 @@ void gdm_final_cleanup (void); * 999 = Unknown error */ #define GDM_SUP_GET_CONFIG_FILE "GET_CONFIG_FILE" /* None */ -/* GET_CONFIG_FILE: Get config file location being used by +/* GET_CONFIG_FILE: Get defaults config file location being used by # the daemon. If the GDM daemon was started * with the --config option, it will return * the value passed in via that argument. @@ -1001,6 +1001,18 @@ void gdm_final_cleanup (void); * 200 = Too many messages * 999 = Unknown error */ +#define GDM_SUP_GET_CUSTOM_CONFIG_FILE "GET_CUSTOM_CONFIG_FILE" /* None */ +/* GET_CONFIG_FILE: Get custom config file location being used by + # the daemon. + * Supported since: 2.14.0.0 + * Arguments: None + * Answers: + * OK <full path to GDM configuration file> + * ERROR <err number> <english error description> + * 0 = Not implemented + * 200 = Too many messages + * 999 = Unknown error + */ #define GDM_SUP_UPDATE_CONFIG "UPDATE_CONFIG" /* <key> */ /* UPDATE_CONFIG: Tell the daemon to re-read a key from the * GDM configuration file. Any user can request diff --git a/daemon/gdmconfig.c b/daemon/gdmconfig.c index 9a09614b..dfee829c 100644 --- a/daemon/gdmconfig.c +++ b/daemon/gdmconfig.c @@ -607,6 +607,17 @@ gdm_get_custom_config (struct stat *statbuf) } /** + * gdm_get_custom_config_file + * + * Returns the custom config file being used. + */ +gchar * +gdm_get_custom_config_file (void) +{ + return custom_config_file; +} + +/** * gdm_get_value_int * * Gets an integer configuration option by key. The option must diff --git a/daemon/gdmconfig.h b/daemon/gdmconfig.h index e45a4d1c..c3ee7a32 100644 --- a/daemon/gdmconfig.h +++ b/daemon/gdmconfig.h @@ -23,6 +23,7 @@ #include "ve-misc.h" +gchar* gdm_get_custom_config_file (void); gchar* gdm_get_value_string (gchar *key); gboolean gdm_get_value_bool (gchar *key); gint gdm_get_value_int (gchar *key); diff --git a/gui/gdmcommon.c b/gui/gdmcommon.c index bd088434..7166526f 100644 --- a/gui/gdmcommon.c +++ b/gui/gdmcommon.c @@ -392,6 +392,31 @@ gdm_common_get_config_file (void) return config_file; } +gchar * +gdm_common_get_custom_config_file (void) +{ + gchar *result; + gchar *config_file; + + /* Get config file */ + result = gdmcomm_call_gdm ("GET_CUSTOM_CONFIG_FILE", NULL /* auth cookie */, "2.8.0.2", 5); + if (! result) + return NULL; + + if (ve_string_empty (result) || + strncmp (result, "OK ", 3) != 0) { + g_free (result); + return NULL; + } + + /* skip the "OK " */ + config_file = g_strdup (result + 3); + + g_free (result); + + return config_file; +} + gboolean gdm_common_select_time_format (void) { diff --git a/gui/gdmcommon.h b/gui/gdmcommon.h index 2f88f495..2a72d528 100644 --- a/gui/gdmcommon.h +++ b/gui/gdmcommon.h @@ -59,6 +59,7 @@ GdkPixbuf *gdm_common_get_face (const char *filename, guint max_height); gchar* gdm_common_get_config_file (void); +gchar* gdm_common_get_custom_config_file (void); gboolean gdm_common_select_time_format (void); void gdm_common_setup_background_color (gchar *bg_color); gchar* gdm_common_get_welcomemsg (void); diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c index 7a996164..399031cf 100644 --- a/gui/gdmsetup.c +++ b/gui/gdmsetup.c @@ -6455,13 +6455,16 @@ main (int argc, char *argv[]) gtk_window_set_default_icon_from_file (DATADIR"/pixmaps/gdm-setup.png", NULL); glade_gnome_init(); - custom_config_file = g_strdup_printf ("%s", GDM_CUSTOM_CONF); - config_file = gdm_common_get_config_file (); if (config_file == NULL) { g_print (_("Could not access GDM configuration file.\n")); exit (EXIT_FAILURE); } + custom_config_file = gdm_common_get_custom_config_file (); + if (config_file == NULL) { + g_print (_("Could not access GDM configuration file.\n")); + exit (EXIT_FAILURE); + } gdm_running = gdmcomm_check (FALSE); |