Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Nov 1999 22:26:07 -0500 (EST)
From:      ajk@waterspout.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/15157: [PATCH] Environment Botch in KDM
Message-ID:  <199911290326.WAA93687@tempest.waterspout.com>

next in thread | raw e-mail | index | archive | help

>Number:         15157
>Category:       ports
>Synopsis:       [PATCH] Environment Botch in KDM
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 28 19:30:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Andrew J. Korty
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Waterspout Communications
>Environment:

FreeBSD tempest.waterspout.com 4.0-CURRENT FreeBSD 4.0-CURRENT #22:
Sat Nov 20 07:41:01 EST 1999
root@tempest.waterspout.com:/usr/src/sys/compile/TEMPEST  i386

>Description:

This patch replaces patch-au in the kdebase11 port.  The original
code was indended to clear the environment vector, but it seems to
limit the vector to one string.  It also causes my pam_ssh module
(to be contributed this week) not to work, presumably because the
environment vector gets overflowed to the point of causing a
segmentation fault.

>How-To-Repeat:

Configure with --with-pam and recompile.  Add my pam_ssh module to
/etc/pam.conf for service "xdm" and management groups "auth" and
"session".  Type your username and SSH private key passphrase in
the KDM dialog.  In my tests, KDM will SEGV while setting up the
environment vector in preparation for running the Xsession script.
I presume any PAM module that augments the environment vector would
cause similar behavior.

>Fix:

--- kdm/session.c.orig	Sun Nov 28 20:27:30 1999
+++ kdm/session.c	Sun Nov 28 20:26:00 1999
@@ -676,7 +676,6 @@
     extern char **environ;
     char ** e;
     struct passwd *pwd;
-    char *envinit[1];
 #endif
 
     if (verify->argv) {
@@ -717,8 +716,8 @@
          * We need to do this before setusercontext() because that may
          * set or reset some environment variables.
          */
-	envinit[0] = NULL;
-        environ = envinit;
+	if (environ && *environ)
+		*environ = NULL;
 
 	/*
 	 * Set the user's credentials: uid, gid, groups,

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911290326.WAA93687>