]> granicus.if.org Git - shadow/commitdiff
* NEWS, src/su.c: Preserve the DISPLAY and XAUTHORITY environment
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 5 Jun 2009 22:19:38 +0000 (22:19 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 5 Jun 2009 22:19:38 +0000 (22:19 +0000)
variables, even with --login. This was not the case before in the
PAM version.

ChangeLog
NEWS
src/su.c

index 522c3ddf3d4ed1198b8aa31f402a34f9e6559393..34d02d40731cbb78e1f5d57dbe0bb973d3036e8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-06  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, src/su.c: Preserve the DISPLAY and XAUTHORITY environment
+       variables, even with --login. This was not the case before in the
+       PAM version.
+
 2009-06-06  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/useradd.c, src/groupmod.c, src/groupadd.c, src/faillog.c:
diff --git a/NEWS b/NEWS
index f387544f3aafc249762987a14db746553e959fab..8b96b35177ba1900c8ae925da334c26add84fc54 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ $Id$
 
 shadow-4.1.4.1 -> shadow-4.1.4.2                                               UNRELEASED
 
+- su
+  * Preserve the DISPLAY and XAUTHORITY environment variables. This was
+    only the case in the non PAM enabled versions.
 
 shadow-4.1.4 -> shadow-4.1.4.1                                         2009-05-22
 
index 3cb66f665c3780306039b23e3c6d823645aa8e93..9f81dbed66432f08259933791db60b1188c4250a 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -559,7 +559,8 @@ int main (int argc, char **argv)
         * (note: in the case of a subsystem, the shell will be restricted,
         *        and this won't be executed on the first pass)
         */
-       if (fakelogin && change_environment) {
+       if (change_environment) {
+               if (fakelogin) {
                /*
                 * The terminal type will be left alone if it is present in
                 * the environment already.
@@ -595,6 +596,7 @@ int main (int argc, char **argv)
                if (NULL != cp) {
                        addenv (cp, NULL);      /* set the default $HZ, if one */
                }
+#endif                         /* !USE_PAM */
 
                /*
                 * Also leave DISPLAY and XAUTHORITY if present, else
@@ -608,7 +610,7 @@ int main (int argc, char **argv)
                if (NULL != cp) {
                        addenv ("XAUTHORITY", cp);
                }
-#endif                         /* !USE_PAM */
+               }
        } else {
                while (NULL != *envp) {
                        addenv (*envp, NULL);