-26/Mar/2000 1.6.3 1
+28/Mar/2000 1.6.3 1
-26/Mar/2000 1.6.3 2
+28/Mar/2000 1.6.3 2
conjunction with the -s flag.
R\bR\bR\bRE\bE\bE\bET\bT\bT\bTU\bU\bU\bUR\bR\bR\bRN\bN\bN\bN V\bV\bV\bVA\bA\bA\bAL\bL\bL\bLU\bU\bU\bUE\bE\bE\bES\bS\bS\bS
- s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo quits with an exit value of 1 if there is a
- configuration/permission problem or if s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo cannot execute
- the given command. In the latter case the error string is
- printed to stderr. If s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo cannot _\bs_\bt_\ba_\bt(2) one or more
- entries in the user's PATH an error is printed on stderr.
- (If the directory does not exist or if it is not really a
- directory, the entry is ignored and no error is printed.)
- This should not happen under normal circumstances. The
- most common reason for _\bs_\bt_\ba_\bt(2) to return "permission
- denied" is if you are running an automounter and one of
- the directories in your PATH is on a machine that is
- currently unreachable.
+ Upon successful execution of a program, the return value
+ from s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will simply be the return value of the program
+ that was executed.
+
+ Otherwise, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo quits with an exit value of 1 if there is
+ a configuration/permission problem or if s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo cannot
+ execute the given command. In the latter case the error
+ string is printed to stderr. If s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo cannot _\bs_\bt_\ba_\bt(2) one
+ or more entries in the user's PATH an error is printed on
+ stderr. (If the directory does not exist or if it is not
+ really a directory, the entry is ignored and no error is
+ printed.) This should not happen under normal
+ circumstances. The most common reason for _\bs_\bt_\ba_\bt(2) to
+ return "permission denied" is if you are running an
+ automounter and one of the directories in your PATH is on
+ a machine that is currently unreachable.
S\bS\bS\bSE\bE\bE\bEC\bC\bC\bCU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIT\bT\bT\bTY\bY\bY\bY N\bN\bN\bNO\bO\bO\bOT\bT\bT\bTE\bE\bE\bES\bS\bS\bS
s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo tries to be safe when executing external commands.
option that disables this behavior or link s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo
statically.
- s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will check the ownership of its timestamp directory
- (_\b/_\bv_\ba_\br_\b/_\br_\bu_\bn_\b/_\bs_\bu_\bd_\bo by default) and ignore the directory's
- contents if it is not owned by root and only writable by
- root. On systems that allow non-root users to give away
-26/Mar/2000 1.6.3 3
+28/Mar/2000 1.6.3 3
sudo(1m) MAINTENANCE COMMANDS sudo(1m)
+ s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will check the ownership of its timestamp directory
+ (_\b/_\bv_\ba_\br_\b/_\br_\bu_\bn_\b/_\bs_\bu_\bd_\bo by default) and ignore the directory's
+ contents if it is not owned by root and only writable by
+ root. On systems that allow non-root users to give away
files via _\bc_\bh_\bo_\bw_\bn(2), if the timestamp directory is located
in a directory writable by anyone (eg: _\b/_\bt_\bm_\bp), it is
possible for a user to create the timestamp directory
% sudo sh -c "cd /home ; du -s * | sort -rn > USAGE"
-E\bE\bE\bEN\bN\bN\bNV\bV\bV\bVI\bI\bI\bIR\bR\bR\bRO\bO\bO\bON\bN\bN\bNM\bM\bM\bME\bE\bE\bEN\bN\bN\bNT\bT\bT\bT
- s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo utilizes the following environment variables:
-
-
-26/Mar/2000 1.6.3 4
+28/Mar/2000 1.6.3 4
sudo(1m) MAINTENANCE COMMANDS sudo(1m)
+E\bE\bE\bEN\bN\bN\bNV\bV\bV\bVI\bI\bI\bIR\bR\bR\bRO\bO\bO\bON\bN\bN\bNM\bM\bM\bME\bE\bE\bEN\bN\bN\bNT\bT\bT\bT
+ s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo utilizes the following environment variables:
+
PATH Set to a sane value if SECURE_PATH is set
SHELL Used to determine shell to run with -s option
USER Set to the target user (root unless the -u option
shell regardless of any '!' elements in the user
specification.
- Running shell scripts via s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo can expose the same kernel
- bugs that make setuid shell scripts unsafe on some
- operating systems (if your OS supports the /dev/fd/
-26/Mar/2000 1.6.3 5
+28/Mar/2000 1.6.3 5
sudo(1m) MAINTENANCE COMMANDS sudo(1m)
+ Running shell scripts via s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo can expose the same kernel
+ bugs that make setuid shell scripts unsafe on some
+ operating systems (if your OS supports the /dev/fd/
directory, setuid shell scripts are generally safe).
S\bS\bS\bSE\bE\bE\bEE\bE\bE\bE A\bA\bA\bAL\bL\bL\bLS\bS\bS\bSO\bO\bO\bO
-
-
-
-26/Mar/2000 1.6.3 6
+28/Mar/2000 1.6.3 6
''' $RCSfile$$Revision$$Date$
'''
''' $Log$
-''' Revision 1.3 2000/03/27 03:26:23 millert
-''' Use @mansectsu@ and @mansectform@ in the man page bodies as well.
+''' Revision 1.4 2000/04/01 21:22:11 millert
+''' Clear up confusion wrt sudo's return value.
'''
'''
.de Sh
.nr % 0
.rr F
.\}
-.TH sudo @mansectsu@ "1.6.3" "26/Mar/2000" "MAINTENANCE COMMANDS"
+.TH sudo @mansectsu@ "1.6.3" "28/Mar/2000" "MAINTENANCE COMMANDS"
.UC
.if n .hy 0
.if n .na
The \f(CW--\fR flag indicates that \fBsudo\fR should stop processing command
line arguments. It is most useful in conjunction with the \f(CW-s\fR flag.
.SH "RETURN VALUES"
-\fBsudo\fR quits with an exit value of 1 if there is a
+Upon successful execution of a program, the return value from \fBsudo\fR
+will simply be the return value of the program that was executed.
+.PP
+Otherwise, \fBsudo\fR quits with an exit value of 1 if there is a
configuration/permission problem or if \fBsudo\fR cannot execute the
given command. In the latter case the error string is printed to
stderr. If \fBsudo\fR cannot \fIstat\fR\|(2) one or more entries in the user's