summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2001-09-01 01:14:01 +0000
committerGeorge Lebl <jirka@src.gnome.org>2001-09-01 01:14:01 +0000
commit7702fc65780faa909c7a652e86b70cd61f595412 (patch)
tree72583c28c880afb3e9a26875095c3cf2bdfed772 /daemon
parentcdc0c4cf86cd2f93e36d46d472235f560bc2b80a (diff)
downloadgdm-7702fc65780faa909c7a652e86b70cd61f595412.tar.gz
Add an xdmcp/Willing script configuration option. To run a script when the
Fri Aug 31 18:12:05 2001 George Lebl <jirka@5z.com> * config/gdm.conf.in, daemon/gdm.[ch], daemon/xdmcp.c: Add an xdmcp/Willing script configuration option. To run a script when the system gets the QUERY command. * daemon/gdm.c: Fix checks for the chooser and greeter binaries * gui/gdmconfig.{glade,c}: Add configuration for the Willing thing * docs/C/gdm.sgml: Document some of the new configuration keys. Not everything is documented yet.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm.c12
-rw-r--r--daemon/gdm.h1
-rw-r--r--daemon/xdmcp.c22
3 files changed, 30 insertions, 5 deletions
diff --git a/daemon/gdm.c b/daemon/gdm.c
index b8eddb17..e5866760 100644
--- a/daemon/gdm.c
+++ b/daemon/gdm.c
@@ -135,6 +135,7 @@ gboolean GdmIndirect = FALSE;
gint GdmMaxIndirect = 0;
gint GdmMaxIndirectWait = 0;
gint GdmPingInterval = 0;
+gchar *GdmWilling = NULL;
gboolean GdmDebug = FALSE;
gboolean GdmVerboseAuth = FALSE;
gboolean GdmAllowRoot = FALSE;
@@ -242,6 +243,7 @@ gdm_config_parse (void)
GdmMaxIndirect = gnome_config_get_int (GDM_KEY_MAXINDIR);
GdmMaxIndirectWait = gnome_config_get_int (GDM_KEY_MAXINDWAIT);
GdmPingInterval = gnome_config_get_int (GDM_KEY_PINGINTERVAL);
+ GdmWilling = gnome_config_get_string (GDM_KEY_WILLING);
GdmStandardXServer = gnome_config_get_string (GDM_KEY_STANDARD_XSERVER);
if (ve_string_empty (GdmStandardXServer))
@@ -464,7 +466,7 @@ gdm_config_parse (void)
/* Check that the greeter can be executed */
bin = ve_first_word (GdmGreeter);
- if ( ! ve_string_empty (bin) &&
+ if (ve_string_empty (bin) ||
access (bin, X_OK) != 0) {
gdm_error (_("%s: Greeter not found or can't be executed by the gdm user"), "gdm_config_parse");
}
@@ -476,8 +478,8 @@ gdm_config_parse (void)
bin = ve_first_word (GdmChooser);
if (GdmIndirect &&
- ! ve_string_empty (bin) &&
- access (bin, X_OK) != 0) {
+ (ve_string_empty (bin) ||
+ access (bin, X_OK) != 0)) {
gdm_error (_("%s: Chooser not found or it can't be executed by the gdm user"), "gdm_config_parse");
}
@@ -1790,8 +1792,8 @@ handle_flexi_server (GdmConnection *conn, int type, const char *server,
return;
}
- bin = ve_first_word (ve_sure_string (server));
- if (server == NULL ||
+ bin = ve_first_word (server);
+ if (ve_string_empty (server) ||
access (bin, X_OK) != 0) {
g_free (bin);
gdm_connection_write (conn,
diff --git a/daemon/gdm.h b/daemon/gdm.h
index e3674961..f58d8b03 100644
--- a/daemon/gdm.h
+++ b/daemon/gdm.h
@@ -176,6 +176,7 @@
#define GDM_KEY_MAXINDIR "xdmcp/MaxPendingIndirect=4"
#define GDM_KEY_MAXINDWAIT "xdmcp/MaxWaitIndirect=30"
#define GDM_KEY_PINGINTERVAL "xdmcp/PingInterval=5"
+#define GDM_KEY_WILLING "xdmcp/Willing=" EXPANDED_SYSCONFDIR "/gdm/Xwilling"
#define GDM_KEY_GTKRC "gui/GtkRC=" EXPANDED_DATADIR "/themes/Default/gtk/gtkrc"
#define GDM_KEY_ICONWIDTH "gui/MaxIconWidth=128"
diff --git a/daemon/xdmcp.c b/daemon/xdmcp.c
index 78b3b47a..025b2fc9 100644
--- a/daemon/xdmcp.c
+++ b/daemon/xdmcp.c
@@ -126,6 +126,7 @@ extern gint GdmMaxIndirectWait; /* Max wait between INDIRECT_QUERY and MANAGE */
extern gint GdmDispPerHost; /* Max number of displays per remote host */
extern gchar *GdmTimedLogin;
extern gboolean GdmAllowRemoteAutoLogin;
+extern gchar *GdmWilling; /* The willing script */
extern gboolean GdmXdmcp; /* xdmcp enabled */
@@ -831,8 +832,29 @@ gdm_xdmcp_send_willing (struct sockaddr_in *clnt_sa)
{
ARRAY8 status;
XdmcpHeader header;
+ char statusBuf[256];
+ char *bin;
+ FILE *fd;
gdm_debug ("gdm_xdmcp_send_willing: Sending WILLING to %s", inet_ntoa (clnt_sa->sin_addr));
+
+ bin = ve_first_word (GdmWilling);
+ if ( ! ve_string_empty (bin) &&
+ access (bin, X_OK) == 0 &&
+ (fd = popen (GdmWilling, "r")) != NULL) {
+ if (fgets (statusBuf, sizeof (statusBuf), fd) != NULL &&
+ ! ve_string_empty (g_strstrip (statusBuf))) {
+ status.data = statusBuf;
+ status.length = strlen (statusBuf);
+ } else {
+ status.data = sysid;
+ status.length = strlen (sysid);
+ }
+ fclose (fd);
+ } else {
+ status.data = sysid;
+ status.length = strlen (sysid);
+ }
status.data = sysid;
status.length = strlen (sysid);