ports/112932: [patch] xdm-1.1.4_1 does not inherit environment from login.conf
Neil Hoggarth
neil at hoggarth.me.uk
Thu May 24 10:40:10 UTC 2007
>Number: 112932
>Category: ports
>Synopsis: [patch] xdm-1.1.4_1 does not inherit environment from login.conf
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu May 24 10:40:09 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Neil Hoggarth
>Release: FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD neilhoggarth-2.dsl.easynet.co.uk 6.2-STABLE FreeBSD 6.2-STABLE #0: Wed May 16 20:16:26 BST 2007 njh at neilhoggarth-2.dsl.easynet.co.uk:/usr/obj/home/src/sys/SHADOWFAX i386
>Description:
I have successfully completed an update from xorg 6.9 to xorg 7.2
following the guidelines in /usr/ports/UPDATING. I have encountered a
regression (also reported by Szalai Andras on the freebsd-x11 mailing
list: http://lists.freebsd.org/pipermail/freebsd-x11/2007-May/004213.html).
The XDM daemon provided by the xorg-clients-6.9 port passed on to the
user's session PATH and other environment settings from the
/etc/login.conf file. The XDM daemon provided by xdm-1.1.4_1 does not.
>How-To-Repeat:
>Fix:
I have rebuilt the xdm package with the following patch saved in
/usr/ports/x11/xdm/files/patch-session.c. This restored the expected
behaviour for me. This is based on a patch which used to be applied to
xorg-clients under xorg 6.9:
--- session.c.orig Fri Feb 2 01:00:51 2007
+++ session.c Thu May 24 07:42:53 2007
@@ -543,6 +543,7 @@
pid_t pid;
#ifdef HAS_SETUSERCONTEXT
struct passwd* pwd;
+ extern char **environ;
#endif
#ifdef USE_PAM
pam_handle_t *pamh = thepamh ();
@@ -657,6 +658,8 @@
* Set the user's credentials: uid, gid, groups,
* environment variables, resource limits, and umask.
*/
+ /* destroy user environment before calling setusercontext */
+ environ = verify->userEnviron;
pwd = getpwnam(name);
if (pwd) {
if (setusercontext(NULL, pwd, pwd->pw_uid, LOGIN_SETALL) < 0) {
@@ -664,6 +667,7 @@
errno);
return (0);
}
+ verify->userEnviron = environ;
endpwent();
} else {
LogError ("getpwnam for \"%s\" failed, errno=%d\n", name, errno);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list