Commit 4c8b5cb8 authored by Brian Cameron's avatar Brian Cameron Committed by Brian Cameron

Rename console and TYPE_LOCAL in preparation for adding the dynamic

2005-05-06  Brian Cameron  <brian.cameron@sun.com>

        * daemon/auth.c, daemon/display.c, daemon/gdm.[ch],
          daemon/server.c, daemon/slave.c, daemon/verify-pam.c,
          daemon/xdmcp.c, AUTHORS:  Rename console and
          TYPE_LOCAL in preparation for adding the dynamic
          Xserver patch.  This is part of the fix for bug
          #168219.  Patch provided by Bob Terek.
parent 4088a137
......@@ -20,6 +20,7 @@ Contributions from:
Arvind Samptur <arvind.samptur@wipro.com>
Benedikt Roth <Benedikt.Roth@gmx.net>
Bill Haneman <Bill.Haneman@Sun.COM>
Bob Terek <Robert.Terek@Sun.COM>
Brian Cameron <Brian.Cameron@Sun.COM>
Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
ChiDeok Hwang <hwang@mizi.co.kr>
......
2005-05-06 Brian Cameron <brian.cameron@sun.com>
* daemon/auth.c, daemon/display.c, daemon/gdm.[ch],
daemon/server.c, daemon/slave.c, daemon/verify-pam.c,
daemon/xdmcp.c, AUTHORS: Rename console and
TYPE_LOCAL in preparation for adding the dynamic
Xserver patch. This is part of the fix for bug
#168219. Patch provided by Bob Terek.
2005-05-04 Brian Cameron <brian.cameron@sun.com>
* gui/gdmcommon.[ch], gui/gdmlogin.c,
......
......@@ -69,7 +69,7 @@ display_add_error (GdmDisplay *d)
gdm_error (_("%s: Could not write new authorization entry. "
"Possibly out of diskspace"),
"add_auth_entry");
if (d->console) {
if (d->attached) {
char *s = g_strdup_printf
(C_(N_("GDM could not write a new authorization "
"entry to disk. Possibly out of diskspace.%s%s")),
......
......@@ -115,7 +115,7 @@ gdm_display_check_loop (GdmDisplay *disp)
"before trying again on display %s.")),
disp->name);
/* only display a dialog box if this is a local display */
if (disp->type == TYPE_LOCAL ||
if (disp->type == TYPE_STATIC ||
disp->type == TYPE_FLEXI) {
gdm_text_message_dialog (s);
}
......@@ -389,7 +389,7 @@ gdm_display_unmanage (GdmDisplay *d)
whack_old_slave (d, TRUE /* kill_connection */);
d->dispstat = DISPLAY_DEAD;
if (d->type != TYPE_LOCAL)
if (d->type != TYPE_STATIC)
gdm_display_dispose (d);
gdm_debug ("gdm_display_unmanage: Display stopped");
......
......@@ -104,8 +104,8 @@ gboolean gdm_wait_for_go = FALSE; /* wait for a GO in the fifo */
gboolean print_version = FALSE; /* print version number and quit */
gboolean preserve_ld_vars = FALSE; /* Preserve the ld environment variables */
gboolean no_daemon = FALSE; /* Do not daemonize */
gboolean no_console = FALSE; /* There are no local servers, this means,
don't run local servers and second,
gboolean no_console = FALSE; /* There are no static servers, this means,
don't run static servers and second,
don't display info on the console */
GdmConnection *fifoconn = NULL; /* Fifo connection */
......@@ -121,8 +121,8 @@ char *gdm_charset = NULL;
int gdm_normal_runlevel = -1; /* runlevel on linux that gdm was started in */
/* True if the server that was run was in actuallity not specified in the
* config file. That is if xdmcp was disabled and no local servers were
* defined. If the user kills all his local servers by mistake and keeps
* config file. That is if xdmcp was disabled and no static servers were
* defined. If the user kills all his static servers by mistake and keeps
* xdmcp on. Well then he's screwed. The configurator should be smarter
* about that. But by default xdmcp is disabled so we're likely to catch
* some errors like this. */
......@@ -577,7 +577,7 @@ gdm_config_parse (void)
xservers = g_slist_append (xservers, svr);
}
/* Find local X server definitions */
/* Find static X server definitions */
list = ve_config_get_keys (cfg, GDM_KEY_SERVERS);
/* only read the list if no_console is FALSE
at this stage */
......@@ -621,10 +621,10 @@ gdm_config_parse (void)
if G_UNLIKELY (displays == NULL && ! GdmXdmcp) {
char *server = NULL;
/* if we requested no local servers (there is no console),
/* if we requested no static servers (there is no console),
then don't display errors in console messages */
if (no_console) {
gdm_fail (_("%s: XDMCP disabled and no local servers defined. Aborting!"), "gdm_config_parse");
gdm_fail (_("%s: XDMCP disabled and no static servers defined. Aborting!"), "gdm_config_parse");
}
bin = ve_first_word (GdmStandardXServer);
......@@ -642,7 +642,7 @@ gdm_config_parse (void)
if (server != NULL) {
int num = gdm_get_free_display (0 /* start */,
0 /* server uid */);
gdm_error (_("%s: XDMCP disabled and no local servers defined. Adding %s on :%d to allow configuration!"),
gdm_error (_("%s: XDMCP disabled and no static servers defined. Adding %s on :%d to allow configuration!"),
"gdm_config_parse",
server, num);
......@@ -658,14 +658,14 @@ gdm_config_parse (void)
} else {
char *s = g_strdup_printf
(C_(N_("XDMCP is disabled and gdm "
"cannot find any local server "
"cannot find any static server "
"to start. Aborting! Please "
"correct the configuration %s "
"and restart gdm.")),
GDM_CONFIG_FILE);
gdm_text_message_dialog (s);
GdmPidFile = NULL;
gdm_fail (_("%s: XDMCP disabled and no local servers defined. Aborting!"), "gdm_config_parse");
gdm_fail (_("%s: XDMCP disabled and no static servers defined. Aborting!"), "gdm_config_parse");
}
}
......@@ -932,7 +932,7 @@ gdm_start_first_unborn_local (int delay)
GdmDisplay *d = li->data;
if (d != NULL &&
d->type == TYPE_LOCAL &&
d->type == TYPE_STATIC &&
d->dispstat == DISPLAY_UNBORN) {
GdmXServer *svr;
gdm_debug ("gdm_start_first_unborn_local: "
......@@ -942,7 +942,7 @@ gdm_start_first_unborn_local (int delay)
* before starting */
d->sleep_before_run = delay;
/* only the first local display has
/* only the first static display has
* timed login going on */
if (gdm_first_login)
d->timed_login_ok = TRUE;
......@@ -951,7 +951,7 @@ gdm_start_first_unborn_local (int delay)
if ( ! gdm_display_manage (d)) {
gdm_display_unmanage (d);
/* only the first local display where
/* only the first static display where
we actually log in gets
autologged in */
if (svr != NULL &&
......@@ -959,7 +959,7 @@ gdm_start_first_unborn_local (int delay)
! svr->chooser)
gdm_first_login = FALSE;
} else {
/* only the first local display where
/* only the first static display where
we actually log in gets
autologged in */
if (svr != NULL &&
......@@ -1002,7 +1002,7 @@ gdm_final_cleanup (void)
}
}
/* Now completely unmanage the local servers */
/* Now completely unmanage the static servers */
first = TRUE;
list = g_slist_copy (displays);
/* somewhat of a hack to kill last server
......@@ -1014,7 +1014,7 @@ gdm_final_cleanup (void)
if (SERVER_IS_XDMCP (d) ||
SERVER_IS_PROXY (d))
continue;
/* HACK! Wait 2 seconds between killing of local servers
/* HACK! Wait 2 seconds between killing of static servers
* because X is stupid and full of races and will otherwise
* hang my keyboard */
if ( ! first) {
......@@ -1454,12 +1454,12 @@ gdm_cleanup_children (void)
status = DISPLAY_REMANAGE;
}
if ( ! d->console &&
if ( ! d->attached &&
(status == DISPLAY_RESTARTGDM ||
status == DISPLAY_REBOOT ||
status == DISPLAY_SUSPEND ||
status == DISPLAY_HALT)) {
gdm_info (_("Restart, Reboot or Halt request from a non-local display %s"), d->name);
gdm_info (_("Restart, Reboot or Halt request from a non-static display %s"), d->name);
status = DISPLAY_REMANAGE;
}
......@@ -1533,7 +1533,7 @@ start_autopsy:
gdm_display_unmanage (d);
/* If there are some pending locals, start them now */
/* If there are some pending statics, start them now */
gdm_start_first_unborn_local (3 /* delay */);
break;
......@@ -1578,7 +1578,7 @@ start_autopsy:
gdm_safe_restart ();
/* in remote/flexi case just drop to _REMANAGE */
if (d->type == TYPE_LOCAL) {
if (d->type == TYPE_STATIC) {
time_t now = time (NULL);
d->x_faileds ++;
/* This really is likely the first time if it's been,
......@@ -1597,7 +1597,7 @@ start_autopsy:
* "Screw you guys, I'm going home!" */
gdm_display_unmanage (d);
/* If there are some pending locals,
/* If there are some pending statics,
* start them now */
gdm_start_first_unborn_local (3 /* delay */);
break;
......@@ -1639,11 +1639,11 @@ start_autopsy:
gdm_try_logout_action (d);
gdm_safe_restart ();
/* This is a local server so we start a new slave */
if (d->type == TYPE_LOCAL) {
/* This is a static server so we start a new slave */
if (d->type == TYPE_STATIC) {
if ( ! gdm_display_manage (d)) {
gdm_display_unmanage (d);
/* If there are some pending locals,
/* If there are some pending statics,
* start them now */
gdm_start_first_unborn_local (3 /* delay */);
}
......@@ -1914,7 +1914,7 @@ struct poptOption options [] = {
{ "nodaemon", '\0', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH,
&no_daemon, 0, N_("Do not fork into the background"), NULL },
{ "no-console", '\0', POPT_ARG_NONE,
&no_console, 0, N_("No console (local) servers to be run"), NULL },
&no_console, 0, N_("No console (static) servers to be run"), NULL },
{ "preserve-ld-vars", '\0', POPT_ARG_NONE,
&preserve_ld_vars, 0, N_("Preserve LD_* variables"), NULL },
{ "version", '\0', POPT_ARG_NONE,
......@@ -2299,7 +2299,7 @@ main (int argc, char *argv[])
/* Make us a unique global cookie to authenticate */
gdm_make_global_cookie ();
/* Start local X servers */
/* Start static X servers */
gdm_start_first_unborn_local (0 /* delay */);
/* Accept remote connections */
......@@ -2710,7 +2710,7 @@ gdm_handle_message (GdmConnection *conn, const char *msg, gpointer data)
g_string_append (resp, di->name);
g_string_append_c (resp, ',');
if (d->console && di->console && di->vt > 0)
if (d->attached && di->attached && di->vt > 0)
migratable = TRUE;
else if (GdmXdmcpProxyReconnect != NULL &&
d->type == TYPE_XDMCP_PROXY && di->type == TYPE_XDMCP_PROXY)
......@@ -2754,7 +2754,7 @@ gdm_handle_message (GdmConnection *conn, const char *msg, gpointer data)
for (li = displays; li != NULL; li = li->next) {
GdmDisplay *di = li->data;
if (di->logged_in && strcmp (di->name, p) == 0) {
if (d->console && di->vt > 0)
if (d->attached && di->vt > 0)
gdm_change_vt (di->vt);
else if (d->type == TYPE_XDMCP_PROXY && di->type == TYPE_XDMCP_PROXY)
gdm_xdmcp_migrate (d, di);
......@@ -3330,16 +3330,16 @@ handle_flexi_server (GdmConnection *conn, int type, const char *server,
p = strchr (p+1, '.');
if (p != NULL)
*p = '\0';
/* if it's on one of the console displays we started,
/* if it's on one of the attached displays we started,
* it's on the console, else it's not (it could be but
* we aren't sure and we don't want to be fooled) */
parent = find_display (disp);
if (/* paranoia */xnest_disp[0] == ':' &&
parent != NULL &&
parent->console)
display->console = TRUE;
parent->attached)
display->attached = TRUE;
else
display->console = FALSE;
display->attached = FALSE;
g_free (disp);
display->server_uid = server_uid;
......@@ -3712,10 +3712,10 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
g_free (cookie);
return;
}
/* check if cookie matches one of the console displays */
/* check if cookie matches one of the attached displays */
for (li = displays; li != NULL; li = li->next) {
GdmDisplay *disp = li->data;
if (disp->console &&
if (disp->attached &&
disp->cookie != NULL &&
g_ascii_strcasecmp (disp->cookie, cookie) == 0) {
g_free (cookie);
......@@ -3836,7 +3836,8 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
g_free (dispname);
g_free (xauthfile);
} else if (strcmp (msg, GDM_SUP_CONSOLE_SERVERS) == 0) {
} else if ((strcmp (msg, GDM_SUP_ATTACHED_SERVERS) == 0) ||
(strcmp (msg, GDM_SUP_CONSOLE_SERVERS) == 0)) {
GString *msg;
GSList *li;
const char *sep = " ";
......@@ -3844,7 +3845,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
msg = g_string_new ("OK");
for (li = displays; li != NULL; li = li->next) {
GdmDisplay *disp = li->data;
if ( ! disp->console)
if ( ! disp->attached)
continue;
g_string_append_printf (msg, "%s%s,%s,", sep,
ve_sure_string (disp->name),
......@@ -3945,7 +3946,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
logout_action = safe_logout_action;
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmHaltReal)) {
g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_HALT);
if (logout_action == GDM_LOGOUT_ACTION_HALT)
......@@ -3953,7 +3954,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
sep = ";";
}
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmRebootReal)) {
g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_REBOOT);
if (logout_action == GDM_LOGOUT_ACTION_REBOOT)
......@@ -3961,7 +3962,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
sep = ";";
}
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmSuspendReal)) {
g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_SUSPEND);
if (logout_action == GDM_LOGOUT_ACTION_SUSPEND)
......@@ -3997,7 +3998,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
was_ok = TRUE;
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_HALT) == 0) {
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmHaltReal)) {
disp->logout_action =
GDM_LOGOUT_ACTION_HALT;
......@@ -4005,7 +4006,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
}
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_REBOOT) == 0) {
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmRebootReal)) {
disp->logout_action =
GDM_LOGOUT_ACTION_REBOOT;
......@@ -4013,7 +4014,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
}
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_SUSPEND) == 0) {
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmSuspendReal)) {
disp->logout_action =
GDM_LOGOUT_ACTION_SUSPEND;
......@@ -4052,7 +4053,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
was_ok = TRUE;
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_HALT) == 0) {
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmHaltReal)) {
safe_logout_action =
GDM_LOGOUT_ACTION_HALT;
......@@ -4060,7 +4061,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
}
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_REBOOT) == 0) {
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmRebootReal)) {
safe_logout_action =
GDM_LOGOUT_ACTION_REBOOT;
......@@ -4068,7 +4069,7 @@ gdm_handle_user_message (GdmConnection *conn, const char *msg, gpointer data)
}
} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_SUSPEND) == 0) {
if (GdmSystemMenu &&
disp->console &&
disp->attached &&
! ve_string_empty (GdmSuspendReal)) {
safe_logout_action =
GDM_LOGOUT_ACTION_SUSPEND;
......
......@@ -33,13 +33,13 @@
#define BEL 0x7 /* Bell, used to interrupt login for
* say timed login or something similar */
#define TYPE_LOCAL 1 /* Local X server */
#define TYPE_XDMCP 2 /* Remote display */
#define TYPE_STATIC 1 /* X server defined in gdm.conf */
#define TYPE_XDMCP 2 /* Remote display/Xserver */
#define TYPE_FLEXI 3 /* Local Flexi X server */
#define TYPE_FLEXI_XNEST 4 /* Local Flexi Xnest server */
#define TYPE_XDMCP_PROXY 5 /* Proxy X server for XDMCP */
#define SERVER_IS_LOCAL(d) ((d)->type == TYPE_LOCAL || \
#define SERVER_IS_LOCAL(d) ((d)->type == TYPE_STATIC || \
(d)->type == TYPE_FLEXI || \
(d)->type == TYPE_FLEXI_XNEST || \
(d)->type == TYPE_XDMCP_PROXY)
......@@ -406,7 +406,8 @@ struct _GdmDisplay {
gboolean busy_display;
gboolean console;
gboolean attached; /* Display is physically attached to the machine. */
/* TYPE_XDMCP would have this FALSE, eg. */
time_t last_start_time;
time_t last_loop_start_time;
......@@ -735,9 +736,11 @@ void gdm_final_cleanup (void);
* 200 = Too many messages
* 999 = Unknown error
*/
#define GDM_SUP_CONSOLE_SERVERS "CONSOLE_SERVERS" /* None */
/* CONSOLE_SERVERS: List all console servers, useful for Linux mostly
* Doesn't list xdmcp and xnest non-console servers
#define GDM_SUP_ATTACHED_SERVERS "ATTACHED_SERVERS" /* None */
#define GDM_SUP_CONSOLE_SERVERS "CONSOLE_SERVERS" /* None */
/* ATTACHED_SERVERS: List all attached servers, useful for Linux mostly
* Doesn't list xdmcp and xnest non-attached servers
* CONSOLE_SERVERS supported, but deprecated due to terminology
* Supported since: 2.2.4.0
* Arguments: None
* Answers:
......@@ -747,8 +750,8 @@ void gdm_final_cleanup (void);
*
* <logged in user> can be empty in case no one logged in yet,
* and <vt> can be -1 if it's not known or not supported (on non-Linux
* for example). If the display is an xnest display and is a console one
* (that is, it is an xnest inside another console display) it is listed
* for example). If the display is an xnest display and is an attached one
* (that is, it is an xnest inside another attached display) it is listed
* and instead of vt, it lists the parent display in standard form.
*
* ERROR <err number> <english error description>
......@@ -757,7 +760,7 @@ void gdm_final_cleanup (void);
* 999 = Unknown error
*/
#define GDM_SUP_ALL_SERVERS "ALL_SERVERS" /* None */
/* ALL_SERVERS: List all servers, including console, remote, xnest. This
/* ALL_SERVERS: List all servers, including attached, remote, xnest. This
* Can for example be useful to figure out if the server you are on is managed
* by the gdm daemon, by seeing if it is in the list. It is also somewhat
* like the 'w' command but for graphical sessions.
......
......@@ -737,7 +737,7 @@ gdm_server_start (GdmDisplay *disp,
gdm_server_stop (d);
/* First clear the VT number */
if (d->type == TYPE_LOCAL ||
if (d->type == TYPE_STATIC ||
d->type == TYPE_FLEXI) {
d->vt = -1;
gdm_slave_send_num (GDM_SOP_VT_NUM, -1);
......@@ -774,7 +774,7 @@ gdm_server_start (GdmDisplay *disp,
d->servstat = SERVER_DEAD;
if (d->type == TYPE_LOCAL ||
if (d->type == TYPE_STATIC ||
d->type == TYPE_FLEXI) {
vtarg = gdm_get_empty_vt_argument (&vtfd, &vt);
}
......@@ -806,7 +806,7 @@ gdm_server_start (GdmDisplay *disp,
if (SERVER_IS_FLEXI (d))
gdm_slave_send_num (GDM_SOP_FLEXI_OK, 0 /* bogus */);
if (d->type == TYPE_LOCAL ||
if (d->type == TYPE_STATIC ||
d->type == TYPE_FLEXI) {
if (vt >= 0)
d->vt = vt;
......@@ -898,7 +898,7 @@ void
gdm_server_checklog (GdmDisplay *disp)
{
if (d->vt < 0 &&
(d->type == TYPE_LOCAL ||
(d->type == TYPE_STATIC ||
d->type == TYPE_FLEXI)) {
d->vt = display_vt (d);
if (d->vt >= 0)
......@@ -1404,8 +1404,8 @@ gdm_server_alloc (gint id, const gchar *command)
d->servstat = SERVER_DEAD;
d->sesspid = 0;
d->slavepid = 0;
d->type = TYPE_LOCAL;
d->console = TRUE;
d->type = TYPE_STATIC;
d->attached = TRUE;
d->sessionid = 0;
d->acctime = 0;
d->dsp = NULL;
......
......@@ -874,7 +874,7 @@ gdm_slave_start (GdmDisplay *display)
gdm_slave_run (display);
/* remote and flexi only run once */
if (display->type != TYPE_LOCAL ||
if (display->type != TYPE_STATIC ||
! parent_exists ()) {
gdm_server_stop (display);
gdm_slave_send_num (GDM_SOP_XPID, 0);
......@@ -1404,7 +1404,7 @@ gdm_slave_run (GdmDisplay *display)
/* something may have gone wrong, try xfailed, if local (non-flexi),
* the toplevel loop of death will handle us */
if G_UNLIKELY (d->handled && d->dsp == NULL) {
if (d->type == TYPE_LOCAL)
if (d->type == TYPE_STATIC)
gdm_slave_quick_exit (DISPLAY_XFAILED);
else
gdm_slave_quick_exit (DISPLAY_ABORT);
......@@ -1438,7 +1438,7 @@ gdm_slave_run (GdmDisplay *display)
/* this usually doesn't return */
gdm_slave_chooser (); /* Run the chooser */
return;
} else if (d->type == TYPE_LOCAL &&
} else if (d->type == TYPE_STATIC &&
gdm_first_login &&
! ve_string_empty (ParsedAutomaticLogin) &&
strcmp (ParsedAutomaticLogin, gdm_root_user ()) != 0) {
......@@ -1892,7 +1892,7 @@ gdm_slave_wait_for_login (void)
login = gdm_verify_user (d /* the display */,
NULL /* username*/,
d->name /* display name */,
d->console /* console? (bool) */);
d->attached /* display attached? (bool) */);
gdm_debug ("gdm_slave_wait_for_login: end verify for '%s'",
ve_sure_string (login));
......@@ -1938,7 +1938,7 @@ gdm_slave_wait_for_login (void)
login = gdm_verify_user (d,
pwent->pw_name,
d->name,
d->console);
d->attached);
GdmAllowRoot = oldAllowRoot;
/* Clear message */
......@@ -2048,7 +2048,7 @@ gdm_slave_wait_for_login (void)
gdm_slave_greeter_ctl_no_ret (GDM_RESET, "");
/* Play sounds if specified for a failed login */
if (d->console &&
if (d->attached &&
GdmSoundOnLoginFailure &&
! play_login_sound (GdmSoundOnLoginFailureFile)) {
gdm_error (_("Login sound requested on non-local display or the play "
......@@ -2071,7 +2071,7 @@ gdm_slave_wait_for_login (void)
/* Play sounds if specified for a successful login */
if (login != NULL &&
d->console &&
d->attached &&
GdmSoundOnLoginSuccess &&
! play_login_sound (GdmSoundOnLoginSuccessFile)) {
gdm_error (_("Login sound requested on non-local display or the play software "
......@@ -2680,7 +2680,7 @@ gdm_slave_greeter (void)
/* Note that this is just informative, the slave will not listen to
* the greeter even if it does something it shouldn't on a non-local
* display so it's not a security risk */
if (d->console) {
if (d->attached) {
ve_setenv ("GDM_IS_LOCAL", "yes", TRUE);
} else {
ve_unsetenv ("GDM_IS_LOCAL");
......@@ -2736,7 +2736,7 @@ gdm_slave_greeter (void)
g_free (msg);
}
if (d->console)
if (d->attached)
command = GdmGreeter;
else
command = GdmRemoteGreeter;
......@@ -3612,7 +3612,7 @@ session_child_run (struct passwd *pwent,
ve_setenv ("SHELL", pwent->pw_shell, TRUE);
ve_unsetenv ("MAIL"); /* Unset $MAIL for broken shells */
if (d->type == TYPE_LOCAL) {
if (d->type == TYPE_STATIC) {
ve_setenv ("GDM_XSERVER_LOCATION", "local", TRUE);
} else if (d->type == TYPE_XDMCP) {
ve_setenv ("GDM_XSERVER_LOCATION", "xdmcp", TRUE);
......@@ -4903,7 +4903,7 @@ gdm_slave_xioerror_handler (Display *disp)
/* Display is all gone */
d->dsp = NULL;
if ((d->type == TYPE_LOCAL ||
if ((d->type == TYPE_STATIC ||
d->type == TYPE_FLEXI) &&
(do_xfailed_on_xio_error ||
d->starttime + 5 >= time (NULL))) {
......@@ -4953,7 +4953,7 @@ check_for_interruption (const char *msg)
* it is allowed for this display (it's only allowed
* for the first local display) and if it's set up
* correctly */
if ((d->console || GdmAllowRemoteAutoLogin)
if ((d->attached || GdmAllowRemoteAutoLogin)
&& d->timed_login_ok &&
! ve_string_empty (ParsedTimedLogin) &&
strcmp (ParsedTimedLogin, gdm_root_user ()) != 0 &&
......@@ -4962,7 +4962,7 @@ check_for_interruption (const char *msg)
}
break;
case GDM_INTERRUPT_CONFIGURE:
if (d->console &&
if (d->attached &&
GdmConfigAvailable &&
GdmSystemMenu &&
! ve_string_empty (GdmConfigurator)) {
......@@ -4970,7 +4970,7 @@ check_for_interruption (const char *msg)
}
break;
case GDM_INTERRUPT_SUSPEND:
if (d->console &&
if (d->attached &&
GdmSystemMenu &&
! ve_string_empty (GdmSuspend)) {
gdm_slave_send (GDM_SOP_SUSPEND_MACHINE,
......@@ -4980,7 +4980,7 @@ check_for_interruption (const char *msg)
* just proxy this to the master server */
return TRUE;
case GDM_INTERRUPT_LOGIN_SOUND:
if (d->console &&
if (d->attached &&
! play_login_sound (GdmSoundOnLoginReadyFile)) {
gdm_error (_("Login sound requested on non-local display or the play software "
"cannot be run or the sound does not exist"));
......@@ -5551,11 +5551,11 @@ gdm_slave_handle_notify (const char *msg)
g_free (GdmGreeter);
GdmGreeter = g_strdup (&msg[strlen (GDM_NOTIFY_GREETER) + 1]);
if (d->console) {
if (d->attached) {
do_restart_greeter = TRUE;
if (restart_greeter_now) {
; /* will get restarted later */
} else if (d->type == TYPE_LOCAL) {
} else if (d->type == TYPE_STATIC) {
/* FIXME: can't handle flexi servers like this
* without going all cranky */
if ( ! d->logged_in) {
......@@ -5570,7 +5570,7 @@ gdm_slave_handle_notify (const char *msg)
g_free (GdmRemoteGreeter);
GdmRemoteGreeter = g_strdup
(&msg[strlen (GDM_NOTIFY_REMOTEGREETER) + 1]);
if ( ! d->console) {
if ( ! d->attached) {
do_restart_greeter = TRUE;
if (restart_greeter_now) {
; /* will get restarted later */
......@@ -5589,7 +5589,7 @@ gdm_slave_handle_notify (const char *msg)
do_restart_greeter = TRUE;
/* FIXME: this is fairly nasty, we should handle this nicer */
/* FIXME: can't handle flexi servers without going all cranky */
if (d->type == TYPE_LOCAL || d->type == TYPE_XDMCP) {
if (d->type == TYPE_STATIC || d->type == TYPE_XDMCP) {
if ( ! d->logged_in) {
gdm_slave_quick_exit (DISPLAY_REMANAGE);
} else {
......@@ -5631,7 +5631,7 @@ gdm_slave_handle_notify (const char *msg)
do_restart_greeter = TRUE;
if (restart_greeter_now) {
; /* will get restarted later */
} else if (d->type == TYPE_LOCAL) {
} else if (d->type == TYPE_STATIC) {
/* FIXME: can't handle flexi servers like this
* without going all cranky */
if ( ! d->logged_in) {
......@@ -5647,7 +5647,7 @@ gdm_slave_handle_notify (const char *msg)
do_restart_greeter = TRUE;
if (restart_greeter_now) {
; /* will get restarted later */
} else if (d->type == TYPE_LOCAL) {
} else if (d->type == TYPE_STATIC) {
/* FIXME: can't handle flexi servers like this
* without going all cranky */
if ( ! d->logged_in) {
......
......@@ -149,7 +149,7 @@ audit_success_login(int pw_change, struct passwd *pwent)
*
* Entry did_setcred == FALSE, process audit context is not established.
* TRUE, process audit context established.
* d = display structure, d->console non 0 if local,
* d = display structure, d->attached non 0 if local,
* d->hostname used if remote.
* pw_change == PW_FALSE, if no password change requested.
* PW_TRUE, if successful password change audit
......@@ -186,7 +186,7 @@ audit_fail_login(GdmDisplay *d, int pw_change, struct passwd *pwent,
"adt_start_session(ADT_login, ADT_FAILURE): %m");
return;
}
if (d->console) {
if (d->attached) {
/* login from the local host */
if (adt_load_hostname(NULL, &tid) != 0) {
......@@ -674,7 +674,7 @@ create_pamh (GdmDisplay *d,
/* Inform PAM of the user's tty */
#ifdef sun
if (d->console == 0)
if (d->attached == 0)
(void) pam_set_item (pamh, PAM_TTY, "/dev/console");
else
#endif /* sun */
......@@ -684,7 +684,7 @@ create_pamh (GdmDisplay *d,
return FALSE;
}
if ( ! d->console) {
if ( ! d->attached) {
/* Only set RHOST if host is remote */
/* From the host of the display */
if ((*pamerr = pam_set_item (pamh, PAM_RHOST,
......@@ -993,7 +993,7 @@ authenticate_again:
tmp_PAM_USER = NULL;
#ifdef HAVE_LOGINDEVPERM
if (d->console)
if (d->attached)
(void) di_devperm_login("/dev/console", pwent->pw_uid,
pwent->pw_gid, NULL);
#endif /* HAVE_LOGINDEVPERM */
......@@ -1280,7 +1280,7 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display,
extra_standalone_message = NULL;
#ifdef HAVE_LOGINDEVPERM
if (d->console)
if (d->attached)
(void) di_devperm_login("/dev/console", pwent->pw_uid,
pwent->pw_gid, NULL);
#endif /* HAVE_LOGINDEVPERM */
......@@ -1382,7 +1382,7 @@ gdm_verify_cleanup (GdmDisplay *d)
pam_end (tmp_pamh, pamerr);
#ifdef HAVE_LOGINDEVPERM
if (old_opened_session && old_did_setcred && d->console)
if (old_opened_session && old_did_setcred && d->attached)
{
(void) di_devperm_logout("/dev/console");
/* give it back to gdm user */
......
......@@ -2558,7 +2558,7 @@ gdm_xdmcp_display_alloc (
d->servstat = 0;
d->sesspid = 0;
d->slavepid = 0;
d->console = FALSE;
d->attached = FALSE;
d->dispstat = XDMCP_PENDING;
d->sessionid = globsessid++;
if (d->sessionid == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment