Add FreeBSD login.conf support (untested on BSD/OS) based on a patch from

Michael D. Marchionna.
configure now does substitution on the man pages, allowing us to
fix up the paths and set the section correctly.  Based on an idea
from Michael D. Marchionna.
This commit is contained in:
Todd C. Miller
2000-03-23 00:35:59 +00:00
parent 4d4ed8c166
commit d168a21cee
14 changed files with 776 additions and 671 deletions

View File

@@ -186,6 +186,13 @@ Special features/options:
`configure' changes; you should check to see if your platform can `configure' changes; you should check to see if your platform can
access DCE via PAM before using this option. access DCE via PAM before using this option.
--with-logincap
Enable support for BSD login classes on FreeBSD. This adds support
for the login classes specified in /etc/login.conf. By default,
a login class is not applied unless the 'use_loginclass' option
is defined in sudoers or the user specifies a class on the command
line.
--disable-sia --disable-sia
Disable SIA support. This is the "Security Integration Architecture" Disable SIA support. This is the "Security Integration Architecture"
on Digital UNIX. If you disable SIA sudo will use its own on Digital UNIX. If you disable SIA sudo will use its own

View File

@@ -85,12 +85,11 @@ visudodir = $(sbindir)
sudoersdir = $(sysconfdir) sudoersdir = $(sysconfdir)
# Directory in which to install the man page # Directory in which to install the man page
# set mansect5 to 4 on sysV machines.
mantype = @MANTYPE@ mantype = @MANTYPE@
mansect8 = 8 mansectsu = @mansectsu@
mansect5 = 5 mansectform = @mansectform@
mandir8 = $(mandir)/$(mantype)$(mansect8) mandirsu = $(mandir)/$(mantype)$(mansectsu)
mandir5 = $(mandir)/$(mantype)$(mansect5) mandirform = $(mandir)/$(mantype)$(mansectform)
# User and group ids the installed files should be "owned" by # User and group ids the installed files should be "owned" by
install_uid = 0 install_uid = 0
@@ -145,8 +144,9 @@ DISTFILES = $(SRCS) $(HDRS) BUGS CHANGES FAQ HISTORY INSTALL INSTALL.configure \
UPGRADE acsite.m4 aixcrypt.exp config.guess config.h.in config.sub \ UPGRADE acsite.m4 aixcrypt.exp config.guess config.h.in config.sub \
configure configure.in fnmatch.3 indent.pro install-sh \ configure configure.in fnmatch.3 indent.pro install-sh \
mkinstalldirs pathnames.h.in sample.pam sample.syslog.conf \ mkinstalldirs pathnames.h.in sample.pam sample.syslog.conf \
sample.sudoers sudo.cat sudo.man sudo.pod sudoers sudoers.cat \ sample.sudoers sudo.cat sudo.man.in sudo.pod sudoers sudoers.cat \
sudoers.man sudoers.pod visudo.cat visudo.man visudo.pod auth/API sudoers.man.in sudoers.pod visudo.cat visudo.man.in visudo.pod \
auth/API
BINFILES= BUGS CHANGES HISTORY LICENSE README TODO TROUBLESHOOTING \ BINFILES= BUGS CHANGES HISTORY LICENSE README TODO TROUBLESHOOTING \
UPGRADE install-sh mkinstalldirs sample.syslog.conf sample.sudoers \ UPGRADE install-sh mkinstalldirs sample.syslog.conf sample.sudoers \
@@ -251,35 +251,35 @@ securid.o: $(authdir)/securid.c $(AUTHDEP)
sia.o: $(authdir)/sia.c $(AUTHDEP) sia.o: $(authdir)/sia.c $(AUTHDEP)
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c
sudo.man: $(srcdir)/sudo.pod sudo.man.in: $(srcdir)/sudo.pod
@rm -f $(srcdir)/$@ @rm -f $(srcdir)/$@
(cd $(srcdir); pod2man --section=$(mansect8) --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo.pod > $(srcdir)/$@) (cd $(srcdir); pod2man --section=`echo @MANSECTSU@|tr A-Z a-z` --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo.pod > $(srcdir)/$@)
sudo.cat: sudo.man sudo.cat: sudo.man
visudo.man: $(srcdir)/visudo.pod visudo.man.in: $(srcdir)/visudo.pod
@rm -f $(srcdir)/$@ @rm -f $(srcdir)/$@
(cd $(srcdir); pod2man --section=$(mansect8) --release=$(VERSION) --center="MAINTENANCE COMMANDS" visudo.pod > $(srcdir)/$@) (cd $(srcdir); pod2man --section=`echo @MANSECTSU@|tr A-Z a-z` --release=$(VERSION) --center="MAINTENANCE COMMANDS" visudo.pod > $(srcdir)/$@)
visudo.cat: visudo.man visudo.cat: visudo.man
sudoers.man: $(srcdir)/sudoers.pod sudoers.man.in: $(srcdir)/sudoers.pod
@rm -f $(srcdir)/$@ @rm -f $(srcdir)/$@
(cd $(srcdir); pod2man --section=$(mansect5) --release=$(VERSION) --center="FILE FORMATS" sudoers.pod > $(srcdir)/$@) (cd $(srcdir); pod2man --section=`echo @MANSECTFORM@|tr A-Z a-z` --release=$(VERSION) --center="FILE FORMATS" sudoers.pod | sed 's/"\\f(CW""\\fR"/\\f(CW""\\fR/' > $(srcdir)/$@)
sudoers.cat: sudoers.man sudoers.cat: sudoers.man
install: install-dirs install-binaries install-sudoers install-man install: install-dirs install-binaries install-sudoers install-man
install-dirs: install-dirs:
$(SHELL) $(srcdir)/mkinstalldirs $(sudodir) $(visudodir) $(sudoersdir) $(mandir8) $(mandir5) $(SHELL) $(srcdir)/mkinstalldirs $(sudodir) $(visudodir) $(sudoersdir) $(mandirsu) $(mandirform)
install-binaries: $(PROGS) install-binaries: $(PROGS)
$(INSTALL) -o $(install_uid) -g $(install_gid) -m 4111 -s sudo $(sudodir)/sudo $(INSTALL) -o $(install_uid) -g $(install_gid) -m 4111 -s sudo $(sudodir)/sudo
$(INSTALL) -o $(install_uid) -g $(install_gid) -m 0111 -s visudo $(visudodir)/visudo $(INSTALL) -o $(install_uid) -g $(install_gid) -m 0111 -s visudo $(visudodir)/visudo
install-sudoers: install-sudoers:
@ if [ -f $(sudoersdir)/sudoers ]; then \ @if [ -f $(sudoersdir)/sudoers ]; then \
echo "Setting user/group and mode on existing $(sudoersdir)/sudoers file."; \ echo "Setting user/group and mode on existing $(sudoersdir)/sudoers file."; \
chown $(sudoers_uid) $(sudoersdir)/sudoers; \ chown $(sudoers_uid) $(sudoersdir)/sudoers; \
chgrp $(sudoers_gid) $(sudoersdir)/sudoers; \ chgrp $(sudoers_gid) $(sudoersdir)/sudoers; \
@@ -290,9 +290,9 @@ install-sudoers:
fi fi
install-man: install-man:
$(INSTALL) -o $(install_uid) -g $(install_gid) -m 0444 $(srcdir)/sudo.$(mantype) $(mandir8)/sudo.$(mansect8) $(INSTALL) -o $(install_uid) -g $(install_gid) -m 0444 $(srcdir)/sudo.$(mantype) $(mandirsu)/sudo.$(mansectsu)
$(INSTALL) -o $(install_uid) -g $(install_gid) -m 0444 $(srcdir)/visudo.$(mantype) $(mandir8)/visudo.$(mansect8) $(INSTALL) -o $(install_uid) -g $(install_gid) -m 0444 $(srcdir)/visudo.$(mantype) $(mandirsu)/visudo.$(mansectsu)
$(INSTALL) -o $(install_uid) -g $(install_gid) -m 0444 $(srcdir)/sudoers.$(mantype) $(mandir5)/sudoers.$(mansect5) $(INSTALL) -o $(install_uid) -g $(install_gid) -m 0444 $(srcdir)/sudoers.$(mantype) $(mandirform)/sudoers.$(mansectform)
@MAN_POSTINSTALL@ @MAN_POSTINSTALL@
check: check:
@@ -305,7 +305,7 @@ TAGS: $(SRCS)
etags $(SRCS) etags $(SRCS)
clean: clean:
-rm -f *.o $(PROGS) testsudoers core sudo.core visudo.core \ -rm -f *.o $(PROGS) *.man testsudoers core sudo.core visudo.core \
testsudoers.core testsudoers.core
mostlyclean: clean mostlyclean: clean

7
aclocal.m4 vendored
View File

@@ -139,14 +139,15 @@ AC_DEFUN(SUDO_TIMEDIR, [AC_MSG_CHECKING(for timestamp file location)
if test -n "$with_timedir"; then if test -n "$with_timedir"; then
AC_MSG_RESULT($with_timedir) AC_MSG_RESULT($with_timedir)
AC_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir") AC_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir")
TIMEDIR="$with_timedir"
elif test -d "/var/run"; then elif test -d "/var/run"; then
AC_MSG_RESULT(/var/run/sudo) AC_MSG_RESULT(/var/run/sudo)
AC_DEFINE(_PATH_SUDO_TIMEDIR, "/var/run/sudo") AC_DEFINE(_PATH_SUDO_TIMEDIR, "/var/run/sudo")
elif test -d "/tmp"; then TIMEDIR="/var/run/sudo"
else
AC_MSG_RESULT(/tmp/.odus) AC_MSG_RESULT(/tmp/.odus)
AC_DEFINE(_PATH_SUDO_TIMEDIR, "/tmp/.odus") AC_DEFINE(_PATH_SUDO_TIMEDIR, "/tmp/.odus")
else TIMEDIR="/tmp/.odus"
AC_MSG_RESULT(unknown, you will have to set _PATH_SUDO_TIMEDIR by hand)
fi fi
])dnl ])dnl

786
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -30,7 +30,10 @@ AC_SUBST(MAN_POSTINSTALL)dnl
AC_SUBST(SUDOERS_MODE)dnl AC_SUBST(SUDOERS_MODE)dnl
AC_SUBST(SUDOERS_UID)dnl AC_SUBST(SUDOERS_UID)dnl
AC_SUBST(SUDOERS_GID)dnl AC_SUBST(SUDOERS_GID)dnl
AC_SUBST(TIMEDIR)
AC_SUBST(DEV) AC_SUBST(DEV)
AC_SUBST(mansectsu)
AC_SUBST(mansectform)
dnl dnl
dnl Initial values for Makefile variables listed above dnl Initial values for Makefile variables listed above
dnl Some may be overridden by environment variables.. dnl Some may be overridden by environment variables..
@@ -1023,6 +1026,8 @@ case "$host" in
if test "$with_AFS" = "yes"; then if test "$with_AFS" = "yes"; then
AFS_LIBS="-lc -lucb" AFS_LIBS="-lc -lucb"
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-*-aix*) *-*-aix*)
# To get all prototypes (so we pass -Wall) # To get all prototypes (so we pass -Wall)
@@ -1035,6 +1040,8 @@ case "$host" in
AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"; SECUREWARE=1], AC_CHECK_LIB(security, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [SUDO_LIBS="${SUDO_LIBS} -lsecurity"; LIBS="${LIBS} -lsecurity"; SECUREWARE=1])) AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"; SECUREWARE=1], AC_CHECK_LIB(security, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [SUDO_LIBS="${SUDO_LIBS} -lsecurity"; LIBS="${LIBS} -lsecurity"; SECUREWARE=1]))
CHECKSHADOW="false" CHECKSHADOW="false"
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-*-hpux1[[0-9]]*) *-*-hpux1[[0-9]]*)
# uncomment this for a statically linked sudo # uncomment this for a statically linked sudo
@@ -1070,6 +1077,8 @@ case "$host" in
if test "$with_AFS" = "yes"; then if test "$with_AFS" = "yes"; then
AFS_LIBS="-lc -lBSD" AFS_LIBS="-lc -lBSD"
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-*-hpux9*) *-*-hpux9*)
# uncomment this for a statically linked sudo # uncomment this for a statically linked sudo
@@ -1115,6 +1124,8 @@ case "$host" in
if test "$with_AFS" = "yes"; then if test "$with_AFS" = "yes"; then
AFS_LIBS="-lc -lBSD" AFS_LIBS="-lc -lBSD"
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-*-hpux*) *-*-hpux*)
@@ -1131,6 +1142,8 @@ case "$host" in
if test "$with_AFS" = "yes"; then if test "$with_AFS" = "yes"; then
AFS_LIBS="-lc -lBSD" AFS_LIBS="-lc -lBSD"
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-dec-osf*) *-dec-osf*)
# ignore envariables wrt dynamic lib path # ignore envariables wrt dynamic lib path
@@ -1213,6 +1226,8 @@ case "$host" in
if test "$OSREV" -le 4; then if test "$OSREV" -le 4; then
AC_CHECK_LIB(sun, getpwnam, [LIBS="${LIBS} -lsun"]) AC_CHECK_LIB(sun, getpwnam, [LIBS="${LIBS} -lsun"])
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-*-linux*) *-*-linux*)
# To get crypt(3) and vasprintf() prototypes (so we pass -Wall) # To get crypt(3) and vasprintf() prototypes (so we pass -Wall)
@@ -1246,6 +1261,8 @@ case "$host" in
LIBS="${LIBS} -lsun -lbsd" LIBS="${LIBS} -lsun -lbsd"
CPPFLAGS="${CPPFLAGS} -I/usr/include -I/usr/include/bsd" CPPFLAGS="${CPPFLAGS} -I/usr/include -I/usr/include/bsd"
OSDEFS="${OSDEFS} -D_MIPS" OSDEFS="${OSDEFS} -D_MIPS"
mansectsu=1m
mansectform=4
;; ;;
*-*-isc*) *-*-isc*)
OSDEFS="${OSDEFS} -D_ISC" OSDEFS="${OSDEFS} -D_ISC"
@@ -1257,6 +1274,8 @@ case "$host" in
AC_CHECK_LIB(sec, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"]) AC_CHECK_LIB(sec, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"])
CHECKSHADOW="false" CHECKSHADOW="false"
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-*-sco*) *-*-sco*)
if test "$CHECKSHADOW" = "true"; then if test "$CHECKSHADOW" = "true"; then
@@ -1264,16 +1283,22 @@ case "$host" in
AC_CHECK_LIB(gen, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lgen"; LIBS="${LIBS} -lgen"]) AC_CHECK_LIB(gen, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lgen"; LIBS="${LIBS} -lgen"])
CHECKSHADOW="false" CHECKSHADOW="false"
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-sequent-sysv*) *-sequent-sysv*)
if test "$CHECKSHADOW" = "true"; then if test "$CHECKSHADOW" = "true"; then
AC_CHECK_LIB(sec, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"]) AC_CHECK_LIB(sec, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"])
CHECKSHADOW="false" CHECKSHADOW="false"
fi fi
mansectsu=1m
mansectform=4
;; ;;
*-ccur-sysv4|*-ccur-sysvr4) *-ccur-sysv4|*-ccur-sysvr4)
LIBS="${LIBS} -lgen" LIBS="${LIBS} -lgen"
SUDO_LIBS="${SUDO_LIBS} -lgen" SUDO_LIBS="${SUDO_LIBS} -lgen"
mansectsu=1m
mansectform=4
;; ;;
*-*-bsdi*) *-*-bsdi*)
# Use shlicc for BSD/OS 2.x unless asked to do otherwise # Use shlicc for BSD/OS 2.x unless asked to do otherwise
@@ -1283,19 +1308,35 @@ case "$host" in
ac_cv_prog_CC=shlicc ac_cv_prog_CC=shlicc
CC="$ac_cv_prog_CC" CC="$ac_cv_prog_CC"
fi fi
if test "$CHECKSHADOW" = "true"; then
CHECKSHADOW="false"
fi
;; ;;
*-*-freebsd*) *-*-freebsd*)
if test "$with_skey" = "yes"; then if test "$with_skey" = "yes"; then
SUDO_LIBS="${SUDO_LIBS} -lmd" SUDO_LIBS="${SUDO_LIBS} -lmd"
fi fi
if test "$CHECKSHADOW" = "true"; then
CHECKSHADOW="false"
fi
;; ;;
*-*-*bsd*) *-*-*bsd*)
if test "$CHECKSHADOW" = "true"; then if test "$CHECKSHADOW" = "true"; then
CHECKSHADOW="false" CHECKSHADOW="false"
fi fi
;; ;;
*-*-sysv*)
mansectsu=1m
mansectform=4
;;
esac esac
dnl
dnl Use BSD-style man sections by default
dnl
test -n "$mansectsu" || mansectsu=8
test -n "$mansectform" || mansectform=5
dnl dnl
dnl Check for shadow password routines if we have not already done so. dnl Check for shadow password routines if we have not already done so.
dnl We check for SVR4-style first and then SecureWare-style. dnl We check for SVR4-style first and then SecureWare-style.
@@ -1655,9 +1696,9 @@ dnl
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
dnl dnl
dnl Substitute into the Makefiles dnl Substitute into the Makefile and man pages
dnl dnl
AC_OUTPUT(Makefile) AC_OUTPUT([Makefile sudo.man visudo.man sudoers.man])
dnl dnl
dnl Spew any text the user needs to know about dnl Spew any text the user needs to know about

134
sudo.cat
View File

@@ -9,7 +9,8 @@ NNNNAAAAMMMMEEEE
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
ssssuuuuddddoooo ----VVVV | ----hhhh | ----llll | ----LLLL | ----vvvv | ----kkkk | ----KKKK | ----ssss | [ ----HHHH ] [----SSSS ] ssssuuuuddddoooo ----VVVV | ----hhhh | ----llll | ----LLLL | ----vvvv | ----kkkk | ----KKKK | ----ssss | [ ----HHHH ] [----SSSS ]
[ ----bbbb ] | [ ----pppp prompt ] [ ----uuuu username/#uid ] _c_o_m_m_a_n_d [ ----bbbb ] | [ ----pppp prompt ] [ ----cccc class|- ] [ ----uuuu username/#uid ]
_c_o_m_m_a_n_d
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
ssssuuuuddddoooo allows a permitted user to execute a _c_o_m_m_a_n_d as the ssssuuuuddddoooo allows a permitted user to execute a _c_o_m_m_a_n_d as the
@@ -60,8 +61,7 @@ OOOOPPPPTTTTIIIIOOOONNNNSSSS
22/Mar/2000 1.6.3 1
26/Feb/2000 1.6.3 1
@@ -102,7 +102,21 @@ sudo(8) MAINTENANCE COMMANDS sudo(8)
replaced with the user's login name. Similarly, %h replaced with the user's login name. Similarly, %h
will be replaced with the local hostname. will be replaced with the local hostname.
-u The -u (_u_s_e_r) option causes sudo to run the specified -c The -c (_c_l_a_s_s) option causes ssssuuuuddddoooo to run the specified
command with resources limited by the specified login
class. The _c_l_a_s_s argument can be either a class name
as defined in /etc/login.conf, or a single '-'
character. Specifying the _c_l_a_s_s as '-' means that the
command should be run restricted by the default login
capibilities of the user the command is run as. If
the _c_l_a_s_s argument specifies an existing user class,
the command must be run as root, or the ssssuuuuddddoooo command
must be run from a shell that is already root. This
option is only available on systems with BSD login
classes where ssssuuuuddddoooo has been configured with the
--with-logincap option.
-u The -u (_u_s_e_r) option causes ssssuuuuddddoooo to run the specified
command as a user other than _r_o_o_t. To specify a _u_i_d command as a user other than _r_o_o_t. To specify a _u_i_d
instead of a _u_s_e_r_n_a_m_e, use "#uid". instead of a _u_s_e_r_n_a_m_e, use "#uid".
@@ -110,6 +124,18 @@ sudo(8) MAINTENANCE COMMANDS sudo(8)
_S_H_E_L_L environment variable if it is set or the shell _S_H_E_L_L environment variable if it is set or the shell
as specified in _p_a_s_s_w_d(5). as specified in _p_a_s_s_w_d(5).
22/Mar/2000 1.6.3 2
sudo(8) MAINTENANCE COMMANDS sudo(8)
-H The -H (_H_O_M_E) option sets the _H_O_M_E environment -H The -H (_H_O_M_E) option sets the _H_O_M_E environment
variable to the homedir of the target user (root by variable to the homedir of the target user (root by
default) as specified in _p_a_s_s_w_d(5). By default, ssssuuuuddddoooo default) as specified in _p_a_s_s_w_d(5). By default, ssssuuuuddddoooo
@@ -124,18 +150,6 @@ sudo(8) MAINTENANCE COMMANDS sudo(8)
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
ssssuuuuddddoooo quits with an exit value of 1 if there is a ssssuuuuddddoooo quits with an exit value of 1 if there is a
26/Feb/2000 1.6.3 2
sudo(8) MAINTENANCE COMMANDS sudo(8)
configuration/permission problem or if ssssuuuuddddoooo cannot execute configuration/permission problem or if ssssuuuuddddoooo cannot execute
the given command. In the latter case the error string is the given command. In the latter case the error string is
printed to stderr. If ssssuuuuddddoooo cannot _s_t_a_t(2) one or more printed to stderr. If ssssuuuuddddoooo cannot _s_t_a_t(2) one or more
@@ -173,27 +187,13 @@ SSSSEEEECCCCUUUURRRRIIIITTTTYYYY NNNNOOOOTTTTE
statically. statically.
ssssuuuuddddoooo will check the ownership of its timestamp directory ssssuuuuddddoooo will check the ownership of its timestamp directory
(_/_v_a_r_/_r_u_n_/_s_u_d_o or _/_t_m_p_/_._o_d_u_s by default) and ignore the (_/_v_a_r_/_r_u_n_/_s_u_d_o by default) and ignore the directory's
directory's contents if it is not owned by root and only contents if it is not owned by root and only writable by
writable by root. On systems that allow non-root users to root. On systems that allow non-root users to give away
give away files via _c_h_o_w_n(2), if the timestamp directory
is located in a directory writable by anyone (ie: _/_t_m_p),
it is possible for a user to create the timestamp
directory before ssssuuuuddddoooo is run. However, because ssssuuuuddddoooo
checks the ownership and mode of the directory and its
contents, the only damage that can be done is to "hide"
files by putting them in the timestamp dir. This is
unlikely to happen since once the timestamp dir is owned
by root and inaccessible by any other user the user
placing files there would be unable to get them back out.
To get around this issue you can use a directory that is
not world-writable for the timestamps (_/_v_a_r_/_a_d_m_/_s_u_d_o for
instance) or create /tmp/.odus with the appropriate owner
(root) and permissions (0700) in the system startup files.
26/Feb/2000 1.6.3 3 22/Mar/2000 1.6.3 3
@@ -202,6 +202,21 @@ SSSSEEEECCCCUUUURRRRIIIITTTTYYYY NNNNOOOOTTTTE
sudo(8) MAINTENANCE COMMANDS sudo(8) sudo(8) MAINTENANCE COMMANDS sudo(8)
files via _c_h_o_w_n(2), if the timestamp directory is located
in a directory writable by anyone (eg: _/_t_m_p), it is
possible for a user to create the timestamp directory
before ssssuuuuddddoooo is run. However, because ssssuuuuddddoooo checks the
ownership and mode of the directory and its contents, the
only damage that can be done is to "hide" files by putting
them in the timestamp dir. This is unlikely to happen
since once the timestamp dir is owned by root and
inaccessible by any other user the user placing files
there would be unable to get them back out. To get around
this issue you can use a directory that is not world-
writable for the timestamps (_/_v_a_r_/_a_d_m_/_s_u_d_o for instance)
or create _/_v_a_r_/_r_u_n_/_s_u_d_o with the appropriate owner (root)
and permissions (0700) in the system startup files.
ssssuuuuddddoooo will not honor timestamps set far in the future. ssssuuuuddddoooo will not honor timestamps set far in the future.
Timestamps with a date greater than current_time + 2 * Timestamps with a date greater than current_time + 2 *
TIMEOUT will be ignored and sudo will log and complain. TIMEOUT will be ignored and sudo will log and complain.
@@ -241,25 +256,10 @@ EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
ssssuuuuddddoooo utilizes the following environment variables: ssssuuuuddddoooo 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
is specified)
HOME In -s or -H mode (or if sudo was configured with
the --enable-shell-sets-home option), set to
homedir of the target user.
SUDO_PROMPT Used as the default password prompt
SUDO_COMMAND Set to the command run by sudo
SUDO_USER Set to the login of the user who invoked sudo
SUDO_UID Set to the uid of the user who invoked sudo
SUDO_GID Set to the gid of the user who invoked sudo
SUDO_PS1 If set, PS1 will be set to its value
22/Mar/2000 1.6.3 4
26/Feb/2000 1.6.3 4
@@ -268,12 +268,6 @@ EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
sudo(8) MAINTENANCE COMMANDS sudo(8) sudo(8) MAINTENANCE COMMANDS sudo(8)
FFFFIIIILLLLEEEESSSS
/etc/sudoers List of who can run what
/var/run/sudo Directory containing timestamps
ssssuuuuddddoooo utilizes the following environment variables:
PATH Set to a sane value if SECURE_PATH is set PATH Set to a sane value if SECURE_PATH is set
SHELL Used to determine shell to run with -s option SHELL Used to determine shell to run with -s option
USER Set to the target user (root unless the -u option USER Set to the target user (root unless the -u option
@@ -292,7 +286,6 @@ FFFFIIIILLLLEEEESSSS
FFFFIIIILLLLEEEESSSS FFFFIIIILLLLEEEESSSS
/etc/sudoers List of who can run what /etc/sudoers List of who can run what
/var/run/sudo Directory containing timestamps /var/run/sudo Directory containing timestamps
/tmp/.odus Same as above if no /var/run exists
AAAAUUUUTTTTHHHHOOOORRRRSSSS AAAAUUUUTTTTHHHHOOOORRRRSSSS
@@ -322,10 +315,17 @@ CCCCAAAAVVVVEEEEAAAATTTTSSSS
escapes. escapes.
If users have sudo ALL there is nothing to prevent them If users have sudo ALL there is nothing to prevent them
from creating their own program that gives them a root
shell regardless of any '!' elements in the user
specification.
Running shell scripts via ssssuuuuddddoooo can expose the same kernel
bugs that make setuid shell scripts unsafe on some
operating systems (if your OS supports the /dev/fd/
26/Feb/2000 1.6.3 5 22/Mar/2000 1.6.3 5
@@ -334,17 +334,10 @@ CCCCAAAAVVVVEEEEAAAATTTTSSSS
sudo(8) MAINTENANCE COMMANDS sudo(8) sudo(8) MAINTENANCE COMMANDS sudo(8)
from creating their own program that gives them a root
shell regardless of any '!' elements in the user
specification.
Running shell scripts via ssssuuuuddddoooo 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). directory, setuid shell scripts are generally safe).
SSSSEEEEEEEE AAAALLLLSSSSOOOO SSSSEEEEEEEE AAAALLLLSSSSOOOO
_s_u_d_o_e_r_s(5), _v_i_s_u_d_o(8), _s_u(1). _l_o_g_i_n___c_a_p(3), _s_u_d_o_e_r_s(5), _v_i_s_u_d_o(8), _s_u(1).
@@ -391,6 +384,13 @@ SSSSEEEEEEEE AAAALLLLSSSSOOOO
26/Feb/2000 1.6.3 6
22/Mar/2000 1.6.3 6

View File

@@ -2,8 +2,12 @@
''' $RCSfile$$Revision$$Date$ ''' $RCSfile$$Revision$$Date$
''' '''
''' $Log$ ''' $Log$
''' Revision 1.1 2000/03/23 00:17:29 millert ''' Revision 1.2 2000/03/23 00:35:58 millert
''' configure does substitution on these to produce *.man ''' Add FreeBSD login.conf support (untested on BSD/OS) based on a patch from
''' Michael D. Marchionna.
''' configure now does substitution on the man pages, allowing us to
''' fix up the paths and set the section correctly. Based on an idea
''' from Michael D. Marchionna.
''' '''
''' '''
.de Sh .de Sh
@@ -96,7 +100,7 @@
.nr % 0 .nr % 0
.rr F .rr F
.\} .\}
.TH sudo.pod.in @mansectsu@ "1.6.3" "22/Mar/2000" "MAINTENANCE COMMANDS" .TH sudo @mansectsu@ "1.6.3" "22/Mar/2000" "MAINTENANCE COMMANDS"
.UC .UC
.if n .hy 0 .if n .hy 0
.if n .na .if n .na
@@ -327,22 +331,22 @@ not disable user-defined library search paths for setuid programs
(most do), you should either use a linker option that disables this (most do), you should either use a linker option that disables this
behavior or link \fBsudo\fR statically. behavior or link \fBsudo\fR statically.
.PP .PP
\fBsudo\fR will check the ownership of its timestamp directory (\fI@TIMEDIR@\fR) \fBsudo\fR will check the ownership of its timestamp directory
and ignore the directory's contents if it is not owned by root and (\fI@TIMEDIR@\fR by default) and ignore the directory's contents if
only writable by root. On systems that allow non-root users to it is not owned by root and only writable by root. On systems that
give away files via \fIchown\fR\|(2), if the timestamp directory is located allow non-root users to give away files via \fIchown\fR\|(2), if the timestamp
in a directory writable by anyone (eg: \fI/tmp\fR), it is possible for directory is located in a directory writable by anyone (eg: \fI/tmp\fR),
a user to create the timestamp directory before \fBsudo\fR is run. it is possible for a user to create the timestamp directory before
However, because \fBsudo\fR checks the ownership and mode of the \fBsudo\fR is run. However, because \fBsudo\fR checks the ownership and
directory and its contents, the only damage that can be done is to mode of the directory and its contents, the only damage that can
\*(L"hide\*(R" files by putting them in the timestamp dir. This is unlikely be done is to \*(L"hide\*(R" files by putting them in the timestamp dir.
to happen since once the timestamp dir is owned by root and This is unlikely to happen since once the timestamp dir is owned
inaccessible by any other user the user placing files there would by root and inaccessible by any other user the user placing files
be unable to get them back out. To get around this issue you can there would be unable to get them back out. To get around this
use a directory that is not world-writable for the timestamps issue you can use a directory that is not world-writable for the
(\fI/var/adm/sudo\fR for instance) or create \fI@TIMEDIR@\fR with the timestamps (\fI/var/adm/sudo\fR for instance) or create \fI@TIMEDIR@\fR
appropriate owner (root) and permissions (0700) in the system startup with the appropriate owner (root) and permissions (0700) in the
files. system startup files.
.PP .PP
\fBsudo\fR will not honor timestamps set far in the future. \fBsudo\fR will not honor timestamps set far in the future.
Timestamps with a date greater than current_time + 2 * \f(CWTIMEOUT\fR Timestamps with a date greater than current_time + 2 * \f(CWTIMEOUT\fR
@@ -438,7 +442,7 @@ are generally safe).
\fIlogin_cap\fR\|(3), \fIsudoers\fR\|(5), \fIvisudo\fR\|(8), \fIsu\fR\|(1). \fIlogin_cap\fR\|(3), \fIsudoers\fR\|(5), \fIvisudo\fR\|(8), \fIsu\fR\|(1).
.rn }` '' .rn }` ''
.IX Title "sudo.pod.in @mansectsu@" .IX Title "sudo @mansectsu@"
.IX Name "sudo - execute a command as another user" .IX Name "sudo - execute a command as another user"
.IX Header "NAME" .IX Header "NAME"

View File

@@ -42,7 +42,7 @@ sudo - execute a command as another user
=head1 SYNOPSIS =head1 SYNOPSIS
B<sudo> B<-V> | B<-h> | B<-l> | B<-L> | B<-v> | B<-k> | B<-K> | B<-s> | B<sudo> B<-V> | B<-h> | B<-l> | B<-L> | B<-v> | B<-k> | B<-K> | B<-s> |
[ B<-H> ] [B<-S> ] [ B<-b> ] | [ B<-p> prompt ] [ B<-H> ] [B<-S> ] [ B<-b> ] | [ B<-p> prompt ] [ B<-c> class|- ]
[ B<-u> username/#uid ] I<command> [ B<-u> username/#uid ] I<command>
=head1 DESCRIPTION =head1 DESCRIPTION
@@ -59,7 +59,7 @@ user may then use sudo without a password for a short period of time
(five minutes by default). (five minutes by default).
B<sudo> determines who is an authorized user by consulting the B<sudo> determines who is an authorized user by consulting the
file F</etc/sudoers>. By giving B<sudo> the C<-v> flag a user file F<@sysconfdir@/sudoers>. By giving B<sudo> the C<-v> flag a user
can update the time stamp without running a I<command.> can update the time stamp without running a I<command.>
The password prompt itself will also time out if the user's password is The password prompt itself will also time out if the user's password is
not entered with N minutes (again, this is defined at configure not entered with N minutes (again, this is defined at configure
@@ -137,9 +137,22 @@ contains the C<%u> escape, C<%u> will be replaced with the user's
login name. Similarly, C<%h> will be replaced with the local login name. Similarly, C<%h> will be replaced with the local
hostname. hostname.
=item -c
The C<-c> (I<class>) option causes B<sudo> to run the specified command
with resources limited by the specified login class. The I<class>
argument can be either a class name as defined in /etc/login.conf,
or a single '-' character. Specifying the I<class> as '-' means
that the command should be run restricted by the default login
capibilities of the user the command is run as. If the I<class>
argument specifies an existing user class, the command must be run
as root, or the B<sudo> command must be run from a shell that is already
root. This option is only available on systems with BSD login classes
where B<sudo> has been configured with the --with-logincap option.
=item -u =item -u
The C<-u> (I<user>) option causes sudo to run the specified command The C<-u> (I<user>) option causes B<sudo> to run the specified command
as a user other than I<root>. To specify a I<uid> instead of a as a user other than I<root>. To specify a I<uid> instead of a
I<username>, use "#uid". I<username>, use "#uid".
@@ -205,21 +218,21 @@ not disable user-defined library search paths for setuid programs
behavior or link B<sudo> statically. behavior or link B<sudo> statically.
B<sudo> will check the ownership of its timestamp directory B<sudo> will check the ownership of its timestamp directory
(F</var/run/sudo> or F</tmp/.odus> by default) and ignore the (F<@TIMEDIR@> by default) and ignore the directory's contents if
directory's contents if it is not owned by root and only writable it is not owned by root and only writable by root. On systems that
by root. On systems that allow non-root users to give away files allow non-root users to give away files via chown(2), if the timestamp
via chown(2), if the timestamp directory is located in a directory directory is located in a directory writable by anyone (eg: F</tmp>),
writable by anyone (ie: F</tmp>), it is possible for a user to it is possible for a user to create the timestamp directory before
create the timestamp directory before B<sudo> is run. However, B<sudo> is run. However, because B<sudo> checks the ownership and
because B<sudo> checks the ownership and mode of the directory and mode of the directory and its contents, the only damage that can
its contents, the only damage that can be done is to "hide" files be done is to "hide" files by putting them in the timestamp dir.
by putting them in the timestamp dir. This is unlikely to happen This is unlikely to happen since once the timestamp dir is owned
since once the timestamp dir is owned by root and inaccessible by by root and inaccessible by any other user the user placing files
any other user the user placing files there would be unable to get there would be unable to get them back out. To get around this
them back out. To get around this issue you can use a directory issue you can use a directory that is not world-writable for the
that is not world-writable for the timestamps (F</var/adm/sudo> for timestamps (F</var/adm/sudo> for instance) or create F<@TIMEDIR@>
instance) or create /tmp/.odus with the appropriate owner (root) with the appropriate owner (root) and permissions (0700) in the
and permissions (0700) in the system startup files. system startup files.
B<sudo> will not honor timestamps set far in the future. B<sudo> will not honor timestamps set far in the future.
Timestamps with a date greater than current_time + 2 * C<TIMEOUT> Timestamps with a date greater than current_time + 2 * C<TIMEOUT>
@@ -274,30 +287,8 @@ B<sudo> utilizes the following environment variables:
=head1 FILES =head1 FILES
/etc/sudoers List of who can run what @sysconfdir@/sudoers List of who can run what
/var/run/sudo Directory containing timestamps @TIMEDIR@ Directory containing timestamps
B<sudo> 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
is specified)
HOME In -s or -H mode (or if sudo was configured with
the --enable-shell-sets-home option), set to
homedir of the target user.
SUDO_PROMPT Used as the default password prompt
SUDO_COMMAND Set to the command run by sudo
SUDO_USER Set to the login of the user who invoked sudo
SUDO_UID Set to the uid of the user who invoked sudo
SUDO_GID Set to the gid of the user who invoked sudo
SUDO_PS1 If set, PS1 will be set to its value
=head1 FILES
/etc/sudoers List of who can run what
/var/run/sudo Directory containing timestamps
/tmp/.odus Same as above if no /var/run exists
=head1 AUTHORS =head1 AUTHORS
@@ -338,4 +329,4 @@ are generally safe).
=head1 SEE ALSO =head1 SEE ALSO
sudoers(5), visudo(8), su(1). login_cap(3), sudoers(5), visudo(8), su(1).

View File

@@ -61,7 +61,7 @@ DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
18/Feb/2000 1.6.3 1 22/Mar/2000 1.6.3 1
@@ -127,7 +127,7 @@ sudoers(5) FILE FORMATS sudoers(5)
18/Feb/2000 1.6.3 2 22/Mar/2000 1.6.3 2
@@ -193,7 +193,7 @@ sudoers(5) FILE FORMATS sudoers(5)
18/Feb/2000 1.6.3 3 22/Mar/2000 1.6.3 3
@@ -259,7 +259,7 @@ sudoers(5) FILE FORMATS sudoers(5)
18/Feb/2000 1.6.3 4 22/Mar/2000 1.6.3 4
@@ -325,7 +325,7 @@ sudoers(5) FILE FORMATS sudoers(5)
18/Feb/2000 1.6.3 5 22/Mar/2000 1.6.3 5
@@ -391,7 +391,7 @@ sudoers(5) FILE FORMATS sudoers(5)
18/Feb/2000 1.6.3 6 22/Mar/2000 1.6.3 6
@@ -405,6 +405,12 @@ sudoers(5) FILE FORMATS sudoers(5)
root) instead of the password of the invoking root) instead of the password of the invoking
user. user.
use_loginclass
If set, sudo will apply the defaults specified
for the target user's login class if one
exists. Only available if sudo is configured
with the --with-logincap option.
IIIInnnntttteeeeggggeeeerrrrssss: IIIInnnntttteeeeggggeeeerrrrssss:
passwd_tries passwd_tries
@@ -448,16 +454,10 @@ sudoers(5) FILE FORMATS sudoers(5)
incorrect password. The default is "Sorry, incorrect password. The default is "Sorry,
try again." unless insults are enabled. try again." unless insults are enabled.
timestampdir
The directory in which ssssuuuuddddoooo stores its
timestamp files. The default is either
/var/run/sudo or /tmp/sudo.
22/Mar/2000 1.6.3 7
18/Feb/2000 1.6.3 7
@@ -466,6 +466,10 @@ sudoers(5) FILE FORMATS sudoers(5)
sudoers(5) FILE FORMATS sudoers(5) sudoers(5) FILE FORMATS sudoers(5)
timestampdir
The directory in which ssssuuuuddddoooo stores its
timestamp files. The default is _@_T_I_M_E_D_I_R_@.
passprompt The default prompt to use when asking for a passprompt The default prompt to use when asking for a
password; can be overridden via the -p option password; can be overridden via the -p option
or the SUDO_PROMPT environment variable. or the SUDO_PROMPT environment variable.
@@ -492,6 +496,10 @@ sudoers(5) FILE FORMATS sudoers(5)
SSSSttttrrrriiiinnnnggggssss tttthhhhaaaatttt ccccaaaannnn bbbbeeee uuuusssseeeedddd iiiinnnn aaaa bbbboooooooolllleeeeaaaannnn ccccoooonnnntttteeeexxxxtttt: SSSSttttrrrriiiinnnnggggssss tttthhhhaaaatttt ccccaaaannnn bbbbeeee uuuusssseeeedddd iiiinnnn aaaa bbbboooooooolllleeeeaaaannnn ccccoooonnnntttteeeexxxxtttt:
logfile Path to the sudo log file (not the syslog log
file). Setting a path turns on logging to a
file, negating this option turns it off.
syslog Syslog facility if syslog is being used for syslog Syslog facility if syslog is being used for
logging (negate to disable syslog logging). logging (negate to disable syslog logging).
Defaults to "local2". Defaults to "local2".
@@ -511,6 +519,19 @@ sudoers(5) FILE FORMATS sudoers(5)
and PATH requirements. This is not set by and PATH requirements. This is not set by
default. default.
22/Mar/2000 1.6.3 8
sudoers(5) FILE FORMATS sudoers(5)
secure_path Path used for every command run from ssssuuuuddddoooo. If secure_path Path used for every command run from ssssuuuuddddoooo. If
you don't trust the people running sudo to you don't trust the people running sudo to
have a sane PATH environment variable you may have a sane PATH environment variable you may
@@ -520,18 +541,6 @@ sudoers(5) FILE FORMATS sudoers(5)
verifypw This option controls when a password will be verifypw This option controls when a password will be
required when a user runs sudo with the ----vvvv. required when a user runs sudo with the ----vvvv.
18/Feb/2000 1.6.3 8
sudoers(5) FILE FORMATS sudoers(5)
It has the following possible values: It has the following possible values:
all All the user's I<sudoers> entries for the all All the user's I<sudoers> entries for the
@@ -577,6 +586,18 @@ sudoers(5) FILE FORMATS sudoers(5)
Parameter): aaaauuuutttthhhhpppprrrriiiivvvv (if your OS supports it), aaaauuuutttthhhh, Parameter): aaaauuuutttthhhhpppprrrriiiivvvv (if your OS supports it), aaaauuuutttthhhh,
ddddaaaaeeeemmmmoooonnnn, uuuusssseeeerrrr, llllooooccccaaaallll0000, llllooooccccaaaallll1111, llllooooccccaaaallll2222, llllooooccccaaaallll3333, llllooooccccaaaallll4444, ddddaaaaeeeemmmmoooonnnn, uuuusssseeeerrrr, llllooooccccaaaallll0000, llllooooccccaaaallll1111, llllooooccccaaaallll2222, llllooooccccaaaallll3333, llllooooccccaaaallll4444,
llllooooccccaaaallll5555, llllooooccccaaaallll6666, and llllooooccccaaaallll7777. The following syslog llllooooccccaaaallll5555, llllooooccccaaaallll6666, and llllooooccccaaaallll7777. The following syslog
22/Mar/2000 1.6.3 9
sudoers(5) FILE FORMATS sudoers(5)
priorities are supported: aaaalllleeeerrrrtttt, ccccrrrriiiitttt, ddddeeeebbbbuuuugggg, eeeemmmmeeeerrrrgggg, eeeerrrrrrrr, priorities are supported: aaaalllleeeerrrrtttt, ccccrrrriiiitttt, ddddeeeebbbbuuuugggg, eeeemmmmeeeerrrrgggg, eeeerrrrrrrr,
iiiinnnnffffoooo, nnnnoooottttiiiicccceeee, and wwwwaaaarrrrnnnniiiinnnngggg. iiiinnnnffffoooo, nnnnoooottttiiiicccceeee, and wwwwaaaarrrrnnnniiiinnnngggg.
@@ -586,18 +607,6 @@ sudoers(5) FILE FORMATS sudoers(5)
User_Spec ::= User_list Host_List '=' User_List Cmnd_Spec_List \ User_Spec ::= User_list Host_List '=' User_List Cmnd_Spec_List \
(':' User_Spec)* (':' User_Spec)*
18/Feb/2000 1.6.3 9
sudoers(5) FILE FORMATS sudoers(5)
Cmnd_Spec_List ::= Cmnd_Spec | Cmnd_Spec_List ::= Cmnd_Spec |
Cmnd_Spec ',' Cmnd_Spec_List Cmnd_Spec ',' Cmnd_Spec_List
@@ -643,6 +652,18 @@ sudoers(5) FILE FORMATS sudoers(5)
modified via the NOPASSWD tag. Like a Runas_Spec, the modified via the NOPASSWD tag. Like a Runas_Spec, the
NOPASSWD tag sets a default for the commands that follow NOPASSWD tag sets a default for the commands that follow
it in the Cmnd_Spec_List. Conversely, the PASSWD tag can it in the Cmnd_Spec_List. Conversely, the PASSWD tag can
22/Mar/2000 1.6.3 10
sudoers(5) FILE FORMATS sudoers(5)
be used to reverse things. For example: be used to reverse things. For example:
ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm
@@ -653,17 +674,6 @@ sudoers(5) FILE FORMATS sudoers(5)
able to run _/_b_i_n_/_k_i_l_l without a password the entry would able to run _/_b_i_n_/_k_i_l_l without a password the entry would
be: be:
18/Feb/2000 1.6.3 10
sudoers(5) FILE FORMATS sudoers(5)
ray rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm ray rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm
Note however, that the PASSWD tag has no effect on users Note however, that the PASSWD tag has no effect on users
@@ -705,6 +715,21 @@ sudoers(5) FILE FORMATS sudoers(5)
match /usr/bin/who but not /usr/bin/X11/xterm. match /usr/bin/who but not /usr/bin/X11/xterm.
22/Mar/2000 1.6.3 11
sudoers(5) FILE FORMATS sudoers(5)
EEEExxxxcccceeeeppppttttiiiioooonnnnssss ttttoooo wwwwiiiillllddddccccaaaarrrrdddd rrrruuuulllleeeessss:::: EEEExxxxcccceeeeppppttttiiiioooonnnnssss ttttoooo wwwwiiiillllddddccccaaaarrrrdddd rrrruuuulllleeeessss::::
The following exceptions apply to the above rules: The following exceptions apply to the above rules:
@@ -718,18 +743,6 @@ sudoers(5) FILE FORMATS sudoers(5)
The pound sign ('#') is used to indicate a comment (unless The pound sign ('#') is used to indicate a comment (unless
it occurs in the context of a user name and is followed by it occurs in the context of a user name and is followed by
18/Feb/2000 1.6.3 11
sudoers(5) FILE FORMATS sudoers(5)
one or more digits, in which case it is treated as a uid). one or more digits, in which case it is treated as a uid).
Both the comment character and any text after it, up to Both the comment character and any text after it, up to
the end of the line, are ignored. the end of the line, are ignored.
@@ -770,6 +783,19 @@ EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
User_Alias PARTTIMERS = bostley, jwfox, crawl User_Alias PARTTIMERS = bostley, jwfox, crawl
User_Alias WEBMASTERS = will, wendy, wim User_Alias WEBMASTERS = will, wendy, wim
22/Mar/2000 1.6.3 12
sudoers(5) FILE FORMATS sudoers(5)
# Runas alias specification # Runas alias specification
Runas_Alias OP = root, operator Runas_Alias OP = root, operator
Runas_Alias DB = oracle, sybase Runas_Alias DB = oracle, sybase
@@ -784,18 +810,6 @@ EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
Host_Alias SERVERS = master, mail, www, ns Host_Alias SERVERS = master, mail, www, ns
Host_Alias CDROM = orion, perseus, hercules Host_Alias CDROM = orion, perseus, hercules
18/Feb/2000 1.6.3 12
sudoers(5) FILE FORMATS sudoers(5)
# Cmnd alias specification # Cmnd alias specification
Cmnd_Alias DUMPS = /usr/bin/mt, /usr/sbin/dump, /usr/sbin/rdump,\ Cmnd_Alias DUMPS = /usr/bin/mt, /usr/sbin/dump, /usr/sbin/rdump,\
/usr/sbin/restore, /usr/sbin/rrestore /usr/sbin/restore, /usr/sbin/rrestore
@@ -836,6 +850,18 @@ sudoers(5) FILE FORMATS sudoers(5)
FULLTIMERS ALL = NOPASSWD: ALL FULLTIMERS ALL = NOPASSWD: ALL
Full time sysadmins (mmmmiiiilllllllleeeerrrrtttt, mmmmiiiikkkkeeeeffff, and ddddoooowwwwddddyyyy) may run Full time sysadmins (mmmmiiiilllllllleeeerrrrtttt, mmmmiiiikkkkeeeeffff, and ddddoooowwwwddddyyyy) may run
22/Mar/2000 1.6.3 13
sudoers(5) FILE FORMATS sudoers(5)
any command on any host without authenticating themselves. any command on any host without authenticating themselves.
PARTTIMERS ALL = ALL PARTTIMERS ALL = ALL
@@ -850,18 +876,6 @@ sudoers(5) FILE FORMATS sudoers(5)
_C_S_N_E_T_S alias (the networks 128.138.243.0, 128.138.204.0, _C_S_N_E_T_S alias (the networks 128.138.243.0, 128.138.204.0,
and 128.138.242.0). Of those networks, only and 128.138.242.0). Of those networks, only
<128.138.204.0> has an explicit netmask (in CIDR notation) <128.138.204.0> has an explicit netmask (in CIDR notation)
18/Feb/2000 1.6.3 13
sudoers(5) FILE FORMATS sudoers(5)
indicating it is a class C network. For the other indicating it is a class C network. For the other
networks in _C_S_N_E_T_S, the local machine's netmask will be networks in _C_S_N_E_T_S, the local machine's netmask will be
used during matching. used during matching.
@@ -902,6 +916,18 @@ sudoers(5) FILE FORMATS sudoers(5)
netgroup. SSSSuuuuddddoooo knows that "biglab" is a netgroup due to netgroup. SSSSuuuuddddoooo knows that "biglab" is a netgroup due to
the '+' prefix. the '+' prefix.
22/Mar/2000 1.6.3 14
sudoers(5) FILE FORMATS sudoers(5)
+secretaries ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser +secretaries ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser
Users in the sssseeeeccccrrrreeeettttaaaarrrriiiieeeessss netgroup need to help manage the Users in the sssseeeeccccrrrreeeettttaaaarrrriiiieeeessss netgroup need to help manage the
@@ -916,18 +942,6 @@ sudoers(5) FILE FORMATS sudoers(5)
john ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root* john ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*
On the _A_L_P_H_A machines, user jjjjoooohhhhnnnn may su to anyone except On the _A_L_P_H_A machines, user jjjjoooohhhhnnnn may su to anyone except
18/Feb/2000 1.6.3 14
sudoers(5) FILE FORMATS sudoers(5)
root but he is not allowed to give _s_u(1) any flags. root but he is not allowed to give _s_u(1) any flags.
jen ALL, !SERVERS = ALL jen ALL, !SERVERS = ALL
@@ -967,6 +981,19 @@ sudoers(5) FILE FORMATS sudoers(5)
type, so it is a prime candiate for encapsulating in a type, so it is a prime candiate for encapsulating in a
shell script. shell script.
22/Mar/2000 1.6.3 15
sudoers(5) FILE FORMATS sudoers(5)
SSSSEEEECCCCUUUURRRRIIIITTTTYYYY NNNNOOOOTTTTEEEESSSS SSSSEEEECCCCUUUURRRRIIIITTTTYYYY NNNNOOOOTTTTEEEESSSS
It is generally not effective to "subtract" commands from It is generally not effective to "subtract" commands from
ALL using the '!' operator. A user can trivially ALL using the '!' operator. A user can trivially
@@ -982,18 +1009,6 @@ SSSSEEEECCCCUUUURRRRIIIITTTTYYYY NNNNOOOOTTTTE
restrictions should be considered advisory at best (and restrictions should be considered advisory at best (and
reinforced by policy). reinforced by policy).
18/Feb/2000 1.6.3 15
sudoers(5) FILE FORMATS sudoers(5)
CCCCAAAAVVVVEEEEAAAATTTTSSSS CCCCAAAAVVVVEEEEAAAATTTTSSSS
The _s_u_d_o_e_r_s file should aaaallllwwwwaaaayyyyssss be edited by the vvvviiiissssuuuuddddoooo The _s_u_d_o_e_r_s file should aaaallllwwwwaaaayyyyssss be edited by the vvvviiiissssuuuuddddoooo
command which locks the file and does grammatical command which locks the file and does grammatical
@@ -1036,22 +1051,7 @@ SSSSEEEEEEEE AAAALLLLSSSSOOOO
22/Mar/2000 1.6.3 16
18/Feb/2000 1.6.3 16
@@ -1117,6 +1117,6 @@ sudoers(5) FILE FORMATS sudoers(5)
18/Feb/2000 1.6.3 17 22/Mar/2000 1.6.3 17

View File

@@ -2,8 +2,12 @@
''' $RCSfile$$Revision$$Date$ ''' $RCSfile$$Revision$$Date$
''' '''
''' $Log$ ''' $Log$
''' Revision 1.1 2000/03/23 00:17:29 millert ''' Revision 1.2 2000/03/23 00:35:59 millert
''' configure does substitution on these to produce *.man ''' Add FreeBSD login.conf support (untested on BSD/OS) based on a patch from
''' Michael D. Marchionna.
''' configure now does substitution on the man pages, allowing us to
''' fix up the paths and set the section correctly. Based on an idea
''' from Michael D. Marchionna.
''' '''
''' '''
.de Sh .de Sh
@@ -96,7 +100,7 @@
.nr % 0 .nr % 0
.rr F .rr F
.\} .\}
.TH sudoers.pod.in @mansectform@ "1.6.3" "22/Mar/2000" "FILE FORMATS" .TH sudoers @mansectform@ "1.6.3" "22/Mar/2000" "FILE FORMATS"
.UC .UC
.if n .hy 0 .if n .hy 0
.if n .na .if n .na
@@ -970,7 +974,7 @@ as returned by the \f(CWhostname\fR command or use the \fIfqdn\fR option in
\fIsudo\fR\|(8), \fIvisudo\fR\|(8), \fIsu\fR\|(1), \fIfnmatch\fR\|(3). \fIsudo\fR\|(8), \fIvisudo\fR\|(8), \fIsu\fR\|(1), \fIfnmatch\fR\|(3).
.rn }` '' .rn }` ''
.IX Title "sudoers.pod.in @mansectform@" .IX Title "sudoers @mansectform@"
.IX Name "sudoers - list of which users may execute what" .IX Name "sudoers - list of which users may execute what"
.IX Header "NAME" .IX Header "NAME"

View File

@@ -370,6 +370,12 @@ If set, sudo will prompt for the password of the user specified by
the C<-u> flag (defaults to root) instead of the password of the the C<-u> flag (defaults to root) instead of the password of the
invoking user. invoking user.
=item use_loginclass
If set, sudo will apply the defaults specified for the target user's
login class if one exists. Only available if sudo is configured with
the --with-logincap option.
=back =back
B<Integers>: B<Integers>:
@@ -429,7 +435,7 @@ The default is "Sorry, try again." unless insults are enabled.
=item timestampdir =item timestampdir
The directory in which B<sudo> stores its timestamp files. The directory in which B<sudo> stores its timestamp files.
The default is either C</var/run/sudo> or C</tmp/sudo>. The default is F<@TIMEDIR@>.
=item passprompt =item passprompt
@@ -464,6 +470,11 @@ B<Strings that can be used in a boolean context>:
=over 12 =over 12
=item logfile
Path to the sudo log file (not the syslog log file). Setting a path
turns on logging to a file, negating this option turns it off.
=item syslog =item syslog
Syslog facility if syslog is being used for logging (negate to Syslog facility if syslog is being used for logging (negate to
@@ -898,7 +909,7 @@ I<sudoers>.
=head1 FILES =head1 FILES
/etc/sudoers List of who can run what @sysconfdir@/sudoers List of who can run what
/etc/group Local groups file /etc/group Local groups file
/etc/netgroup List of network groups /etc/netgroup List of network groups

View File

@@ -55,13 +55,13 @@ EEEERRRRRRRROOOORRRRSSSS
sudoers file busy, try again later. sudoers file busy, try again later.
Someone else is currently editing the _s_u_d_o_e_r_s file. Someone else is currently editing the _s_u_d_o_e_r_s file.
/etc/sudoers.tmp: Permission denied @sysconf@/sudoers.tmp: Permission denied
You didn't run vvvviiiissssuuuuddddoooo as root. You didn't run vvvviiiissssuuuuddddoooo as root.
15/Feb/2000 1.6.3 1 22/Mar/2000 1.6.3 1
@@ -91,8 +91,8 @@ EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
FFFFIIIILLLLEEEESSSS FFFFIIIILLLLEEEESSSS
/etc/sudoers List of who can run what @sysconf@/sudoers List of who can run what
/etc/sudoers.tmp Lock file for visudo @sysconf@/sudoers.tmp Lock file for visudo
AAAAUUUUTTTTHHHHOOOORRRR AAAAUUUUTTTTHHHHOOOORRRR
@@ -127,7 +127,7 @@ SSSSEEEEEEEE AAAALLLLSSSSOOOO
15/Feb/2000 1.6.3 2 22/Mar/2000 1.6.3 2
@@ -193,6 +193,6 @@ visudo(8) MAINTENANCE COMMANDS visudo(8)
15/Feb/2000 1.6.3 3 22/Mar/2000 1.6.3 3

View File

@@ -2,8 +2,12 @@
''' $RCSfile$$Revision$$Date$ ''' $RCSfile$$Revision$$Date$
''' '''
''' $Log$ ''' $Log$
''' Revision 1.1 2000/03/23 00:17:30 millert ''' Revision 1.2 2000/03/23 00:35:59 millert
''' configure does substitution on these to produce *.man ''' Add FreeBSD login.conf support (untested on BSD/OS) based on a patch from
''' Michael D. Marchionna.
''' configure now does substitution on the man pages, allowing us to
''' fix up the paths and set the section correctly. Based on an idea
''' from Michael D. Marchionna.
''' '''
''' '''
.de Sh .de Sh
@@ -96,7 +100,7 @@
.nr % 0 .nr % 0
.rr F .rr F
.\} .\}
.TH visudo.pod.in @mansectsu@ "1.6.3" "18/Mar/2000" "MAINTENANCE COMMANDS" .TH visudo @mansectsu@ "1.6.3" "22/Mar/2000" "MAINTENANCE COMMANDS"
.UC .UC
.if n .hy 0 .if n .hy 0
.if n .na .if n .na
@@ -280,7 +284,7 @@ the editor used by \fBvisudo\fR allows shell escapes.
\fIsudo\fR\|(8), \fIvipw\fR\|(8). \fIsudo\fR\|(8), \fIvipw\fR\|(8).
.rn }` '' .rn }` ''
.IX Title "visudo.pod.in @mansectsu@" .IX Title "visudo @mansectsu@"
.IX Name "visudo - edit the sudoers file" .IX Name "visudo - edit the sudoers file"
.IX Header "NAME" .IX Header "NAME"

View File

@@ -98,7 +98,7 @@ and exit.
Someone else is currently editing the I<sudoers> file. Someone else is currently editing the I<sudoers> file.
=item /etc/sudoers.tmp: Permission denied =item @sysconf@/sudoers.tmp: Permission denied
You didn't run B<visudo> as root. You didn't run B<visudo> as root.
@@ -127,8 +127,8 @@ was configured with the I<--with-env-editor> option:
=head1 FILES =head1 FILES
/etc/sudoers List of who can run what @sysconf@/sudoers List of who can run what
/etc/sudoers.tmp Lock file for visudo @sysconf@/sudoers.tmp Lock file for visudo
=head1 AUTHOR =head1 AUTHOR