1 diff -uNrp -x '*~' coreutils-5.97-orig/src/su.c coreutils-5.97/src/su.c
2 --- coreutils-5.97-orig/src/su.c 2006-07-13 12:14:40.000000000 +0100
3 +++ coreutils-5.97/src/su.c 2006-07-13 12:24:33.000000000 +0100
8 -/* The official name of this program (e.g., no `g' prefix). */
9 +/* The official name of this program (e.g., no `g' prefix).
10 + * - Add a "-l" to the name passed to PAM if this is a login simulation
13 #define PROGRAM_NAME "su"
14 +#define PROGRAM_NAME_L "su-l"
16 #define PROGRAM_NAME "runuser"
17 +#define PROGRAM_NAME_L "runuser-l"
21 @@ -310,7 +314,8 @@ correct_password (const struct passwd *p
23 struct passwd *caller;
24 char *tty_name, *ttyn;
25 - retval = pam_start(PROGRAM_NAME, pw->pw_name, &conv, &pamh);
26 + retval = pam_start(simulate_login ? PROGRAM_NAME_L : PROGRAM_NAME,
27 + pw->pw_name, &conv, &pamh);