[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#313317: openssh: update to patch for 1:4.3p2-10



Package: openssh
Followup-For: Bug #313317

Here is an update of my path to openssh 1:4.3p2-10, in debdiff format

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-686 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -u openssh-4.3p2/session.c openssh-4.3p2/session.c
--- openssh-4.3p2/session.c
+++ openssh-4.3p2/session.c
@@ -788,11 +788,11 @@
 
 /*
  * Sets the value of the given variable in the environment.  If the variable
- * already exists, its value is overriden.
+ * already exists, its value is kept/overriden according to clobber.
  */
 void
-child_set_env(char ***envp, u_int *envsizep, const char *name,
-	const char *value)
+child_set_env_safe(char ***envp, u_int *envsizep, const char *name,
+	const char *value, char clobber)
 {
 	char **env;
 	u_int envsize;
@@ -818,7 +818,10 @@
 	for (i = 0; env[i]; i++)
 		if (strncmp(env[i], name, namelen) == 0 && env[i][namelen] == '=')
 			break;
-	if (env[i]) {
+	if (env[i] && !clobber) {
+		/* No use for this variable: already exists and no clobber */
+		return;
+	} else if (env[i] && clobber) {
 		/* Reuse the slot. */
 		xfree(env[i]);
 	} else {
@@ -841,6 +844,17 @@
 }
 
 /*
+ * Sets the value of the given variable in the environment.  If the variable
+ * already exists, its value is overriden.
+ */
+void
+child_set_env(char ***envp, u_int *envsizep, const char *name,
+	const char *value)
+{
+  child_set_env_safe(envp,envsizep,name,value,1);
+}
+
+/*
  * Reads environment variables from the given file and adds/overrides them
  * into the environment.  If the file does not exist, this does nothing.
  * Otherwise, it must consist of empty lines, comments (line starts with '#')
@@ -958,7 +972,7 @@
 		*var_val++ = '\0';
 
 		debug3("Copy environment: %s=%s", var_name, var_val);
-		child_set_env(env, envsize, var_name, var_val);
+		child_set_env_safe(env, envsize, var_name, var_val,0);
 
 		xfree(var_name);
 	}
diff -u openssh-4.3p2/debian/changelog openssh-4.3p2/debian/changelog
--- openssh-4.3p2/debian/changelog
+++ openssh-4.3p2/debian/changelog
@@ -1,3 +1,9 @@
+openssh (1:4.3p2-10.1) unstable; urgency=low
+
+  * Apply patch so that client-sent environment overrides PAM-read environment
+
+ -- Jean-Christophe Dubacq <jcdubacq1@free.fr>  Wed, 09 May 2007 10:22:49 +0200
+
 openssh (1:4.3p2-10) unstable; urgency=low
 
   * Multiply openssh-client-udeb's Installer-Menu-Item by 100.

Reply to: