Commit 9a27803b authored by Wanker who should set his $CHANGELOGNAME's avatar Wanker who should set his $CHANGELOGNAME Committed by George Lebl

Add possibility to request logout action to happen when the display dies


Wed Dec 10 13:08:13 2003  Wanker who should set his $CHANGELOGNAME <wanker@wankers.com>

	* daemon/gdm.[ch], daemon/display.c, daemon/gdm-net.[ch],
	  daemon/server.c, daemon/xdmcp.c:  Add possibility to request
	  logout action to happen when the display dies using the SUP socket
	  protocol.  Very loosely based on a patch from Jarno Gassenbauer,
	  but simplified and not having a DoS and/or authentication leak
	  as the original patches do.  The commands are named different to
	  avoid naming conflict.

	* daemon/gdm.h, config/gdm.conf.in, docs/C/gdm.xml,
	  config/Makefile.am, gdm.spec.in: move the built in sessions to
	  a more appropriate place (datadir)

	* gui/gdmcommon.[ch], gui/gdmlogin.c, gui/greeter/greeter.[ch],
	  gui/greeter/greeter*.c: move some common utility functions to
	  a common sublibrary (renamed the language lib to libgdmcommon),
	  should cut down a little on the code duplication.  Needs more.

	* gui/gdmcommon.[ch], gui/gdmlogin.c, gui/greeter/greeter.c,
	  docs/C/gdm.xml, daemon/gdm.h, config/gdm.conf.in: Apply a patch
	  from Anton Altaparmakov to add an optional info message to the
	  greeters

	* gui/gdmsetup.c: fix RH 97716 by putting up a dialog when user
	  tries to input root for the first time

	* docs/C/gdm.xml: minor updates.

	* daemon/gdm.c: GdmStandardXServer can now have arguments (we used
	  to parse them, but if there were arguments, sanity checks would
	  fail making it not work), so no real change in how it works, it
	  just accepts more inputs
parent b7469011
Wed Dec 10 13:08:13 2003 Wanker who should set his $CHANGELOGNAME <wanker@wankers.com>
* daemon/gdm.[ch], daemon/display.c, daemon/gdm-net.[ch],
daemon/server.c, daemon/xdmcp.c: Add possibility to request
logout action to happen when the display dies using the SUP socket
protocol. Very loosely based on a patch from Jarno Gassenbauer,
but simplified and not having a DoS and/or authentication leak
as the original patches do. The commands are named different to
avoid naming conflict.
* daemon/gdm.h, config/gdm.conf.in, docs/C/gdm.xml,
config/Makefile.am, gdm.spec.in: move the built in sessions to
a more appropriate place (datadir)
* gui/gdmcommon.[ch], gui/gdmlogin.c, gui/greeter/greeter.[ch],
gui/greeter/greeter*.c: move some common utility functions to
a common sublibrary (renamed the language lib to libgdmcommon),
should cut down a little on the code duplication. Needs more.
* gui/gdmcommon.[ch], gui/gdmlogin.c, gui/greeter/greeter.c,
docs/C/gdm.xml, daemon/gdm.h, config/gdm.conf.in: Apply a patch
from Anton Altaparmakov to add an optional info message to the
greeters
* gui/gdmsetup.c: fix RH 97716 by putting up a dialog when user
tries to input root for the first time
* docs/C/gdm.xml: minor updates.
* daemon/gdm.c: GdmStandardXServer can now have arguments (we used
to parse them, but if there were arguments, sanity checks would
fail making it not work), so no real change in how it works, it
just accepts more inputs
Wed Dec 10 2003 Archana Shah <archana.shah@wipro.com>
* docs/C/gdm.xml: Add documentation for Multicast and Multicast_Addr.
......
......@@ -2,7 +2,7 @@ pixmapdir = $(datadir)/pixmaps
confdir = $(sysconfdir)/gdm
crossconfdir = $(sysconfdir)/dm
localedir = $(sysconfdir)/gdm
bisessdir = $(sysconfdir)/dm/Sessions
bisessdir = $(datadir)/gdm/BuiltInSessions
instsessdir = $(datadir)/xsessions
initdir = $(sysconfdir)/gdm/Init
authdir = $(localstatedir)/gdm
......
......@@ -103,8 +103,9 @@ ServAuthDir=@EXPANDED_AUTHDIR@
BaseXsession=@EXPANDED_SYSCONFDIR@/gdm/Xsession
# This is a directory where .desktop files describing the sessions live
# It is really a PATH style variable since 2.4.4.2 to allow actual
# interoperability with KDM
#SessionDesktopDir=/etc/X11/sessions/:@EXPANDED_SYSCONFDIR@/dm/Sessions/:@EXPANDED_DATADIR@/xsessions/
# interoperability with KDM. Note that <sysconfdir>/dm/Sessions is there
# for backwards compatibility reasons with 2.4.4.x
#SessionDesktopDir=/etc/X11/sessions/:@EXPANDED_SYSCONFDIR@/dm/Sessions/:@EXPANDED_DATADIR@/gdm/BuiltInSessions/:@EXPANDED_DATADIR@/xsessions/
# This is the default .desktop session. One of the ones in SessionDesktopDir
#DefaultSession=gnome.desktop
# Better leave this blank and HOME will be used. You can use syntax ~/ below
......@@ -306,6 +307,12 @@ Browser=false
# shipped theme
#GraphicalTheme=circles
GraphicalThemeDir=@EXPANDED_DATADIR@/gdm/themes/
# If InfoMsgFile points to a file, the greeter will display the contents of the
# file in a modal dialog box before the user is allowed to log in.
#InfoMsgFile=
# If InfoMsgFile is present then InfoMsgFont can be used to specify the font
# to be used when displaying the contents of the file.
#InfoMsgFont=Sans 24
# The chooser is what's displayed when a user wants an indirect XDMCP
# session, or selects Run XDMCP chooser from the system menu
......
......@@ -8,7 +8,7 @@ dnl
AC_PROG_INTLTOOL([0.21])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gdm,2.4.4.5)
AM_INIT_AUTOMAKE(gdm,2.4.90.0)
AM_MAINTAINER_MODE
GTK_REQUIRED=1.3.1
......
......@@ -362,6 +362,10 @@ gdm_display_unmanage (GdmDisplay *d)
gdm_debug ("gdm_display_unmanage: Stopping %s (slave pid: %d)",
d->name, (int)d->slavepid);
/* whack connections about this display */
if (unixconn != NULL)
gdm_kill_subconnections_with_display (unixconn, d);
/* Kill slave, this may in fact hang for a bit at least until the
* slave dies, which should be ASAP though */
whack_old_slave (d);
......
......@@ -71,6 +71,8 @@ struct _GdmConnection {
GList *subconnections;
int n_subconnections;
GdmDisplay *disp;
};
static gboolean
......@@ -216,6 +218,7 @@ gdm_socket_handler (GIOChannel *source,
gdm_debug ("gdm_socket_handler: Accepting new connection fd %d", fd);
newconn = g_new0 (GdmConnection, 1);
newconn->disp = NULL;
newconn->message_count = 0;
newconn->nonblock = conn->nonblock;
newconn->close_level = 0;
......@@ -309,6 +312,7 @@ try_again:
IGNORE_EINTR (chmod (sockname, mode));
conn = g_new0 (GdmConnection, 1);
conn->disp = NULL;
conn->message_count = 0;
conn->nonblock = FALSE;
conn->close_level = 0;
......@@ -345,6 +349,7 @@ gdm_connection_open_fd (int fd)
g_return_val_if_fail (fd >= 0, NULL);
conn = g_new0 (GdmConnection, 1);
conn->disp = NULL;
conn->message_count = 0;
conn->nonblock = FALSE;
conn->close_level = 0;
......@@ -396,6 +401,7 @@ gdm_connection_open_fifo (const char *fifo, mode_t mode)
IGNORE_EINTR (chmod (fifo, mode));
conn = g_new0 (GdmConnection, 1);
conn->disp = NULL;
conn->message_count = 0;
conn->nonblock = FALSE;
conn->close_level = 0;
......@@ -568,4 +574,43 @@ gdm_connection_set_nonblock (GdmConnection *conn,
conn->nonblock = nonblock;
}
GdmDisplay *
gdm_connection_get_display (GdmConnection *conn)
{
g_return_val_if_fail (conn != NULL, NULL);
return conn->disp;
}
void
gdm_connection_set_display (GdmConnection *conn,
GdmDisplay *disp)
{
g_return_if_fail (conn != NULL);
conn->disp = disp;
}
void
gdm_kill_subconnections_with_display (GdmConnection *conn,
GdmDisplay *disp)
{
GList *subs;
g_return_if_fail (conn != NULL);
g_return_if_fail (disp != NULL);
subs = conn->subconnections;
while (subs != NULL) {
GdmConnection *subcon = subs->data;
if (subcon->disp == disp) {
subcon->disp = NULL;
conn->subconnections =
g_list_remove (conn->subconnections, subcon);
gdm_connection_close (subcon);
subs = conn->subconnections;
} else {
subs = subs->next;
}
}
}
/* EOF */
......@@ -26,6 +26,11 @@
typedef struct _GdmConnection GdmConnection;
#endif /* TYPEDEF_GDM_CONNECTION */
#ifndef TYPEDEF_GDM_DISPLAY
#define TYPEDEF_GDM_DISPLAY
typedef struct _GdmDisplay GdmDisplay;
#endif /* TYPEDEF_GDM_DISPLAY */
/* Something that will get stuff line by line */
typedef void (* GdmConnectionHandler) (GdmConnection *conn,
const char *str,
......@@ -71,6 +76,12 @@ void gdm_connection_set_user_flags (GdmConnection *conn,
gdm_connection_set_user_flags (conn, _flags); \
}
GdmDisplay * gdm_connection_get_display (GdmConnection *conn);
void gdm_connection_set_display (GdmConnection *conn,
GdmDisplay *disp);
void gdm_kill_subconnections_with_display (GdmConnection *conn,
GdmDisplay *disp);
int gdm_connection_get_message_count (GdmConnection *conn);
......
......@@ -380,8 +380,9 @@ gdm_config_parse (void)
GdmWilling = ve_config_get_string (cfg, GDM_KEY_WILLING);
GdmStandardXServer = ve_config_get_string (cfg, GDM_KEY_STANDARD_XSERVER);
if (ve_string_empty (GdmStandardXServer) ||
access (GdmStandardXServer, X_OK) != 0) {
bin = ve_first_word (GdmStandardXServer);
if G_UNLIKELY (ve_string_empty (bin) ||
access (bin, X_OK) != 0) {
gdm_info (_("%s: Standard X server not found, trying alternatives"),
"gdm_config_parse");
if (access ("/usr/X11R6/bin/X", X_OK) == 0) {
......@@ -395,6 +396,7 @@ gdm_config_parse (void)
GdmStandardXServer = g_strdup ("/usr/bin/X11/X");
}
}
g_free (bin);
GdmFlexibleXServers = ve_config_get_int (cfg, GDM_KEY_FLEXIBLE_XSERVERS);
GdmXnest = ve_config_get_string (cfg, GDM_KEY_XNEST);
if (ve_string_empty (GdmXnest))
......@@ -560,7 +562,8 @@ gdm_config_parse (void)
gdm_fail (_("%s: XDMCP disabled and no local servers defined. Aborting!"), "gdm_config_parse");
}
if (access (GdmStandardXServer, X_OK) == 0) {
bin = ve_first_word (GdmStandardXServer);
if G_LIKELY (access (bin, X_OK) == 0) {
server = GdmStandardXServer;
} else if (access ("/usr/bin/X11/X", X_OK) == 0) {
server = "/usr/bin/X11/X";
......@@ -569,6 +572,7 @@ gdm_config_parse (void)
} else if (access ("/opt/X11R6/bin/X", X_OK) == 0) {
server = "/opt/X11R6/bin/X";
}
g_free (bin);
/* yay, we can add a backup emergency server */
if (server != NULL) {
int num = gdm_get_free_display (0 /* start */,
......@@ -1261,6 +1265,10 @@ gdm_cleanup_children (void)
if (d == NULL)
return TRUE;
/* whack connections about this display */
if (unixconn != NULL)
gdm_kill_subconnections_with_display (unixconn, d);
if G_UNLIKELY (crashed) {
gdm_error ("gdm_cleanup_children: Slave crashed, killing its "
"children");
......@@ -1295,6 +1303,20 @@ gdm_cleanup_children (void)
d->slavepid = 0;
d->dispstat = DISPLAY_DEAD;
/* change status according to the logout_action */
if (status == DISPLAY_REMANAGE &&
d->logout_action == GDM_LOGOUT_ACTION_HALT)
status = DISPLAY_HALT;
else if (status == DISPLAY_REMANAGE &&
d->logout_action == GDM_LOGOUT_ACTION_REBOOT)
status = DISPLAY_REBOOT;
else if (status == DISPLAY_REMANAGE &&
d->logout_action == GDM_LOGOUT_ACTION_SUSPEND)
status = DISPLAY_SUSPEND;
/* reset the display logout action */
d->logout_action = GDM_LOGOUT_ACTION_NONE;
if ( ! GdmSystemMenu &&
(status == DISPLAY_REBOOT ||
status == DISPLAY_SUSPEND ||
......@@ -2306,6 +2328,12 @@ gdm_handle_message (GdmConnection *conn, const char *msg, gpointer data)
gdm_debug ("Got logged in == %s",
d->logged_in ? "TRUE" : "FALSE");
/* whack connections about this display if a user
* just logged out since we don't want such
* connections persisting to be authenticated */
if ( ! logged_in && unixconn != NULL)
gdm_kill_subconnections_with_display (unixconn, d);
/* if the user just logged out,
* let's see if it's safe to restart */
if (gdm_restart_mode &&
......@@ -3235,6 +3263,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
g_free (cookie);
GDM_CONNECTION_SET_USER_FLAG
(conn, GDM_SUP_FLAG_AUTHENTICATED);
gdm_connection_set_display (conn, disp);
gdm_connection_write (conn, "OK\n");
return;
}
......@@ -3243,6 +3272,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
/* Hmmm, perhaps this is better defined behaviour */
GDM_CONNECTION_UNSET_USER_FLAG
(conn, GDM_SUP_FLAG_AUTHENTICATED);
gdm_connection_set_display (conn, NULL);
gdm_connection_write (conn, "ERROR 100 Not authenticated\n");
g_free (cookie);
} else if (strcmp (msg, GDM_SUP_FLEXI_XSERVER) == 0) {
......@@ -3401,6 +3431,110 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
} else {
gdm_connection_write (conn, "OK\n");
}
} else if (strcmp (msg, GDM_SUP_QUERY_LOGOUT_ACTION) == 0) {
const char *sep = " ";
GdmDisplay *disp;
disp = gdm_connection_get_display (conn);
/* Only allow locally authenticated connections */
if ( ! (gdm_connection_get_user_flags (conn) &
GDM_SUP_FLAG_AUTHENTICATED) ||
disp == NULL) {
gdm_info (_("Query logout action request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
return;
}
gdm_connection_write (conn, "OK");
if (GdmSystemMenu &&
disp->console &&
! ve_string_empty (GdmHaltReal)) {
gdm_connection_printf (conn, "%s%s",
sep,
GDM_SUP_LOGOUT_ACTION_HALT);
sep = ";";
}
if (GdmSystemMenu &&
disp->console &&
! ve_string_empty (GdmRebootReal)) {
gdm_connection_write (conn, GDM_SUP_LOGOUT_ACTION_REBOOT);
gdm_connection_printf (conn, "%s%s",
sep,
GDM_SUP_LOGOUT_ACTION_REBOOT);
sep = ";";
}
if (GdmSystemMenu &&
disp->console &&
! ve_string_empty (GdmSuspendReal)) {
gdm_connection_printf (conn, "%s%s",
sep,
GDM_SUP_LOGOUT_ACTION_SUSPEND);
sep = ";";
}
gdm_connection_write (conn, "\n");
} else if (strncmp (msg, GDM_SUP_SET_LOGOUT_ACTION " ",
strlen (GDM_SUP_SET_LOGOUT_ACTION " ")) == 0) {
const char *action =
&msg[strlen (GDM_SUP_SET_LOGOUT_ACTION " ")];
GdmDisplay *disp;
gboolean was_ok = FALSE;
disp = gdm_connection_get_display (conn);
/* Only allow locally authenticated connections */
if ( ! (gdm_connection_get_user_flags (conn) &
GDM_SUP_FLAG_AUTHENTICATED) ||
disp == NULL ||
! disp->logged_in) {
gdm_info (_("Set logout action request denied: "
"Not authenticated"));
gdm_connection_write (conn,
"ERROR 100 Not authenticated\n");
return;
}
if (strcmp (action, GDM_SUP_LOGOUT_ACTION_NONE) == 0) {
disp->logout_action = GDM_LOGOUT_ACTION_NONE;
was_ok = TRUE;
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_HALT) == 0) {
if (GdmSystemMenu &&
disp->console &&
! ve_string_empty (GdmHaltReal)) {
disp->logout_action =
GDM_LOGOUT_ACTION_HALT;
was_ok = TRUE;
}
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_REBOOT) == 0) {
if (GdmSystemMenu &&
disp->console &&
! ve_string_empty (GdmRebootReal)) {
disp->logout_action =
GDM_LOGOUT_ACTION_REBOOT;
was_ok = TRUE;
}
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_SUSPEND) == 0) {
if (GdmSystemMenu &&
disp->console &&
! ve_string_empty (GdmSuspendReal)) {
disp->logout_action =
GDM_LOGOUT_ACTION_SUSPEND;
was_ok = TRUE;
}
}
if (was_ok) {
/* Notify the slave to whack its server once it's
done */
if (disp->logout_action != GDM_LOGOUT_ACTION_NONE)
send_slave_command (disp,
GDM_NOTIFY_DIRTY_SERVERS);
gdm_connection_write (conn, "OK\n");
} else {
gdm_connection_write (conn, "ERROR 7 Unknown logout action, or not available\n");
}
} else if (strcmp (msg, GDM_SUP_VERSION) == 0) {
gdm_connection_write (conn, "GDM " VERSION "\n");
} else if (strcmp (msg, GDM_SUP_CLOSE) == 0) {
......
......@@ -145,7 +145,7 @@ enum {
#define GDM_KEY_REBOOT "daemon/RebootCommand=/usr/bin/reboot;/sbin/reboot;/sbin/shutdown -r now;/usr/sbin/shutdown -r now"
#define GDM_KEY_ROOTPATH "daemon/RootPath=/sbin:/usr/sbin:/bin:/usr/bin:" X_CONF_PATH ":" EXPANDED_BINDIR
#define GDM_KEY_SERVAUTH "daemon/ServAuthDir=" EXPANDED_AUTHDIR
#define GDM_KEY_SESSDIR "daemon/SessionDesktopDir=/etc/X11/sessions/:" EXPANDED_SYSCONFDIR "/dm/Sessions/:" EXPANDED_DATADIR "/xsessions/"
#define GDM_KEY_SESSDIR "daemon/SessionDesktopDir=/etc/X11/sessions/:" EXPANDED_SYSCONFDIR "/dm/Sessions/:" EXPANDED_DATADIR "/gdm/BuiltInSessions/:" EXPANDED_DATADIR "/xsessions/"
#define GDM_KEY_BASEXSESSION "daemon/BaseXsession=" EXPANDED_SYSCONFDIR "/gdm/Xsession"
#define GDM_KEY_DEFAULTSESSION "daemon/DefaultSession=gnome.desktop"
#define GDM_KEY_SUSPEND "daemon/SuspendCommand="
......@@ -242,6 +242,9 @@ enum {
#define GDM_KEY_GRAPHICAL_THEME "greeter/GraphicalTheme=circles"
#define GDM_KEY_GRAPHICAL_THEME_DIR "greeter/GraphicalThemeDir=" EXPANDED_DATADIR "/gdm/themes/"
#define GDM_KEY_INFO_MSG_FILE "greeter/InfoMsgFile="
#define GDM_KEY_INFO_MSG_FONT "greeter/InfoMsgFont="
#define GDM_KEY_SCAN "chooser/ScanTime=4"
#define GDM_KEY_HOST "chooser/DefaultHostImg=" EXPANDED_PIXMAPDIR "/nohost.png"
#define GDM_KEY_HOSTDIR "chooser/HostImageDir=" EXPANDED_DATADIR "/hosts/"
......@@ -276,7 +279,18 @@ enum {
typedef struct _GdmConnection GdmConnection;
#endif /* TYPEDEF_GDM_CONNECTION */
typedef enum {
GDM_LOGOUT_ACTION_NONE = 0,
GDM_LOGOUT_ACTION_HALT,
GDM_LOGOUT_ACTION_REBOOT,
GDM_LOGOUT_ACTION_SUSPEND,
GDM_LOGOUT_ACTION_LAST
} GdmLogoutAction;
#ifndef TYPEDEF_GDM_DISPLAY
#define TYPEDEF_GDM_DISPLAY
typedef struct _GdmDisplay GdmDisplay;
#endif /* TYPEDEF_GDM_DISPLAY */
/* Use this to get the right authfile name */
#define GDM_AUTHFILE(display) \
......@@ -386,6 +400,9 @@ struct _GdmDisplay {
the ~/.xsession-errors file */
char *xsession_errors_filename; /* if NULL then there is no .xsession-errors
file */
/* Only set in the main daemon as that's the only place that cares */
GdmLogoutAction logout_action;
};
typedef struct _GdmXServer GdmXServer;
......@@ -493,16 +510,20 @@ void gdm_final_cleanup (void);
#define GDM_SOP_SOFT_RESTART "SOFT_RESTART" /* no arguments */
#define GDM_SOP_START_NEXT_LOCAL "START_NEXT_LOCAL" /* no arguments */
#define GDM_SOP_HUP_ALL_GREETERS "HUP_ALL_GREETERS" /* no arguments */
/* sometimes we can't do a syslog so we tell the main daemon */
#define GDM_SOP_SYSLOG "SYSLOG" /* <pid> <type> <message> */
/* write out a sessreg (xdm) compatible Xservers file
* in the ServAuthDir as <name>.Xservers */
#define GDM_SOP_WRITE_X_SERVERS "WRITE_X_SERVERS" /* <slave pid> */
/* All X servers should be restarted rather then regenerated. Useful
* if you have updated the X configuration. Note that this happens
* only when the user logs out or when we otherwise would have restarted
* a server, nothing is done by this command. */
#define GDM_SOP_DIRTY_SERVERS "DIRTY_SERVERS" /* no arguments */
/* restart all servers that people aren't logged in on. Maybe you may not
* want to do this on every change of X server config since this may cause
* flicker on screen and jumping around on the vt. Perhaps useful to do
......@@ -724,6 +745,46 @@ void gdm_final_cleanup (void);
* 200 = Too many messages
* 999 = Unknown error
*/
#define GDM_SUP_QUERY_LOGOUT_ACTION "QUERY_LOGOUT_ACTION" /* no arguments */
/* QUERY_LOGOUT_ACTION: Query which logout actions are possible
* Only supported on connections that passed AUTH_LOCAL.
* Supported since: 2.4.90.0
* Answers:
* OK <action>;<action>;...
* Where action is one of HALT, REBOOT or SUSPEND. An empty list
* can also be returned if no action is possible
* ERROR <err number> <english error description>
* 0 = Not implemented
* 100 = Not authenticanted
* 200 = Too many messages
* 999 = Unknown error
*/
#define GDM_SUP_SET_LOGOUT_ACTION "SET_LOGOUT_ACTION" /* <action> */
/* SET_LOGOUT_ACTION: Tell the daemon to halt/reboot/suspend after slave
* process exits.
* Only supported on connections that passed AUTH_LOCAL.
* Supported since: 2.4.90.0
* Arguments: <action>
* NONE Set exit action to 'none'
* HALT Set exit action to 'halt'
* REBOOT Set exit action to 'reboot'
* SUSPEND Set exit action to 'suspend'
*
* Answers:
* OK
* ERROR <err number> <english error description>
* 0 = Not implemented
* 7 = Unknown logout action, or not available
* 100 = Not authenticanted
* 200 = Too many messages
* 999 = Unknown error
*/
#define GDM_SUP_LOGOUT_ACTION_NONE "NONE"
#define GDM_SUP_LOGOUT_ACTION_HALT "HALT"
#define GDM_SUP_LOGOUT_ACTION_REBOOT "REBOOT"
#define GDM_SUP_LOGOUT_ACTION_SUSPEND "SUSPEND"
/*
*/
#define GDM_SUP_CLOSE "CLOSE" /* no arguments */
/* CLOSE Answers: None
* Supported since: 2.2.4.0
......
......@@ -1269,6 +1269,8 @@ gdm_server_alloc (gint id, const gchar *command)
d = g_new0 (GdmDisplay, 1);
d->logout_action = GDM_LOGOUT_ACTION_NONE;
d->authfile = NULL;
d->authfile_gdm = NULL;
d->auths = NULL;
......
......@@ -2507,6 +2507,7 @@ gdm_xdmcp_display_alloc (struct sockaddr_in *addr,
GdmDisplay *d = NULL;
d = g_new0 (GdmDisplay, 1);
d->logout_action = GDM_LOGOUT_ACTION_NONE;
d->authfile = NULL;
d->auths = NULL;
d->userauth = NULL;
......
......@@ -2,8 +2,8 @@
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY legal SYSTEM "legal.xml">
<!ENTITY version "2.4.4.4">
<!ENTITY date "10/6/2003">
<!ENTITY version "2.4.90.0">
<!ENTITY date "12/10/2003">
]>
<article id="index" lang="en">
......@@ -575,6 +575,16 @@
the last session and correct the problem this way.
</para>
<para>
You can suppress the 10 second warning by returning code 66
from the <filename>Xsession</filename>script or from your session
binary (the default <filename>Xsession</filename> script
propagates those codes back). This is useful if you have some sort of
special logins for which it is not an error to return less then 10
seconds later, or if you setup the session to already display some
error message and the gdm message would be confusing and redundant.
</para>
<para>
The session output is piped through the GDM daemon and so the
<filename>~/.xsession-errors</filename> file is capped at about
......@@ -787,11 +797,12 @@
The remaining configuration is done by dropping scripts in the
subdirectories of the <filename>&lt;etc&gt;/gdm/</filename> folder or
dropping <filename>.desktop</filename>-style files in
<filename>&lt;etc&gt;/dm/Sessions/</filename> or
<filename>/etc/X11/sessions/</filename>. The latter is also
read by KDM for common configuration. The <filename>&lt;etc&gt;/dm/Sessions/</filename>
directory will likely move in the future to reflect that it is
GDM specific and used only for the default configuration.
read by KDM for common configuration.
Next the directory
<filename>&lt;share&gt;/gdm/BuiltInSessions/</filename> is read for
GDM specific built in sessions (KDM hardcodes these at time of this
writing).
Also the default setup will also read <filename>&lt;share&gt;/xsessions/</filename>
(which should be <filename>/usr/share/xsessions/</filename> if you really
wish to cooperate with KDM)
......@@ -800,7 +811,11 @@
This approach makes it easy for package management systems to install
window managers and different session types without requiring
the sysadmin to edit files. See the <filename>SessionDesktopDir</filename>
configuration key for changing the paths. Note that prior to version
configuration key for changing the paths.
It used to be that GDM stored
its built in sessions in <filename>&lt;etc&gt;/dm/Sessions/</filename>
but this is now deprecated as of 2.4.90.0.
Note that prior to version
2.4.4.2 only the <filename>&lt;etc&gt;/dm/Sessions/</filename> was being read.
</para>
......@@ -2238,6 +2253,35 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>InfoMsgFile</term>
<listitem>
<synopsis>InfoMsgFile=/path/to/infofile</synopsis>
<para>
If present and /path/to/infofile specifies an existing and
readable text file (e.g. /etc/infomsg.txt) the contents of the
file will be displayed in a modal dialog box before the user
is allowed to login.
This works both with the standard and the themable greeters.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>InfoMsgFont</term>
<listitem>
<synopsis>InfoMsgFont=fontspec</synopsis>
<para>
If present and InfoMsgFile (see above) is used, this specifies
the font to use when displaying the contents of the InfoMsgFile
text file. For example fontspec could be Sans 24 to get a
sans serif font of size 24 points.
This works both with the standard and the themable greeters.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>LocaleFile</term>
......@@ -2576,9 +2620,9 @@
</varlistentry>
<varlistentry>
<term>Multicast_Addr</term>
<term>MulticastAddr</term>
<listitem>
<synopsis>Multicast_Addr=ff02::1</synopsis>
<synopsis>MulticastAddr=ff02::1</synopsis>
<para>
This is the Link-local Multicast address and is hardcoded here.
</para>
......
......@@ -108,7 +108,6 @@ exit 0
%{_libexecdir}/*
%{_libdir}/gtk-2.0/modules/*
%config %{sysconfdir}/pam.d/*
%config %{sysconfdir}/X11/dm/Sessions/*
%config %{sysconfdir}/X11/gdm
%config %{sysconfdir}/security/console.apps/*
%{_datadir}/pixmaps/*
......
......@@ -26,7 +26,7 @@ INCLUDES = \
# -DGNOME_DISABLE_DEPRECATED \
#
noinst_LIBRARIES = libgdmwm.a libgdmlang.a
noinst_LIBRARIES = libgdmwm.a libgdmcommon.a
bin_PROGRAMS = \
@GDMCHOOSER@ \
......@@ -54,9 +54,11 @@ libgdmwm_a_SOURCES = \
gdmwm.c \
gdmwm.h
libgdmlang_a_SOURCES = \
libgdmcommon_a_SOURCES = \
gdmlanguages.c \
gdmlanguages.h
gdmlanguages.h \
gdmcommon.c \
gdmcommon.h
gdmchooser_SOURCES = \
gdmchooser.c \
......@@ -92,7 +94,7 @@ gdmchooser_LDADD = \
gdmlogin_LDADD = \
libgdmwm.a \
libgdmlang.a \
libgdmcommon.a \
$(GUING_LIBS) \
$(X_LIBS) \
-lX11 \
......
......@@ -46,6 +46,7 @@
#include "gdm.h"
#include "gdmwm.h"
#include "gdmlanguages.h"
#include "gdmcommon.h"
#include "misc.h"
/* set the DOING_GDM_DEVELOPMENT env variable if you aren't running
......@@ -129,6 +130,10 @@ static gboolean GdmShowLastSession;
static gboolean GdmUseCirclesInEntry;
/* FIXME: Should move everything to externs and move reading to gdmcommon.c */
gchar *GdmInfoMsgFile;
gchar *GdmInfoMsgFont;
static GtkWidget *login;
static GtkWidget *logo_frame = NULL;
static GtkWidget *logo_image = NULL;
......@@ -188,8 +193,6 @@ static gboolean selecting_user = TRUE;
* in some way or another */
static gboolean session_dir_whacked_out = FALSE;
static void gdm_login_abort (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
static void gdm_login_message (const gchar *msg);
static void login_window_resize (gboolean force);
/*
......@@ -262,16 +265,8 @@ gdm_event (GSignalInvocationHint *ihint,
return TRUE;
}
static void
setup_cursor (GdkCursorType type)
{
GdkCursor *cursor = gdk_cursor_new (type);
gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
gdk_cursor_unref (cursor);
}
static void
kill_thingies (void)
void
gdm_kill_thingies (void)
{
pid_t pid = backgroundpid;
......@@ -286,7 +281,7 @@ kill_thingies (void)
static void
gdm_login_done (int sig)
{
kill_thingies ();
gdm_kill_thingies ();
_exit (EXIT_SUCCESS);
}
......@@ -389,30 +384,6 @@ set_screen_to_pos (int x, int y)
}
}
static void
gdm_login_abort (const gchar *format, ...)
{
va_list args;
gchar *s;
if (!format) {
kill_thingies ();
_exit (DISPLAY_GREETERFAILED);
}
va_start (args, format);
s = g_strdup_vprintf (format, args);
va_end (args);
syslog (LOG_ERR, "%s", s);
closelog();
g_free (s);