Submitted By: Tushar Teredesai <tushar@linuxfromscratch.org>
Date: 2003-10-02
Initial Package Version: 4.0.3
Origin: blfs-dev mailing list long time back.
Description: When "su"ing from one user to another, preserve the
value of the DISPLAY env var.
diff -ur shadow-4.0.3/src/su.c shadow-4.0.3.patched/src/su.c
--- shadow-4.0.3/src/su.c	2002-03-07 22:30:28.000000000 -0600
+++ shadow-4.0.3.patched/src/su.c	2002-09-16 11:31:28.000000000 -0500
@@ -252,6 +252,12 @@
 		 */
 		if ((cp = getenv ("TERM")))
 			addenv ("TERM", cp);
+		/*
+		 * The display type will be left alone if it is present in
+		 * the environment already.
+		 */
+		if ((cp = getenv ("DISPLAY")))
+			addenv ("DISPLAY", cp);
 	} else {
 		while (*envp)
 			addenv (*envp++, NULL);
