This file describes the behavior of 'su' in respect of the session and terminal
control.

1. 'su' immediately exits if its stdin be not a terminal and the invoker
   isn't root (getuid() != 0);

2. 'su' needs a record in utmp file corresponding to its controlling
   terminal; this information is retrieved by getlogin() and is passed
   to the PAM stack in PAM_RUSER item;

3. 'su' invoked as 'su - [user]' emulates a login session:
       *  the current utmp record is replaced by a new one;
       *  the owner of the controlling terminal is changed to <user>;
       *  environment variables like HOME are set to new values;
       *  chdir() to <user>'s home directory is performed;
       *  <user>'s shell is invoked as a login shell;

    certainly, the utmp record and terminal ownership (and even mode)
    are restored after the finish of the shell;

4. 'su' invoked as 'su -c <command> [user]' tries to allow you
   to use the common job control actions on the command, i.e. you
   may stop the command, put it in the background and so on;
   however due to a bug in bash you sometimes may face very strange
   results;

5. in the case of both command and '-' (login shell marker) presence
   the command is ignored and login shell is invoked.

I hope the notes help to understand 'su' behavior without
digging in the source (which however isn't a very bad thing IMHO).
Sometime the notes will be added to the manual page.

1998/06/12		Andrey V. Savochkin <saw@msu.ru>
