[gdm/wip/initial-setup2] put initial setup log file in somewhere writable by initial setup user
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/wip/initial-setup2] put initial setup log file in somewhere writable by initial setup user
- Date: Wed, 11 Apr 2012 22:45:06 +0000 (UTC)
commit a18a92d9fd49676d8d7fb7bbeddd7963a5929697
Author: Ray Strode <rstrode redhat com>
Date: Wed Apr 11 10:43:42 2012 -0400
put initial setup log file in somewhere writable by initial setup user
daemon/gdm-setup-session.c | 1 +
daemon/gdm-welcome-session.c | 33 ++++++++++++++++++++++++++++++---
2 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/daemon/gdm-setup-session.c b/daemon/gdm-setup-session.c
index 0ad409e..d8bbefc 100644
--- a/daemon/gdm-setup-session.c
+++ b/daemon/gdm-setup-session.c
@@ -146,6 +146,7 @@ gdm_setup_session_new (const char *display_name,
object = g_object_new (GDM_TYPE_SETUP_SESSION,
"command", BINDIR "/gnome-session --debug --session gdm-setup",
+ "log-file", ".xsession-errors",
"server-dbus-path", GDM_GREETER_SERVER_DBUS_PATH,
"server-dbus-interface", GDM_GREETER_SERVER_DBUS_INTERFACE,
"server-env-var-name", "GDM_GREETER_DBUS_ADDRESS",
diff --git a/daemon/gdm-welcome-session.c b/daemon/gdm-welcome-session.c
index 24f9015..ae75683 100644
--- a/daemon/gdm-welcome-session.c
+++ b/daemon/gdm-welcome-session.c
@@ -59,6 +59,7 @@ struct GdmWelcomeSessionPrivate
{
GdmSession *session;
char *command;
+ char *log_file;
GPid pid;
char *user_name;
@@ -94,6 +95,7 @@ enum {
PROP_RUNTIME_DIR,
PROP_SERVER_ADDRESS,
PROP_COMMAND,
+ PROP_LOG_FILE,
PROP_SERVER_DBUS_PATH,
PROP_SERVER_DBUS_INTERFACE,
PROP_SERVER_ENV_VAR_NAME
@@ -769,9 +771,13 @@ on_conversation_started (GdmSession *session,
char *log_path;
char *log_file;
- log_file = g_strdup_printf ("%s-greeter.log", welcome_session->priv->x11_display_name);
- log_path = g_build_filename (LOGDIR, log_file, NULL);
- g_free (log_file);
+ if (welcome_session->priv->log_file == NULL) {
+ log_file = g_strdup_printf ("%s-greeter.log", welcome_session->priv->x11_display_name);
+ log_path = g_build_filename (LOGDIR, log_file, NULL);
+ g_free (log_file);
+ } else {
+ log_path = g_strdup (welcome_session->priv->log_file);
+ }
gdm_session_setup_for_program (GDM_SESSION (welcome_session->priv->session),
"gdm-welcome",
@@ -1006,6 +1012,14 @@ _gdm_welcome_session_set_command (GdmWelcomeSession *welcome_session,
}
static void
+_gdm_welcome_session_set_log_file (GdmWelcomeSession *welcome_session,
+ const char *log_file)
+{
+ g_free (welcome_session->priv->log_file);
+ welcome_session->priv->log_file = g_strdup (log_file);
+}
+
+static void
_gdm_welcome_session_set_server_env_var_name (GdmWelcomeSession *welcome_session,
const char *name)
{
@@ -1066,6 +1080,9 @@ gdm_welcome_session_set_property (GObject *object,
case PROP_COMMAND:
_gdm_welcome_session_set_command (self, g_value_get_string (value));
break;
+ case PROP_LOG_FILE:
+ _gdm_welcome_session_set_log_file (self, g_value_get_string (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1125,6 +1142,9 @@ gdm_welcome_session_get_property (GObject *object,
case PROP_COMMAND:
g_value_set_string (value, self->priv->command);
break;
+ case PROP_LOG_FILE:
+ g_value_set_string (value, self->priv->log_file);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1240,6 +1260,13 @@ gdm_welcome_session_class_init (GdmWelcomeSessionClass *klass)
"command",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class,
+ PROP_LOG_FILE,
+ g_param_spec_string ("log-file",
+ "log file",
+ "log file",
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
signals [STARTED] =
g_signal_new ("started",
G_OBJECT_CLASS_TYPE (object_class),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]