Date: Thu, 24 May 2007 11:13:18 +0100 (BST) From: Neil Hoggarth <neil@hoggarth.me.uk> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/112932: [patch] xdm-1.1.4_1 does not inherit environment from login.conf Message-ID: <200705241013.l4OADIea013189@neilhoggarth-2.dsl.easynet.co.uk> Resent-Message-ID: <200705241040.l4OAe9LJ049610@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705241013.l4OADIea013189>