diff options
-rw-r--r-- | login-utils/su-common.c | 5 | ||||
-rw-r--r-- | login-utils/su.1 | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/login-utils/su-common.c b/login-utils/su-common.c index ba2a6166d..a41d01593 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -810,6 +810,11 @@ su_main (int argc, char **argv, int mode) ++optind; } + if (simulate_login && !change_environment) { + warnx(_("ignore --preserve-environment, it's mutually exclusive to --login.")); + change_environment = true; + } + switch (su_mode) { case RUNUSER_MODE: if (runuser_user) { diff --git a/login-utils/su.1 b/login-utils/su.1 index c82b941ff..eab1a6f7f 100644 --- a/login-utils/su.1 +++ b/login-utils/su.1 @@ -98,6 +98,7 @@ Preserves the whole environment, ie does not set .B USER nor .BR LOGNAME . +The option is ignored if the option \fB\-\-login\fR is specified. .TP \fB\-s\fR \fISHELL\fR, \fB\-\-shell\fR=\fISHELL\fR Runs the specified shell instead of the default. The shell to run is |