* src/su.c, man/su.1.xml: The default behavior (without -p or
--login) is to copy most of the environment variables. Revert a previous change and update the documentation.
This commit is contained in:
parent
80907f451b
commit
7d5d9c1841
@ -1,3 +1,9 @@
|
|||||||
|
2009-06-06 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/su.c, man/su.1.xml: The default behavior (without -p or
|
||||||
|
--login) is to copy most of the environment variables. Revert a
|
||||||
|
previous change and update the documentation.
|
||||||
|
|
||||||
2009-06-06 Nicolas François <nicolas.francois@centraliens.net>
|
2009-06-06 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* man/passwd.5.xml, man/shadow.5.xml: Document the passwd- and
|
* man/passwd.5.xml, man/shadow.5.xml: Document the passwd- and
|
||||||
|
25
man/su.1.xml
25
man/su.1.xml
@ -247,13 +247,20 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry><term></term><listitem>
|
||||||
|
<para>
|
||||||
|
If <option>--login</option> is not used, the
|
||||||
|
environment is copied, except for the variables above.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry><term></term><listitem>
|
<varlistentry><term></term><listitem>
|
||||||
<para>
|
<para>
|
||||||
If <option>--login</option> is used, the
|
If <option>--login</option> is used, the
|
||||||
<envar>$TERM</envar>, <envar>$COLORTERM</envar>,
|
<envar>$TERM</envar>, <envar>$COLORTERM</envar>,
|
||||||
<envar>$DISPLAY</envar>, and
|
<envar>$DISPLAY</envar>, and
|
||||||
<envar>$XAUTHORITY</envar> environment variables are
|
<envar>$XAUTHORITY</envar> environment variables are
|
||||||
kept if they were set.
|
copied if they were set.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -270,13 +277,17 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry><term></term><listitem>
|
<varlistentry condition="no_pam"><term></term><listitem>
|
||||||
<para>
|
<para>
|
||||||
Other environment variables are deleted, but might be
|
If <option>--login</option> is used, other environment
|
||||||
set by <phrase condition="no_pam">the
|
variables might be set by the
|
||||||
<option>ENVIRON_FILE</option> file (see
|
<option>ENVIRON_FILE</option> file (see below).
|
||||||
below)</phrase><phrase condition="pam">PAM
|
</para>
|
||||||
modules</phrase>.
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry condition="pam"><term></term><listitem>
|
||||||
|
<para>
|
||||||
|
Other environment might be set by PAM modules.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
4
src/su.c
4
src/su.c
@ -559,8 +559,7 @@ int main (int argc, char **argv)
|
|||||||
* (note: in the case of a subsystem, the shell will be restricted,
|
* (note: in the case of a subsystem, the shell will be restricted,
|
||||||
* and this won't be executed on the first pass)
|
* and this won't be executed on the first pass)
|
||||||
*/
|
*/
|
||||||
if (change_environment) {
|
if (change_environment && fakelogin) {
|
||||||
if (fakelogin) {
|
|
||||||
/*
|
/*
|
||||||
* The terminal type will be left alone if it is present in
|
* The terminal type will be left alone if it is present in
|
||||||
* the environment already.
|
* the environment already.
|
||||||
@ -610,7 +609,6 @@ int main (int argc, char **argv)
|
|||||||
if (NULL != cp) {
|
if (NULL != cp) {
|
||||||
addenv ("XAUTHORITY", cp);
|
addenv ("XAUTHORITY", cp);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
while (NULL != *envp) {
|
while (NULL != *envp) {
|
||||||
addenv (*envp, NULL);
|
addenv (*envp, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user