Bug 14078 - Document -l (or bring su in line with D****n)
Summary: Document -l (or bring su in line with D****n)
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: su (show other bugs)
Version: unstable
Hardware: all Linux
: P2 major
Assignee: Dmitry V. Levin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on: 23700
Blocks: 77
  Show dependency tree
 
Reported: 2008-01-18 15:35 MSK by Andrey Rahmatullin
Modified: 2012-05-28 19:49 MSK (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Rahmatullin 2008-01-18 15:35:15 MSK
ALT Linux su(1) keeps running user's $PATH (maybe other variables) when invoked 
without -l. This behavior is different from e.g. Debian and is confusing. 
Moreover, this behavior (neither default nor with -l) is not documented in any 
way:

       By default the user's shell is invoked directly, however, giving the 
argument flag -, su is  instructed  to  invoke
       the  shell  as  a login shell. This means that the current working 
directory will be changed to the home of the new
       user and the shell's first argument will be prefixed with a -.
[...]
       -, -l, --login
              Invoke the shell as a login shell.


Compare with Debian su(1):

       The optional argument - may be used to provide an environment similar to 
what the user
       would expect had the user logged in directly.
[...]
       The current environment is passed to the new shell. The value of $PATH 
is reset to /bin:/usr/bin for normal users,
       or /sbin:/bin:/usr/sbin:/usr/bin for the superuser. This may be changed 
with the ENV_PATH and ENV_SUPATH
       definitions in /etc/login.defs.
[...]
       -, -l, --login
           Provide an environment similar to what the user would expect had the 
user logged in directly.
Comment 1 Dmitry V. Levin 2008-01-19 00:53:59 MSK
Yes, ALT Linux su(1) and Debian su(1) differ.
So, what do you suggest?
Comment 2 Mikhail Gusarov 2008-01-19 00:55:27 MSK
Документировать, что происходит с окружением с - и без него.
Comment 3 Sir Raorn 2008-01-21 20:43:59 MSK
Т.е. толпы румяных линуксоидов не понимают что такое "login shell" и чем он
отличается от обычного интерактивного?  И при чём тут вообще su в таком случае?
Comment 4 Andrey Rahmatullin 2008-01-21 20:49:22 MSK
(In reply to comment #3)
> Т.е. толпы румяных линуксоидов не понимают что такое "login shell" и чем он
> отличается от обычного интерактивного?
Да. Я, например.

Comment 5 Sir Raorn 2008-01-21 20:53:20 MSK
(In reply to comment #4)
> Да. Я, например.

man `basename $SHELL`, раздел INVOCATION или что-то в этом роде.  Что при этом
будет происходить с окружением зависит от шелла и его стартовых скриптов, а не
от su...
Comment 6 Michael Shigorin 2010-07-12 22:49:26 MSD
(In reply to comment #3)
> Т.е. толпы румяных линуксоидов не понимают что такое "login shell" и чем он
> отличается от обычного интерактивного?  И при чём тут вообще su в таком случае?
При том, что всю документацию не перечитаешь и возможность полагаться на привычки помогает примерно как кэш L1.
Comment 7 Michael Shigorin 2012-05-28 19:34:24 MSK
Ну или хоть Url: починить, нынешний 404... подсказывают про http://www.linux-pam.org/pre/applications/