Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 42d6ad28aa989dac47141763f0383581 > files > 7

usermode-1.92-7mdv2008.0.src.rpm

--- usermode-1.92/userhelper.c.environment	2007-06-11 21:41:26.000000000 +0200
+++ usermode-1.92/userhelper.c	2007-09-04 11:57:31.000000000 +0200
@@ -1737,6 +1737,11 @@ wrap(const char *user, const char *progr
 	const char *env_display, *env_shell;
 	const char *env_lang, *env_language, *env_lcall, *env_lcmsgs;
 	const char *env_xauthority;
+	const char *env_iceauthority;
+	const char *env_secure_level, *env_rpm_install_lang;
+	const char *env_lcctype, *env_lcnumeric, *env_lctime, *env_lccollate;
+	const char *env_lcmonetary, *env_browser, *env_session_manager;
+	const char *env_ftp_proxy, *env_http_proxy, *env_https_proxy, *env_no_proxy;
 	int session, tryagain, gui, retval;
 	struct stat sbuf;
 	struct passwd *pwd;
@@ -1782,6 +1787,20 @@ wrap(const char *user, const char *progr
 	env_shell = getenv("SHELL");
 	env_term = getenv("TERM");
 	env_xauthority = getenv("XAUTHORITY");
+	env_rpm_install_lang = getenv("RPM_INSTALL_LANG");
+	env_secure_level = getenv("SECURE_LEVEL");
+	env_lcctype = getenv("LC_CTYPE");
+	env_lcnumeric = getenv("LC_NUMERIC");
+	env_lctime = getenv("LC_TIME");
+	env_lccollate = getenv("LC_COLLATE");
+	env_lcmonetary = getenv("LC_MONETARY");
+	env_browser = getenv("BROWSER");
+	env_session_manager = getenv("SESSION_MANAGER");
+	env_ftp_proxy = getenv("ftp_proxy");
+	env_http_proxy = getenv("http_proxy");
+	env_https_proxy = getenv("https_proxy");
+	env_no_proxy = getenv("no_proxy");
+	env_iceauthority = getenv("ICEAUTHORITY");
 
 	/* Sanity-check the environment variables as best we can: those
 	 * which aren't path names shouldn't contain "/", and none of
@@ -1826,6 +1845,71 @@ wrap(const char *user, const char *progr
 	    (strstr(env_xauthority , "..") ||
 	     strchr(env_xauthority , '%')))
 		env_xauthority = NULL;
+	if (env_rpm_install_lang &&
+	    (strstr(env_rpm_install_lang, "/") ||
+	     strstr(env_rpm_install_lang, "..") ||
+	     strchr(env_rpm_install_lang, '%')))
+		env_rpm_install_lang = NULL;
+	if (env_secure_level &&
+            (strstr(env_secure_level, "/") ||
+             strstr(env_secure_level, "..") ||
+             strchr(env_secure_level, '%')))
+                env_secure_level = NULL;
+	if (env_lcctype &&
+            (strstr(env_lcctype, "/") ||
+             strstr(env_lcctype, "..") ||
+             strchr(env_lcctype, '%')))
+                env_lcctype = NULL;
+	if (env_lcnumeric &&
+            (strstr(env_lcnumeric, "/") ||
+             strstr(env_lcnumeric, "..") ||
+             strchr(env_lcnumeric, '%')))
+                env_lcnumeric = NULL;
+	if (env_lctime &&
+            (strstr(env_lctime, "/") ||
+             strstr(env_lctime, "..") ||
+             strchr(env_lctime, '%')))
+                env_lctime = NULL;
+	if (env_lccollate &&
+            (strstr(env_lccollate, "/") ||
+             strstr(env_lccollate, "..") ||
+             strchr(env_lccollate, '%')))
+                env_lccollate = NULL;
+	if (env_lcmonetary &&
+            (strstr(env_lcmonetary, "/") ||
+             strstr(env_lcmonetary, "..") ||
+             strchr(env_lcmonetary, '%')))
+                env_lcmonetary= NULL;
+	if (env_browser &&
+            (strstr(env_browser, "/") ||
+             strstr(env_browser, "..") ||
+             strchr(env_browser, '%')))
+                env_browser= NULL;
+	if (env_session_manager &&
+            (strstr(env_session_manager, "..") ||
+             strchr(env_session_manager, '%')))
+                env_session_manager = NULL;
+	if (env_ftp_proxy &&
+            (strstr(env_ftp_proxy, "..") ||
+             strchr(env_ftp_proxy, '%')))
+                env_ftp_proxy = NULL;
+	if (env_http_proxy &&
+            (strstr(env_http_proxy, "..") ||
+             strchr(env_http_proxy, '%')))
+                env_http_proxy = NULL;
+	if (env_https_proxy &&
+            (strstr(env_https_proxy, "..") ||
+             strchr(env_https_proxy, '%')))
+                env_https_proxy = NULL;
+	if (env_no_proxy &&
+            (strstr(env_no_proxy, "..") ||
+             strchr(env_no_proxy, '%')))
+                env_no_proxy = NULL;
+	if (env_iceauthority &&
+	    (strstr(env_iceauthority , "..") ||
+	     strchr(env_iceauthority , '%')))
+		env_iceauthority = NULL;
+
 
 	val = svGetValue(s, "KEEP_ENV_VARS");
 	if (val != NULL) {
@@ -1865,6 +1949,19 @@ wrap(const char *user, const char *progr
 	if (env_lcmsgs) setenv("LC_MESSAGES", env_lcmsgs, 1);
 	if (env_shell) setenv("SHELL", env_shell, 1);
 	if (env_term) setenv("TERM", env_term, 1);
+	if (env_rpm_install_lang) setenv("RPM_INSTALL_LANG", env_rpm_install_lang, 1);
+	if (env_secure_level) setenv("SECURE_LEVEL", env_secure_level, 1);
+	if (env_lcctype) setenv("LC_CTYPE", env_lcctype, 1);
+	if (env_lcnumeric) setenv("LC_NUMERIC", env_lcnumeric, 1); 
+	if (env_lctime) setenv("LC_TIME", env_lctime, 1);
+	if (env_lccollate) setenv("LC_COLLATE", env_lccollate, 1);
+	if (env_lcmonetary) setenv("LC_MONETARY", env_lcmonetary, 1);
+	if (env_browser) setenv("BROWSER", env_browser, 1);
+	if (env_session_manager) setenv("SESSION_MANAGER", env_session_manager, 1);
+	if (env_ftp_proxy) setenv("ftp_proxy", env_ftp_proxy, 1);
+	if (env_http_proxy) setenv("http_proxy", env_http_proxy, 1);
+	if (env_https_proxy) setenv("https_proxy", env_https_proxy, 1);
+	if (env_no_proxy) setenv("no_proxy", env_no_proxy, 1);
 
 	/* Set the PATH to a reasonaly safe list of directories. */
 	setenv("PATH",
@@ -2151,6 +2248,10 @@ wrap(const char *user, const char *progr
 			setenv("XAUTHORITY", env_xauthority, 1);
 		}
 
+		if (env_iceauthority) {
+			setenv("ICEAUTHORITY", env_iceauthority, 1);
+		}
+
 		/* Open a session. */
 		retval = pam_open_session(data->pamh, 0);
 		if (retval != PAM_SUCCESS) {