Commit 10db3464 authored by Brian Cameron's avatar Brian Cameron Committed by Brian Cameron

Phase 1 of removing vicious-extensions and replacing with a rewrite.

2006-03-20  Brian Cameron  <brian.cameron@sun.com>

        * configure.ac, autogen.sh, gui/gdmlanguages.c, gui/gdmconfig.h
          gui/gdmuser.c, gui/gdmwm.c, gui/gdmdynamic.c, gui/gdmlogin.c,
          gui/gdmphotosetup.c, gui/gdmsession.c, gui/gdmXnestchooser.c,
          gui/greeter/greeter.c, gui/gdmcommon.c, gui/gdmcomm.c,
          gui/gdmflexiserver.c, gui/gdmsetup.c, gui/gdmchooser.c,
          gui/misc.c, gui/gdmmconfig.c, gui/Makefile.am
          gui/greeter/greeter_item_customlist.c,
          gui/greeter/greeter_canvas_item.c gui/greeter/greeter_parser.c,
          gui/greeter/greeter_item.c, gui/greeter/greeter_item_ulist.c,
          gui/greeter/greeter_item_timed.c, gui/greeter/greeter_session.c,
          gui/greeter/greeter_system.c, gui/greeter/greeter_item_pam.c,
          gui/greeter/Makefile.am, gui/greeter/themes/Makefile.am,
          common/gdm-common.[ch], common/gdm-common-config.[ch],
          common/ve-signal.[ch], common/Makefile.am, daemon/errorgui.c,
          daemon/gdmconfig.h, daemon/display.c, daemon/gdm.c, daemon/xdmcp.c,
          daemon/filecheck.c, daemon/verify-pam.c, daemon/getvt.c,
          daemon/auth.c, daemon/server.c, daemon/cookie.c, daemon/slave.c,
          daemon/server.h, daemon/misc.c, daemon/gdm-net.c,
          daemon/gdmconfig.c, daemon/Makefile.am:  Phase 1 of removing
          vicious-extensions and replacing with a rewrite.  Changes include:
          - Create a common directory to build libgdmcommon, used by the
            daemon and the GUI's.
          - Add a convenience layer over GKeyFile for dealing with compound
            keys.
          - Replace selected ve functions like ve_split
          - Remove glade_helper
          - Code improvements and leaks.
          Fix by William Jon McCann <mccann@jhu.edu>.  Refer to bug
          #355425.

svn path=/trunk/; revision=4689
parent 81953a7a
2006-03-20 Brian Cameron <brian.cameron@sun.com>
* configure.ac, autogen.sh, gui/gdmlanguages.c, gui/gdmconfig.h
gui/gdmuser.c, gui/gdmwm.c, gui/gdmdynamic.c, gui/gdmlogin.c,
gui/gdmphotosetup.c, gui/gdmsession.c, gui/gdmXnestchooser.c,
gui/greeter/greeter.c, gui/gdmcommon.c, gui/gdmcomm.c,
gui/gdmflexiserver.c, gui/gdmsetup.c, gui/gdmchooser.c,
gui/misc.c, gui/gdmmconfig.c, gui/Makefile.am
gui/greeter/greeter_item_customlist.c,
gui/greeter/greeter_canvas_item.c gui/greeter/greeter_parser.c,
gui/greeter/greeter_item.c, gui/greeter/greeter_item_ulist.c,
gui/greeter/greeter_item_timed.c, gui/greeter/greeter_session.c,
gui/greeter/greeter_system.c, gui/greeter/greeter_item_pam.c,
gui/greeter/Makefile.am, gui/greeter/themes/Makefile.am,
common/gdm-common.[ch], common/gdm-common-config.[ch],
common/ve-signal.[ch], common/Makefile.am, daemon/errorgui.c,
daemon/gdmconfig.h, daemon/display.c, daemon/gdm.c, daemon/xdmcp.c,
daemon/filecheck.c, daemon/verify-pam.c, daemon/getvt.c,
daemon/auth.c, daemon/server.c, daemon/cookie.c, daemon/slave.c,
daemon/server.h, daemon/misc.c, daemon/gdm-net.c,
daemon/gdmconfig.c, daemon/Makefile.am: Phase 1 of removing
vicious-extensions and replacing with a rewrite. Changes include:
- Create a common directory to build libgdmcommon, used by the
daemon and the GUI's.
- Add a convenience layer over GKeyFile for dealing with compound
keys.
- Replace selected ve functions like ve_split
- Remove glade_helper
- Code improvements and leaks.
Fix by William Jon McCann <mccann@jhu.edu>. Refer to bug
#355425.
2006-03-20 Brian Cameron <brian.cameron@sun.com>
* config/Xsession.in, daemon/gdm.c, daemon/slave.c,
......
SUBDIRS = \
po \
config \
pixmaps \
vicious-extensions \
daemon \
gui \
utils \
docs
NULL =
SUBDIRS = \
po \
config \
pixmaps \
common \
daemon \
gui \
utils \
docs \
$(NULL)
# add these when help gets added back
# docs omf-install
......
......@@ -9,13 +9,6 @@ test -z "$srcdir" && srcdir=.
PKG_NAME="GDM"
if test ! -d $srcdir/vicious-extensions; then
echo -n "**Error**: vicious-extensions not found, please do a clean "
echo "checkout or do:"
echo "svn co http://svn.gnome.org/svn/vicious-extensions/trunk vicious-extensions"
exit 1
fi
(test -f $srcdir/configure.ac \
&& test -d $srcdir/daemon \
&& test -f $srcdir/daemon/gdm.h) || {
......
......@@ -172,9 +172,9 @@ AC_CHECK_FUNCS(_NSGetEnviron)
GNOME_COMPILE_WARNINGS
CFLAGS="$CFLAGS $WARN_CFLAGS"
PKG_CHECK_MODULES(VICIOUS, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED)
AC_SUBST(VICIOUS_CFLAGS)
AC_SUBST(VICIOUS_LIBS)
PKG_CHECK_MODULES(COMMON, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED)
AC_SUBST(COMMON_CFLAGS)
AC_SUBST(COMMON_LIBS)
PKG_CHECK_MODULES(DAEMON, gtk+-2.0 >= $GTK_REQUIRED)
AC_SUBST(DAEMON_CFLAGS)
......@@ -268,8 +268,8 @@ AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton, [
EXTRA_CHOOSER_LIBS="$EXTRA_CHOOSER_LIBS -lresolv"])])
VICIOUS_GNOME_LIBS="libviciousui.a libviciousui-minimal.a "
AC_SUBST(VICIOUS_GNOME_LIBS)
COMMON_GNOME_LIBS="libgdmcommon-ui.a"
AC_SUBST(COMMON_GNOME_LIBS)
dnl *****************************
dnl IPv6 specific checks
......@@ -1169,7 +1169,7 @@ pixmaps/32x32/Makefile
pixmaps/48x48/Makefile
config/Makefile
po/Makefile.in
vicious-extensions/Makefile
common/Makefile
docs/Makefile
docs/de/Makefile
docs/es/Makefile
......
......@@ -5,7 +5,7 @@
INCLUDES = \
-I. \
-I.. \
-I$(top_srcdir)/vicious-extensions \
-I$(top_srcdir)/common \
-DAUTHDIR=\"$(authdir)\" \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\" \
......@@ -91,7 +91,7 @@ gdm_binary_LDADD = \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(GDK_LIBS) \
$(top_builddir)/vicious-extensions/libvicious.a \
$(top_builddir)/common/libgdmcommon.a \
$(X_LIBS) \
$(XINERAMA_LIBS) \
$(XDMCP_LIBS) \
......
......@@ -24,11 +24,13 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netdb.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <errno.h>
#include <X11/Xauth.h>
#include <glib/gi18n.h>
......@@ -39,6 +41,8 @@
#include "auth.h"
#include "gdmconfig.h"
#include "gdm-common.h"
/* Ensure we know about FamilyInternetV6 even if what we're compiling
against doesn't */
#ifdef ENABLE_IPV6
......
......@@ -43,6 +43,8 @@
#include "cookie.h"
#include "gdmconfig.h"
#include "gdm-common.h"
#define MAXBUFFERSIZE 1024
struct rngs {
......
......@@ -41,6 +41,8 @@
#include "gdm-net.h"
#include "gdmconfig.h"
#include "gdm-common.h"
/* External vars */
extern gint xdmcp_sessions;
extern gint flexi_servers;
......
......@@ -43,6 +43,8 @@
#include "errorgui.h"
#include "slave.h"
#include "gdm-common.h"
/* set in the main function */
extern char **stored_argv;
extern int stored_argc;
......
......@@ -26,6 +26,8 @@
#include "filecheck.h"
#include "gdmconfig.h"
#include "gdm-common.h"
/**
* gdm_file_check:
* @caller: String to be prepended to syslog error messages.
......
......@@ -37,6 +37,8 @@
#include "gdm-net.h"
#include "gdmconfig.h"
#include "gdm-common.h"
/*
* Kind of a weird setup, new connections whack old connections.
*
......
......@@ -52,7 +52,7 @@
#include <glib-object.h>
/* Needed for signal handling */
#include <vicious.h>
#include <gdm-common.h>
#include "gdm.h"
#include "misc.h"
......@@ -636,10 +636,15 @@ suspend_machine (void)
/* short sleep to give some processing time to master */
usleep (1000);
argv = ve_split (suspend);
argv = NULL;
g_shell_parse_argv (suspend, NULL, &argv, NULL);
if (argv != NULL && argv[0] != NULL)
VE_IGNORE_EINTR (execv (argv[0], argv));
/* FIXME: what about fail */
g_strfreev (argv);
_exit (1);
}
}
......@@ -678,6 +683,7 @@ static void
halt_machine (void)
{
char **argv;
const char *s;
gdm_info (_("Master halting..."));
......@@ -688,18 +694,26 @@ halt_machine (void)
change_to_first_and_clear (FALSE);
#endif /* __linux */
argv = ve_split (gdm_get_value_string (GDM_KEY_HALT));
argv = NULL;
s = gdm_get_value_string (GDM_KEY_HALT);
if (s != NULL) {
g_shell_parse_argv (s, NULL, &argv, NULL);
}
if (argv != NULL && argv[0] != NULL)
VE_IGNORE_EINTR (execv (argv[0], argv));
gdm_error (_("%s: Halt failed: %s"),
"gdm_child_action", strerror (errno));
g_strfreev (argv);
}
static void
restart_machine (void)
{
char **argv;
const char *s;
gdm_info (_("Restarting computer..."));
......@@ -710,12 +724,19 @@ restart_machine (void)
change_to_first_and_clear (TRUE);
#endif /* __linux */
argv = ve_split (gdm_get_value_string (GDM_KEY_REBOOT));
argv = NULL;
s = gdm_get_value_string (GDM_KEY_REBOOT);
if (s != NULL) {
g_shell_parse_argv (s, NULL, &argv, NULL);
}
if (argv != NULL && argv[0] != NULL)
VE_IGNORE_EINTR (execv (argv[0], argv));
gdm_error (_("%s: Restart failed: %s"),
"gdm_child_action", strerror (errno));
g_strfreev (argv);
}
static void
......@@ -741,28 +762,35 @@ custom_cmd (long cmd_id)
static void
custom_cmd_restart (long cmd_id)
{
{
gchar * key_string;
char **argv;
const char *s;
gdm_info (_("Executing custom command %ld with restart option..."), cmd_id);
gdm_final_cleanup ();
VE_IGNORE_EINTR (g_chdir ("/"));
#ifdef __linux__
change_to_first_and_clear (TRUE);
#endif /* __linux */
key_string = g_strdup_printf (_("%s%ld="), GDM_KEY_CUSTOM_CMD_TEMPLATE, cmd_id);
argv = ve_split (gdm_get_value_string (key_string));
g_free(key_string);
argv = NULL;
s = gdm_get_value_string (key_string);
g_free (key_string);
if (s != NULL) {
g_shell_parse_argv (s, NULL, &argv, NULL);
}
if (argv != NULL && argv[0] != NULL)
VE_IGNORE_EINTR (execv (argv[0], argv));
g_strfreev (argv);
gdm_error (_("%s: Execution of custom command failed: %s"),
g_strfreev (argv);
gdm_error (_("%s: Execution of custom command failed: %s"),
"gdm_child_action", strerror (errno));
}
......@@ -774,7 +802,7 @@ custom_cmd_no_restart (long cmd_id)
gdm_info (_("Executing custom command %ld with no restart option ..."), cmd_id);
pid = fork ();
if (pid < 0) {
/*failed fork*/
gdm_error (_("custom_cmd: forking process for custom command %ld failed"), cmd_id);
......@@ -783,18 +811,26 @@ custom_cmd_no_restart (long cmd_id)
else if (pid == 0) {
/* child */
char **argv;
gchar * key_string = g_strdup_printf (_("%s%ld="), GDM_KEY_CUSTOM_CMD_TEMPLATE, cmd_id);
argv = ve_split (gdm_get_value_string (key_string));
g_free(key_string);
const char *s;
gchar *key_string;
key_string = g_strdup_printf (_("%s%ld="), GDM_KEY_CUSTOM_CMD_TEMPLATE, cmd_id);
argv = NULL;
s = gdm_get_value_string (key_string);
g_free (key_string);
if (s != NULL) {
g_shell_parse_argv (s, NULL, &argv, NULL);
}
if (argv != NULL && argv[0] != NULL)
VE_IGNORE_EINTR (execv (argv[0], argv));
g_strfreev (argv);
g_strfreev (argv);
gdm_error (_("%s: Execution of custom command failed: %s"),
"gdm_child_action", strerror (errno));
_exit (0);
_exit (0);
}
else {
/* parent */
......@@ -804,10 +840,10 @@ custom_cmd_no_restart (long cmd_id)
if G_LIKELY (WIFEXITED (exitstatus)){
status = WEXITSTATUS (exitstatus);
gdm_debug (_("custom_cmd: child %d returned %d"), p_stat, status);
}
}
return;
}
}
}
}
static gboolean
......@@ -1865,9 +1901,14 @@ write_x_servers (GdmDisplay *d)
if (SERVER_IS_LOCAL (d)) {
char **argv;
char *command;
argv = gdm_server_resolve_command_line
(d, FALSE /* resolve_flags */,
NULL /* vtarg */);
int argc;
argc = 0;
argv = NULL;
gdm_server_resolve_command_line (d,
FALSE, /* resolve_flags */
NULL, /* vtarg */
&argc,
&argv);
command = g_strjoinv (" ", argv);
g_strfreev (argv);
VE_IGNORE_EINTR (fprintf (fp, "%s local %s\n", d->name, command));
......
This diff is collapsed.
/* GDM - The GNOME Display Manager
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* GDM - The GNOME Display Manager
* Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
* Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
*
......@@ -16,42 +18,44 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _GDM_CONFIG_H
#define _GDM_CONFIG_H
#include "gdm.h"
/* To access ve_string_empty(), ve_sure_string(), and
VE_IGNORE_EINTR macros ve-misc.h must be included */
G_BEGIN_DECLS
#include "ve-misc.h"
gchar* gdm_get_display_custom_config_file
(gchar *display);
(const gchar *display);
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);
gchar* gdm_get_value_string (const gchar *key);
gboolean gdm_get_value_bool (const gchar *key);
gint gdm_get_value_int (const gchar *key);
gchar* gdm_get_value_string_per_display (const gchar *display,
gchar *key);
gboolean gdm_get_value_bool_per_display (gchar *display,
gchar *key);
gint gdm_get_value_int_per_display (gchar *display,
gchar *key);
void gdm_set_value_string (gchar *key,
gchar *value);
void gdm_set_value_bool (gchar *key,
const gchar *key);
gboolean gdm_get_value_bool_per_display (const gchar *display,
const gchar *key);
gint gdm_get_value_int_per_display (const gchar *display,
const gchar *key);
void gdm_set_value_string (const gchar *key,
const gchar *value);
void gdm_set_value_bool (const gchar *key,
gboolean value);
void gdm_set_value_int (gchar *key,
void gdm_set_value_int (const gchar *key,
gint value);
void gdm_config_key_to_string_per_display
(const gchar *display,
gchar *key,
const gchar *key,
gchar **retval);
void gdm_config_key_to_string (gchar *file,
gchar *key,
void gdm_config_key_to_string (const gchar *file,
const gchar *key,
gchar **retval);
void gdm_config_to_string (gchar *key,
gchar *display,
void gdm_config_to_string (const gchar *key,
const gchar *display,
gchar **retval);
gboolean gdm_update_config (gchar *key);
gboolean gdm_update_config (const gchar *key);
void gdm_config_parse (void);
GdmXserver* gdm_find_xserver (const gchar *id);
gchar* gdm_get_xservers (void);
......@@ -61,7 +65,7 @@ uid_t gdm_get_gdmuid (void);
uid_t gdm_get_gdmgid (void);
gint gdm_get_high_display_num (void);
void gdm_set_high_display_num (gint val);
gboolean gdm_is_valid_key (gchar *key);
gboolean gdm_is_valid_key (const gchar *key);
gboolean gdm_signal_terminthup_was_notified (void);
gchar* gdm_get_facefile_from_home
......@@ -83,3 +87,7 @@ void gdm_set_user_session_lang (gboolean savesess,
char* gdm_get_session_exec (const char *session_name,
gboolean check_try_exec);
G_END_DECLS
#endif /* _GDM_CONFIG_H */
......@@ -34,6 +34,8 @@
#include "getvt.h"
#include "gdmconfig.h"
#include "gdm-common.h"
/* Virtual terminals only supported on Linux, FreeBSD, or DragonFly */
#if defined (__linux__) || defined (__FreeBSD__) || defined (__DragonFly__)
......
......@@ -57,6 +57,8 @@
#include "slave.h"
#include "gdmconfig.h"
#include "gdm-common.h"
extern char **environ;
extern pid_t extra_process;
......
/* GDM - The GNOME Display Manager
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* GDM - The GNOME Display Manager
* Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
*
* This program is free software; you can redistribute it and/or modify
......@@ -50,6 +52,8 @@
#include "getvt.h"
#include "gdmconfig.h"
#include "gdm-common.h"
/* Local prototypes */
static void gdm_server_spawn (GdmDisplay *d, const char *vtarg);
static void gdm_server_usr1_handler (gint);
......@@ -960,42 +964,90 @@ gdm_server_resolve (GdmDisplay *disp)
}
char **
static char **
vector_merge (char * const *v1,
int len1,
char * const *v2,
int len2)
{
int argc, i;
char **argv;
if (v1 == NULL && v2 == NULL)
return NULL;
argc = len1 + len2;
argv = g_new (char *, argc + 1);
for (i = 0; i < len1; i++)
argv[i] = g_strdup (v1[i]);
for (; i < argc; i++)
argv[i] = g_strdup (v2[i - len1]);
argv[i] = NULL;
return argv;
}
gboolean
gdm_server_resolve_command_line (GdmDisplay *disp,
gboolean resolve_flags,
const char *vtarg)
gboolean resolve_flags,
const char *vtarg,
int *argcp,
char ***argvp)
{
char *bin;
int argc;
char **argv;
int len;
int i;
gboolean gotvtarg = FALSE;
gboolean query_in_arglist = FALSE;
argv = NULL;
bin = ve_first_word (disp->command);
if (bin == NULL) {
const char *str;
gdm_error (_("Invalid server command '%s'"), disp->command);
argv = ve_split (gdm_get_value_string (GDM_KEY_STANDARD_XSERVER));
str = gdm_get_value_string (GDM_KEY_STANDARD_XSERVER);
g_shell_parse_argv (str, &argc, &argv, NULL);
} else if (bin[0] != '/') {
GdmXserver *svr = gdm_find_xserver (bin);
if (svr == NULL) {
const char *str;
gdm_error (_("Server name '%s' not found; "
"using standard server"), bin);
argv = ve_split (gdm_get_value_string (GDM_KEY_STANDARD_XSERVER));
str = gdm_get_value_string (GDM_KEY_STANDARD_XSERVER);
g_shell_parse_argv (str, &argc, &argv, NULL);
} else {
char **svr_command =
ve_split (ve_sure_string (svr->command));
argv = ve_split (disp->command);
char **svr_command;
const char *str;
int svr_argc;
str = ve_sure_string (svr->command);
svr_command = NULL;
g_shell_parse_argv (str, &svr_argc, &svr_command, NULL);
g_shell_parse_argv (disp->command, &argc, &argv, NULL);
if (argv[0] == NULL || argv[1] == NULL) {
g_strfreev (argv);
argv = svr_command;
argc = svr_argc;
} else {
char **old_argv = argv;
argv = ve_vector_merge (svr_command,
&old_argv[1]);
argv = vector_merge (svr_command,
svr_argc,
&old_argv[1],
argc);
g_strfreev (svr_command);
g_strfreev (old_argv);
}
argc += svr_argc;
}
if (resolve_flags) {
/* Setup the handled function */
......@@ -1009,7 +1061,7 @@ gdm_server_resolve_command_line (GdmDisplay *disp,
}
}
} else {
argv = ve_split (disp->command);
g_shell_parse_argv (disp->command, &argc, &argv, NULL);
}
for (len = 0; argv != NULL && argv[len] != NULL; len++) {
......@@ -1027,6 +1079,7 @@ gdm_server_resolve_command_line (GdmDisplay *disp,
}
argv = g_renew (char *, argv, len + 10);
/* shift args down one */
for (i = len - 1; i >= 1; i--) {
argv[i+1] = argv[i];
}
......@@ -1065,9 +1118,12 @@ gdm_server_resolve_command_line (GdmDisplay *disp,
argv[len++] = NULL;
*argvp = argv;
*argcp = len;
g_free (bin);
return argv;
return TRUE;
}
/**
......@@ -1080,11 +1136,12 @@ gdm_server_resolve_command_line (GdmDisplay *disp,
* since otherwise the server might not yet be looked up yet.
*/
static void
static void
gdm_server_spawn (GdmDisplay *d, const char *vtarg)
{
struct sigaction ign_signal;
sigset_t mask;
int argc;
gchar **argv = NULL;
char *logfile;
int logfd;
......@@ -1110,9 +1167,13 @@ gdm_server_spawn (GdmDisplay *d, const char *vtarg)
}
/* Figure out the server command */
argv = gdm_server_resolve_command_line (d,
TRUE /* resolve flags */,
vtarg);
argv = NULL;
argc = 0;
gdm_server_resolve_command_line (d,
TRUE /* resolve flags */,
vtarg,
&argc,
&argv);
command = g_strjoinv (" ", argv);
......@@ -1195,7 +1256,6 @@ gdm_server_spawn (GdmDisplay *d, const char *vtarg)
sigprocmask (SIG_SETMASK, &mask, NULL);
if (SERVER_IS_PROXY (d)) {
int argc = ve_vector_len (argv);
gboolean add_display = TRUE;
g_unsetenv ("DISPLAY");
......
......@@ -39,9 +39,11 @@ GdmDisplay * gdm_server_alloc (gint id,
void gdm_server_whack_clients (Display *dsp);
void gdm_server_checklog (GdmDisplay *disp);
char ** gdm_server_resolve_command_line (GdmDisplay *disp,
gboolean gdm_server_resolve_command_line (GdmDisplay *disp,
gboolean resolve_flags,
const char *vtarg);
const char *vtarg,
int *argc,
char ***argv);
GdmXserver * gdm_server_resolve (GdmDisplay *disp);
......
......@@ -91,6 +91,8 @@
#include "gdmconfig.h"
#include "display.h"
#include "gdm-common.h"
#ifdef WITH_CONSOLE_KIT
#include "gdmconsolekit.h"
#endif
......@@ -1769,6 +1771,8 @@ run_config (GdmDisplay *display, struct passwd *pwent)
if (pid == 0) {
char **argv;
const char *s;
/* child */
setsid ();
......@@ -1814,11 +1818,19 @@ run_config (GdmDisplay *display, struct passwd *pwent)
VE_IGNORE_EINTR (g_chdir ("/"));
/* exec the configurator */
argv = ve_split (gdm_get_value_string (GDM_KEY_CONFIGURATOR));
argv = NULL;
s = gdm_get_value_string (GDM_KEY_CONFIGURATOR);
if (s != NULL) {
g_shell_parse_argv (s, NULL, &argv, NULL);
}
if G_LIKELY (argv != NULL &&
argv[0] != NULL &&
g_access (argv[0], X_OK) == 0)
g_access (argv[0], X_OK) == 0) {
VE_IGNORE_EINTR (execv (argv[0], argv));
}
g_strfreev (argv);