FreeBSD Bugzilla – Attachment 173036 Details for
Bug 211406
su -l clears LOGNAME environment variable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Patch for su.c and su.1
patch.txt (text/plain), 1.53 KB, created by
d.y.kazarov
on 2016-07-27 12:32:15 UTC
(
hide
)
Description:
Patch for su.c and su.1
Filename:
MIME Type:
Creator:
d.y.kazarov
Created:
2016-07-27 12:32:15 UTC
Size:
1.53 KB
patch
obsolete
>--- su.c.orig 2016-07-27 15:01:41.869222000 +0300 >+++ su.c 2016-07-27 15:02:11.379971000 +0300 >@@ -512,8 +512,11 @@ > environ = &cleanenv; > } > >- if (asthem || pwd->pw_uid) >+ if (asthem || pwd->pw_uid) { > setenv("USER", pwd->pw_name, 1); >+ setenv("LOGNAME", pwd->pw_name, 1); >+ } >+ > setenv("HOME", pwd->pw_dir, 1); > setenv("SHELL", shell, 1); > >--- su.1.orig 2016-07-27 15:11:26.748770000 +0300 >+++ su.1 2016-07-27 15:17:27.450091000 +0300 >@@ -65,6 +65,7 @@ > .Pp > By default, the environment is unmodified with the exception of > .Ev USER , >+.Ev LOGNAME , > .Ev HOME , > and > .Ev SHELL . >@@ -73,7 +74,9 @@ > .Ev SHELL > are set to the target login's default values. > .Ev USER >-is set to the target login, unless the target login has a user ID of 0, >+and >+.Ev LOGNAME >+are set to the target login, unless the target login has a user ID of 0, > in which case it is unmodified. > The invoked shell is the one belonging to the target login. > This is the traditional behavior of >@@ -103,6 +106,7 @@ > .Ev SHELL , > .Ev PATH , > .Ev TERM , >+.Ev LOGNAME , > and > .Ev USER . > .Ev HOME >@@ -110,7 +114,9 @@ > .Ev SHELL > are modified as above. > .Ev USER >-is set to the target login. >+and >+.Ev LOGNAME >+are set to the target login. > .Ev PATH > is set to > .Dq Pa /bin:/usr/bin . >@@ -181,6 +187,9 @@ > .It Ev TERM > Provides terminal type which may be retained for the substituted > user ID. >+.It Ev LOGNAME >+The user ID is always the effective ID (the target user ID) after an >+.Nm . > .It Ev USER > The user ID is always the effective ID (the target user ID) after an > .Nm
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 Raw
Actions:
View
Attachments on
bug 211406
: 173036