Bugzilla – Attachment 1332 Details for
Bug 1346
PAM environment takes precedence over SendEnv
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
client-sent environment overrides PAM-read environment
sshpatch (text/plain), 1.78 KB, created by
Jean-Christophe Dubacq
on 2007-07-30 00:56:49 AEST
(
hide
)
Description:
client-sent environment overrides PAM-read environment
Filename:
MIME Type:
Creator:
Jean-Christophe Dubacq
Created:
2007-07-30 00:56:49 AEST
Size:
1.78 KB
patch
obsolete
>diff -Nru /tmp/8kgIBOGGyc/openssh-4.6p1/session.c /tmp/uOw92W4fOj/openssh-4.6p1/session.c >--- /tmp/8kgIBOGGyc/openssh-4.6p1/session.c 2007-07-11 14:14:07.000000000 +0000 >+++ /tmp/uOw92W4fOj/openssh-4.6p1/session.c 2007-07-11 14:14:07.000000000 +0000 >@@ -819,11 +819,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; >@@ -849,7 +849,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 { >@@ -872,6 +875,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 '#') >@@ -989,7 +1003,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); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1346
: 1332 |
1894