From 57b9d60cb547cf7ec4585d62f573ae4e07068efe Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 27 Feb 2020 14:37:23 +0100 Subject: [PATCH] su, runuser: (man) add more info about PATH and PAM Addresses: https://github.com/karelzak/util-linux/issues/964 Signed-off-by: Karel Zak --- login-utils/runuser.1 | 8 +++++++- login-utils/su.1 | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/login-utils/runuser.1 b/login-utils/runuser.1 index 27dbf576c1..17bab28d87 100644 --- a/login-utils/runuser.1 +++ b/login-utils/runuser.1 @@ -52,6 +52,11 @@ is not root). This version of .B runuser uses PAM for session management. +.PP +Note that +.B runuser +in all cases use PAM (pam_getenvlist()) to do final environment modification. The command line options +like \fB\-\-login\fR or \fB\-\-preserve\-environment\fR affect environment before it's modified by PAM. .SH OPTIONS .TP .BR \-c , " \-\-command" = \fIcommand @@ -212,7 +217,8 @@ initializes .RE .sp The environment variable PATH may be different on systems where /bin and /sbin -are merged into /usr. +are merged into /usr, this variable is also affected by \fB\-\-login\fR command line option and +PAM system setting (e.g. pam_env). .SH EXIT STATUS .B runuser normally returns the exit status of the command it executed. If the diff --git a/login-utils/su.1 b/login-utils/su.1 index 8c67dc402e..6d41b0f94d 100644 --- a/login-utils/su.1 +++ b/login-utils/su.1 @@ -56,6 +56,11 @@ that does not require authentication and provide separate PAM configuration. If the PAM session is not required at all then the recommend solution is to use command .BR setpriv (1). +.PP +Note that +.B su +in all cases use PAM (pam_getenvlist()) to do final environment modification. The command line options +like \fB\-\-login\fR or \fB\-\-preserve\-environment\fR affect environment before it's modified by PAM. .SH OPTIONS .TP @@ -233,7 +238,8 @@ initializes .RE .sp The environment variable PATH may be different on systems where /bin and /sbin -are merged into /usr. +are merged into /usr, this variable is also affected by \fB\-\-login\fR command line option and +PAM system setting (e.g. pam_env). .SH EXIT STATUS .B su normally returns the exit status of the command it executed. If the -- 2.47.2