summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2001-10-20 19:11:35 +0000
committerGeorge Lebl <jirka@src.gnome.org>2001-10-20 19:11:35 +0000
commit68eb476cd39f65b92aa35ceca1874da07b000593 (patch)
tree8cceafd6d0d2accafe2360df890dc42acd64cc8c /daemon
parent5bae92c8c5567183173980fb0dbbb76617e0986c (diff)
downloadgdm-68eb476cd39f65b92aa35ceca1874da07b000593.tar.gz
Fix from the FreeBSD bugtracker to fix a crash related to setenv (foo,
Sat Oct 20 11:57:50 2001 George Lebl <jirka@5z.com> * daemon/slave.c: Fix from the FreeBSD bugtracker to fix a crash related to setenv (foo, NULL, 1). * daemon/gdm-net.c: Fix from the FreeBSD bugtracker to fix creation of the local socket
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-net.c4
-rw-r--r--daemon/slave.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/daemon/gdm-net.c b/daemon/gdm-net.c
index 188bf09c..c5704288 100644
--- a/daemon/gdm-net.c
+++ b/daemon/gdm-net.c
@@ -251,11 +251,11 @@ gdm_connection_open_unix (const char *sockname, mode_t mode)
return NULL;
}
+ memset(&addr, 0, sizeof(addr));
strcpy (addr.sun_path, sockname);
addr.sun_family = AF_UNIX;
if (bind (fd,
- (struct sockaddr *) &addr, strlen (addr.sun_path) +
- sizeof (addr.sun_family)) < 0) {
+ (struct sockaddr *) &addr, sizeof (addr)) < 0) {
gdm_error (_("%s: Could not bind socket"),
"gdm_connection_open_unix");
close (fd);
diff --git a/daemon/slave.c b/daemon/slave.c
index 1dbe3469..5c1a5677 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -1101,7 +1101,10 @@ gdm_slave_greeter (void)
/* this is again informal only, if the greeter does time out it will
* not actually login a user if it's not enabled for this display */
if (d->timed_login_ok) {
- ve_setenv ("GDM_TIMED_LOGIN_OK", ParsedTimedLogin, TRUE);
+ if(ParsedTimedLogin == NULL)
+ ve_setenv ("GDM_TIMED_LOGIN_OK", " ", TRUE);
+ else
+ ve_setenv ("GDM_TIMED_LOGIN_OK", ParsedTimedLogin, TRUE);
} else {
ve_unsetenv ("GDM_TIMED_LOGIN_OK");
}