| 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
|
| 4 |
@@ -131,11 +131,15 @@
|
| 5 |
|
| 6 |
#include "error.h"
|
| 7 |
|
| 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
|
| 11 |
+ */
|
| 12 |
#ifndef RUNUSER
|
| 13 |
#define PROGRAM_NAME "su"
|
| 14 |
+#define PROGRAM_NAME_L "su-l"
|
| 15 |
#else
|
| 16 |
#define PROGRAM_NAME "runuser"
|
| 17 |
+#define PROGRAM_NAME_L "runuser-l"
|
| 18 |
#endif
|
| 19 |
|
| 20 |
#ifndef AUTHORS
|
| 21 |
@@ -310,7 +314,8 @@ correct_password (const struct passwd *p
|
| 22 |
#ifdef USE_PAM
|
| 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);
|
| 28 |
PAM_BAIL_P;
|
| 29 |
|
| 30 |
#ifndef RUNUSER
|
| 31 |
diff -urp coreutils-6.10-orig/doc/coreutils.info coreutils-6.10/doc/coreutils.info
|
| 32 |
--- coreutils-6.10-orig/doc/coreutils.info 2008-01-22 00:32:44.000000000 +0100
|
| 33 |
+++ coreutils-6.10/doc/coreutils.info 2008-01-24 17:17:04.000000000 +0100
|
| 34 |
@@ -11006,7 +11006,8 @@ options::.
|
| 35 |
set, even for the super-user, as described above), and set `PATH'
|
| 36 |
to a compiled-in default value. Change to USER's home directory.
|
| 37 |
Prepend `-' to the shell's name, intended to make it read its
|
| 38 |
- login startup file(s).
|
| 39 |
+ login startup file(s). When this option is given, /etc/pam.d/su-l
|
| 40 |
+ PAM file is used instead of the default one.
|
| 41 |
|
| 42 |
`-m'
|
| 43 |
`-p'
|
| 44 |
diff -urp coreutils-6.10-orig/doc/coreutils.texi coreutils-6.10/doc/coreutils.texi
|
| 45 |
--- coreutils-6.10-orig/doc/coreutils.texi 2008-01-24 16:50:57.000000000 +0100
|
| 46 |
+++ coreutils-6.10/doc/coreutils.texi 2008-01-24 17:12:58.000000000 +0100
|
| 47 |
@@ -13670,7 +13670,9 @@ the exit status of @var{command} otherwi
|
| 48 |
|
| 49 |
@command{su} allows one user to temporarily become another user. It runs a
|
| 50 |
command (often an interactive shell) with the real and effective user
|
| 51 |
-ID, group ID, and supplemental groups of a given @var{user}. Synopsis:
|
| 52 |
+ID, group ID, and supplemental groups of a given @var{user}. When the -l
|
| 53 |
+option is given, the su-l PAM file is used instead of the default su PAM file.
|
| 54 |
+Synopsis:
|
| 55 |
|
| 56 |
@example
|
| 57 |
su [@var{option}]@dots{} [@var{user} [@var{arg}]@dots{}]
|