From 5c8cf6925df3b84de94d9d858aab8481ccb9ec5f Mon Sep 17 00:00:00 2001 From: sin Date: Sun, 13 Apr 2014 17:23:04 +0100 Subject: [PATCH] Add su manpage and fix su usage line --- su.1 | 20 ++++++++++++++++++++ su.c | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 su.1 diff --git a/su.1 b/su.1 new file mode 100644 index 0000000..f028531 --- /dev/null +++ b/su.1 @@ -0,0 +1,20 @@ +.TH SU 1 ubase-VERSION +.SH NAME +\fBsu\fR - Run a command with a substitute user and group ID +.SH SYNOPSIS +\fBsu\fR [\fB-lp\fR] [\fIuser\fR] +.SH DESCRIPTION +\fBsu\fR allows to run commands with a substitute user and group ID. +When called without arguments, su defaults to running an interactive shell +as root. For backward compatibility su defaults to not change the current +directory and to only set the environment variables \fBHOME\fR and \fBSHELL\fR +(plus \fBUSER\fR and \fBLOGNAME\fR if target \fIuser\fR is not root). +.SH OPTIONS +.TP +\fB-l\fR +Starts the shell as login shell with an environment similar to a real +login. +.TP +\fB-p\fR +Preserves the whole environment. This option is ignored if the \fB-l\fR +option is specified. diff --git a/su.c b/su.c index 16d876f..91c9018 100644 --- a/su.c +++ b/su.c @@ -19,7 +19,7 @@ static void dologin(struct passwd *); static void usage(void) { - eprintf("usage: %s [-lp] [username]\n", argv0); + eprintf("usage: %s [-lp] [user]\n", argv0); } static int lflag = 0;