From njh@neilhoggarth-2.dsl.easynet.co.uk  Thu May 24 10:33:20 2007
Return-Path: <njh@neilhoggarth-2.dsl.easynet.co.uk>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id C749616A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 May 2007 10:33:20 +0000 (UTC)
	(envelope-from njh@neilhoggarth-2.dsl.easynet.co.uk)
Received: from neilhoggarth-2.dsl.easynet.co.uk (neilhoggarth-2.dsl.easynet.co.uk [217.206.124.94])
	by mx1.freebsd.org (Postfix) with ESMTP id 2D2C713C48C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 May 2007 10:33:19 +0000 (UTC)
	(envelope-from njh@neilhoggarth-2.dsl.easynet.co.uk)
Received: from neilhoggarth-2.dsl.easynet.co.uk (localhost.localdomain [127.0.0.1])
	by neilhoggarth-2.dsl.easynet.co.uk (8.14.1/8.14.1) with ESMTP id l4OADIfO013190
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 May 2007 11:13:18 +0100 (BST)
	(envelope-from njh@neilhoggarth-2.dsl.easynet.co.uk)
Received: (from njh@localhost)
	by neilhoggarth-2.dsl.easynet.co.uk (8.14.1/8.14.1/Submit) id l4OADIea013189;
	Thu, 24 May 2007 11:13:18 +0100 (BST)
	(envelope-from njh)
Message-Id: <200705241013.l4OADIea013189@neilhoggarth-2.dsl.easynet.co.uk>
Date: Thu, 24 May 2007 11:13:18 +0100 (BST)
From: Neil Hoggarth <neil@hoggarth.me.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] xdm-1.1.4_1 does not inherit environment from login.conf
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         112932
>Category:       ports
>Synopsis:       [patch] x11/xdm  1.1.4_1 does not inherit environment from login.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-x11
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 24 10:40:09 GMT 2007
>Closed-Date:    Thu Jun 07 20:17:25 GMT 2007
>Last-Modified:  Thu Jun 07 20:17:25 GMT 2007
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-x11 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu May 24 11:21:07 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112932 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/112932: commit references a PR
Date: Thu,  7 Jun 2007 19:49:08 +0000 (UTC)

 lesi        2007-06-07 19:48:59 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11/xdm              Makefile 
   Added files:
     x11/xdm/files        patch-session.c 
   Log:
   - Restore inheriting environment from login.conf by restoring patch
     from x11/xorg-clients [1]
   - Restore inheriting SSH_AUTH_SOCK after pam_ssh authentication
     (https://bugs.freedesktop.org/show_bug.cgi?id=11020) [2]
   
   PR:             ports/112932 [1], ports/113031 [2]
   Obtained from:  X.org git [2]
   
   Revision  Changes    Path
   1.2       +1 -1      ports/x11/xdm/Makefile
   1.1       +43 -0     ports/x11/xdm/files/patch-session.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: lesi 
State-Changed-When: Thu Jun 7 20:17:05 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112932 
>Unformatted:
