]> granicus.if.org Git - sudo/commitdiff
Add pam_service and pam_login_service sudoers settings to control
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 6 Aug 2013 17:01:36 +0000 (11:01 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 6 Aug 2013 17:01:36 +0000 (11:01 -0600)
the service name passed to pam_start.

configure
configure.in
doc/sudoers.cat
doc/sudoers.man.in
doc/sudoers.mdoc.in
plugins/sudoers/auth/pam.c
plugins/sudoers/def_data.c
plugins/sudoers/def_data.h
plugins/sudoers/def_data.in
plugins/sudoers/defaults.c

index b72443b69580c1a4fd9306b76024e9774ad5b651..501c2dae0508dfbd89e9fa3558704802d956b7ed 100755 (executable)
--- a/configure
+++ b/configure
@@ -659,6 +659,7 @@ EXEEXT
 ac_ct_CC
 CC
 PLUGINDIR
+pam_login_service
 pam_session
 editor
 secure_path
@@ -2927,6 +2928,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;}
 
 
 
+
 
 
 #
@@ -2970,6 +2972,7 @@ sesh_file=/usr/local/libexec/sudo/sesh
 nsswitch_conf=/etc/nsswitch.conf
 secure_path="not set"
 pam_session=on
+pam_login_service=sudo
 PLUGINDIR=/usr/local/libexec/sudo
 #
 # End initial values for man page substitution
@@ -18914,6 +18917,7 @@ if test "${with_pam_login+set}" = set; then :
 $as_echo_n "checking whether to use PAM login... " >&6; }
                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+                       pam_login_service="sudo-i"
                        ;;
            no)         ;;
            *)          as_fn_error $? "\"--with-pam-login does not take an argument.\"" "$LINENO" 5
index 6d66bd984fadf0b3f36e574820d634668acba58a..da9252226132c5ef3f5d36a8af9b4683a4e9c581 100644 (file)
@@ -122,6 +122,7 @@ AC_SUBST([netsvc_conf])
 AC_SUBST([secure_path])
 AC_SUBST([editor])
 AC_SUBST([pam_session])
+AC_SUBST([pam_login_service])
 AC_SUBST([PLUGINDIR])
 #
 # Begin initial values for man page substitution
@@ -164,6 +165,7 @@ sesh_file=/usr/local/libexec/sudo/sesh
 nsswitch_conf=/etc/nsswitch.conf
 secure_path="not set"
 pam_session=on
+pam_login_service=sudo
 PLUGINDIR=/usr/local/libexec/sudo
 #
 # End initial values for man page substitution
@@ -2753,6 +2755,7 @@ if test ${with_pam-"no"} != "no"; then
            yes)        AC_DEFINE([HAVE_PAM_LOGIN])
                        AC_MSG_CHECKING(whether to use PAM login)
                        AC_MSG_RESULT(yes)
+                       pam_login_service="sudo-i"
                        ;;
            no)         ;;
            *)          AC_MSG_ERROR(["--with-pam-login does not take an argument."])
index 5d9c2729013d44d710dafe545d21f4d0b97600b4..ae05c51f684ce1f09818dc7cb876c9e55fdc3104 100644 (file)
@@ -1375,6 +1375,18 @@ S\bSU\bUD\bDO\bOE\bER\bRS\bS O\bOP\bPT\bTI\bIO\bON\bNS\bS
                        supported.  The path to the noexec file should now be
                        set in the sudo.conf(4) file.
 
+     pam_login_service
+                       On systems that use PAM for authentication, this is the
+                       service name used when the -\b-i\bi option is specified.  The
+                       default value is ``sudo''.  See the description of
+                       _\bp_\ba_\bm_\b__\bs_\be_\br_\bv_\bi_\bc_\be for more information.
+
+     pam_service       On systems that use PAM for authentication, the service
+                       name specifies the PAM policy to apply.  This usually
+                       corresponds to an entry in the _\bp_\ba_\bm_\b._\bc_\bo_\bn_\bf file or a file
+                       in the _\b/_\be_\bt_\bc_\b/_\bp_\ba_\bm_\b._\bd directory.  The default value is
+                       ``sudo''.
+
      passprompt        The default prompt to use when asking for a password;
                        can be overridden via the -\b-p\bp option or the SUDO_PROMPT
                        environment variable.  The following percent (`%')
@@ -2236,4 +2248,4 @@ D\bDI\bIS\bSC\bCL\bLA\bAI\bIM\bME\bER\bR
      file distributed with s\bsu\bud\bdo\bo or http://www.sudo.ws/sudo/license.html for
      complete details.
 
-Sudo 1.8.8                       July 16, 2013                      Sudo 1.8.8
+Sudo 1.8.8                      August 6, 2013                      Sudo 1.8.8
index 75fb98478ced24676632bc842295b7310fa9c40e..74bcef69815cae360c51f4dd50205b7ef238c6ca 100644 (file)
@@ -21,7 +21,7 @@
 .\" Agency (DARPA) and Air Force Research Laboratory, Air Force
 .\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
 .\"
-.TH "SUDOERS" "@mansectsu@" "July 16, 2013" "Sudo @PACKAGE_VERSION@" "Programmer's Manual"
+.TH "SUDOERS" "@mansectsu@" "August 6, 2013" "Sudo @PACKAGE_VERSION@" "Programmer's Manual"
 .nh
 .if n .ad l
 .SH "NAME"
@@ -330,7 +330,7 @@ The list of environment variables that
 \fBsudo\fR
 allows or denies is
 contained in the output of
-\(lq\fRsudo -V\fR\(rq
+``\fRsudo -V\fR''
 when run as root.
 .PP
 Note that the dynamic linker on most operating systems will remove
@@ -431,7 +431,7 @@ EBNF also contains the following
 operators, which many readers will recognize from regular
 expressions.
 Do not, however, confuse them with
-\(lqwildcard\(rq
+``wildcard''
 characters, which have different meanings.
 .TP 6n
 \fR\&?\fR
@@ -500,7 +500,7 @@ A
 \fRNAME\fR
 is a string of uppercase letters, numbers,
 and underscore characters
-(\(oq_\(cq).
+(`_').
 A
 \fRNAME\fR
 \fBmust\fR
@@ -508,7 +508,7 @@ start with an
 uppercase letter.
 It is possible to put several alias definitions
 of the same type on a single line, joined by a colon
-(\(oq:\&\(cq).
+(`:\&').
 E.g.,
 .nf
 .sp
@@ -541,24 +541,24 @@ A
 \fRUser_List\fR
 is made up of one or more user names, user IDs
 (prefixed with
-\(oq#\(cq),
+`#'),
 system group names and IDs (prefixed with
-\(oq%\(cq
+`%'
 and
-\(oq%#\(cq
+`%#'
 respectively), netgroups (prefixed with
-\(oq+\(cq),
+`+'),
 non-Unix group names and IDs (prefixed with
-\(oq%:\(cq
+`%:'
 and
-\(oq%:#\(cq
+`%:#'
 respectively) and
 \fRUser_Alias\fRes.
 Each list item may be prefixed with zero or more
-\(oq\&!\(cq
+`\&!'
 operators.
 An odd number of
-\(oq\&!\(cq
+`\&!'
 operators negate the value of
 the item; an even number just cancel each other out.
 .PP
@@ -602,7 +602,7 @@ for more information.
 .PP
 Note that quotes around group names are optional.
 Unquoted strings must use a backslash
-(\(oq\e\(cq)
+(`\e')
 to escape spaces and special characters.
 See
 \fIOther special characters and reserved words\fR
@@ -658,10 +658,10 @@ A
 \fRHost_List\fR
 is made up of one or more host names, IP addresses,
 network numbers, netgroups (prefixed with
-\(oq+\(cq)
+`+')
 and other aliases.
 Again, the value of an item may be negated with the
-\(oq\&!\(cq
+`\&!'
 operator.
 If you do not specify a netmask along with the network number,
 \fBsudo\fR
@@ -686,7 +686,7 @@ Note that
 only inspects actual network interfaces; this means that IP address
 127.0.0.1 (localhost) will never match.
 Also, the host name
-\(lqlocalhost\(rq
+``localhost''
 will only match if that is the actual host name, which is usually
 only the case for non-networked systems.
 .nf
@@ -733,7 +733,7 @@ may only be run
 command line arguments.
 A directory is a
 fully qualified path name ending in a
-\(oq/\(cq.
+`/'.
 When you specify a directory in a
 \fRCmnd_List\fR,
 the user will be able to run any file within that directory
@@ -747,14 +747,14 @@ in the
 must match exactly those given by the user on the command line
 (or match the wildcards if there are any).
 Note that the following characters must be escaped with a
-\(oq\e\(cq
+`\e'
 if they are used in command arguments:
-\(oq,\&\(cq,
-\(oq:\&\(cq,
-\(oq=\&\(cq,
-\(oq\e\(cq.
+`,\&',
+`:\&',
+`=\&',
+`\e'.
 The built-in command
-\(lq\fRsudoedit\fR\(rq
+``\fRsudoedit\fR''
 is used to permit a user to run
 \fBsudo\fR
 with the
@@ -763,7 +763,7 @@ option (or as
 \fBsudoedit\fR).
 It may take command line arguments just as a normal command does.
 Note that
-\(lq\fRsudoedit\fR\(rq
+``\fRsudoedit\fR''
 is a command built into
 \fBsudo\fR
 itself and must be specified in
@@ -845,7 +845,7 @@ values,
 or
 \fBlists\fR.
 Flags are implicitly boolean and can be turned off via the
-\(oq\&!\(cq
+`\&!'
 operator.
 Some integer, string and list parameters may also be
 used in a boolean context to disable them.
@@ -854,7 +854,7 @@ in double quotes
 (\&"")
 when they contain multiple words.
 Special characters may be escaped with a backslash
-(\(oq\e\(cq).
+(`\e').
 .PP
 Lists have two additional assignment operators,
 \fR+=\fR
@@ -906,7 +906,7 @@ run as
 but this can be changed on a per-command basis.
 .PP
 The basic structure of a user specification is
-\(lqwho where = (as_whom) what\(rq.
+``who where = (as_whom) what''.
 Let's break that down into its constituent parts:
 .SS "Runas_Spec"
 A
@@ -918,7 +918,7 @@ A fully-specified
 consists of two
 \fRRunas_List\fRs
 (as defined above) separated by a colon
-(\(oq:\&\(cq)
+(`:\&')
 and enclosed in a set of parentheses.
 The first
 \fRRunas_List\fR
@@ -1118,7 +1118,7 @@ $ ppriv -l
 .fi
 .PP
 In addition, there are several
-\(lqspecial\(rq
+``special''
 privilege strings:
 .TP 10n
 none
@@ -1135,9 +1135,9 @@ the default set of privileges normal users are granted at login time
 .PP
 Privileges can be excluded from a set by prefixing the privilege
 name with either an
-\(oq\&!\(cq
+`\&!'
 or
-\(oq\-\(cq
+`\-'
 character.
 .SS "Tag_Spec"
 A command may have zero or more tags associated with it.
@@ -1189,13 +1189,13 @@ Conversely, the
 \fRPASSWD\fR
 tag can be used to reverse things.
 For example:
+.RS
 .nf
 .sp
-.RS 2n
+.RS 0n
 ray    rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm
 .RE
 .fi
-.RS 2n
 .sp
 would allow the user
 \fBray\fR
@@ -1215,7 +1215,7 @@ run
 without a password the entry would be:
 .nf
 .sp
-.RS 2n
+.RS 0n
 ray    rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm
 .RE
 .fi
@@ -1230,10 +1230,10 @@ By default, if the
 \fRNOPASSWD\fR
 tag is applied to any of the entries for a user on the current host,
 he or she will be able to run
-\(lq\fRsudo -l\fR\(rq
+``\fRsudo -l\fR''
 without a password.
 Additionally, a user may only run
-\(lq\fRsudo -v\fR\(rq
+``\fRsudo -v\fR''
 without a password if the
 \fRNOPASSWD\fR
 tag is present for all a user's entries that pertain to the current host.
@@ -1242,7 +1242,9 @@ This behavior may be overridden via the
 and
 \fIlistpw\fR
 options.
+.PP
 .RE
+.PD 0
 .TP 2n
 \fINOEXEC\fR and \fIEXEC\fR
 .sp
@@ -1262,20 +1264,23 @@ may run
 and
 \fI/usr/bin/vi\fR
 but shell escapes will be disabled.
+.RS
 .nf
 .sp
-.RS 2n
+.RS 0n
 aaron  shanty = NOEXEC: /usr/bin/more, /usr/bin/vi
 .RE
 .fi
-.RS 2n
 .sp
 See the
 \fIPreventing shell escapes\fR
 section below for more details on how
 \fRNOEXEC\fR
 works and whether or not it will work on your system.
+.PD
+.PP
 .RE
+.PD 0
 .TP 2n
 \fISETENV\fR and \fINOSETENV\fR
 .sp
@@ -1303,6 +1308,7 @@ the
 tag is implied for that command; this default may be overridden by use of the
 \fRNOSETENV\fR
 tag.
+.PD
 .TP 2n
 \fILOG_INPUT\fR and \fINOLOG_INPUT\fR
 .sp
@@ -1359,15 +1365,15 @@ in the specified range.
 .TP 10n
 \fR\ex\fR
 For any character
-\(oqx\(cq,
+`x',
 evaluates to
-\(oqx\(cq.
+`x'.
 This is used to escape special characters such as:
-\(oq*\(cq,
-\(oq\&?\(cq,
-\(oq[\&\(cq,
+`*',
+`\&?',
+`[\&',
 and
-\(oq]\&\(cq.
+`]\&'.
 .PP
 Character classes may also be used if your system's
 glob(3)
@@ -1375,7 +1381,7 @@ and
 fnmatch(3)
 functions support them.
 However, because the
-\(oq:\&\(cq
+`:\&'
 character has special meaning in
 \fIsudoers\fR,
 it must be
@@ -1391,7 +1397,7 @@ For example:
 Would match any file name beginning with a letter.
 .PP
 Note that a forward slash
-(\(oq/\(cq)
+(`/')
 will
 \fBnot\fR
 be matched by
@@ -1417,9 +1423,9 @@ arbitrary strings and not just path names.
 Wildcards in command line arguments should be used with care.
 Because command line arguments are matched as a single, concatenated
 string, a wildcard such as
-\(oq\&?\(cq
+`\&?'
 or
-\(oq*\(cq
+`*'
 can match multiple words.
 For example, while a sudoers entry like:
 .nf
@@ -1462,7 +1468,7 @@ sudoedit
 Command line arguments to the
 \fIsudoedit\fR
 built-in command should always be path names, so a forward slash
-(\(oq/\(cq)
+(`/')
 will not be matched by a wildcard.
 .SS "Including other files from within sudoers"
 It is possible to include other
@@ -1515,7 +1521,7 @@ file loops.
 .PP
 If the path to the include file is not fully-qualified (does not
 begin with a
-\(oq/\(cq,
+`/',
 it must be located in the same directory as the sudoers file it was
 included from.
 For example, if
@@ -1535,7 +1541,7 @@ The file name may also include the
 \fR%h\fR
 escape, signifying the short form of the host name.
 In other words, if the machine's host name is
-\(lqxerxes\(rq,
+``xerxes'',
 then
 .nf
 .sp
@@ -1569,9 +1575,9 @@ For example, given:
 will read each file in
 \fI/etc/sudoers.d\fR,
 skipping file names that end in
-\(oq~\(cq
+`~'
 or contain a
-\(oq.\&\(cq
+`.\&'
 character to avoid causing problems with package manager or editor
 temporary/backup files.
 Files are parsed in sorted lexical order.
@@ -1600,7 +1606,7 @@ with the
 flag to edit the files directly.
 .SS "Other special characters and reserved words"
 The pound sign
-(\(oq#\(cq)
+(`#')
 is used to indicate a comment (unless it is part of a #include
 directive or unless it occurs in the context of a user name and is
 followed by one or more digits, in which case it is treated as a
@@ -1631,7 +1637,7 @@ can be dangerous since in a command context, it allows the user to run
 command on the system.
 .PP
 An exclamation point
-(\(oq\&!\(cq)
+(`\&!')
 can be used as a logical
 \fInot\fR
 operator in a list or
@@ -1640,7 +1646,7 @@ as well as in front of a
 \fRCmnd\fR.
 This allows one to exclude certain values.
 For the
-\(oq\&!\(cq
+`\&!'
 operator to be effective, there must be something for it to exclude.
 For example, to match all users except for root one would use:
 .nf
@@ -1662,42 +1668,42 @@ is omitted, as in:
 .PP
 it would explicitly deny root but not match any other users.
 This is different from a true
-\(lqnegation\(rq
+``negation''
 operator.
 .PP
 Note, however, that using a
-\(oq\&!\(cq
+`\&!'
 in conjunction with the built-in
 \fBALL\fR
 alias to allow a user to run
-\(lqall but a few\(rq
+``all but a few''
 commands rarely works as intended (see
 \fISECURITY NOTES\fR
 below).
 .PP
 Long lines can be continued with a backslash
-(\(oq\e\(cq)
+(`\e')
 as the last character on the line.
 .PP
 White space between elements in a list as well as special syntactic
 characters in a
 \fIUser Specification\fR
-(\(oq=\&\(cq,
-\(oq:\&\(cq,
-\(oq(\&\(cq,
-\(oq)\&\(cq)
+(`=\&',
+`:\&',
+`(\&',
+`)\&')
 is optional.
 .PP
 The following characters must be escaped with a backslash
-(\(oq\e\(cq)
+(`\e')
 when used as part of a word (e.g.\& a user name or host name):
-\(oq\&!\(cq,
-\(oq=\&\(cq,
-\(oq:\&\(cq,
-\(oq,\&\(cq,
-\(oq(\&\(cq,
-\(oq)\&\(cq,
-\(oq\e\(cq.
+`\&!',
+`=\&',
+`:\&',
+`,\&',
+`(\&',
+`)\&',
+`\e'.
 .SH "SUDOERS OPTIONS"
 \fBsudo\fR's
 behavior can be modified by
@@ -1925,7 +1931,7 @@ or
 \fI../bin/ls\fR.
 This has security implications when path names that include globbing
 characters are used with the negation operator,
-\(oq!\&\(cq,
+`!\&',
 as such rules can be trivially bypassed.
 As such, this option should not be used when
 \fIsudoers\fR
@@ -1944,7 +1950,7 @@ command) does not contain the domain name.
 In other words, instead of myhost you would use myhost.mydomain.edu.
 You may still use the short form if you wish (and even mix the two).
 This option is only effective when the
-\(lqcanonical\(rq
+``canonical''
 host name, as returned by the
 \fBgetaddrinfo\fR()
 or
@@ -1956,7 +1962,7 @@ for host name resolution.
 If the system is configured to use the
 \fI/etc/hosts\fR
 file in preference to DNS, the
-\(lqcanonical\(rq
+``canonical''
 host name may not be fully-qualified.
 The order that sources are queried for hosts name resolution
 is usually specified in the
@@ -1969,19 +1975,18 @@ file.
 In the
 \fI/etc/hosts\fR
 file, the first host name of the entry is considered to be the
-\(lqcanonical\(rq
+``canonical''
 name; subsequent names are aliases that are not used by
 \fBsudoers\fR.
 For example, the following hosts file line for the machine
-\(lqxyzzy\(rq
+``xyzzy''
 has the fully-qualified domain name as the
-\(lqcanonical\(rq
+``canonical''
 host name, and the short version as an alias.
 .sp
-.RS 24n
+.RS 6n
 192.168.1.1    xyzzy.sudo.ws xyzzy
 .RE
-.RS 18n
 .sp
 If the machine's hosts file entry is not formatted properly, the
 \fIfqdn\fR
@@ -1996,7 +2001,7 @@ to make DNS lookups which renders
 unusable if DNS stops working (for example if the machine is disconnected
 from the network).
 Also note that just like with the hosts file, you must use the
-\(lqcanonical\(rq
+``canonical''
 name as DNS knows it.
 That is, you may not use a host alias
 (\fRCNAME\fR
@@ -2007,7 +2012,6 @@ aliases from DNS.
 This flag is
 \fI@fqdn@\fR
 by default.
-.RE
 .TP 18n
 ignore_dot
 If set,
@@ -2076,7 +2080,7 @@ by default)
 using a unique session ID that is included in the normal
 \fBsudo\fR
 log line, prefixed with
-\(lq\fRTSID=\fR\(rq.
+``\fRTSID=\fR''.
 The
 \fIiolog_file\fR
 option may be used to control the format of the session ID.
@@ -2109,7 +2113,7 @@ by default)
 using a unique session ID that is included in the normal
 \fBsudo\fR
 log line, prefixed with
-\(lq\fRTSID=\fR\(rq.
+``\fRTSID=\fR''.
 The
 \fIiolog_file\fR
 option may be used to control the format of the session ID.
@@ -2236,7 +2240,7 @@ The password prompt specified by
 \fIpassprompt\fR
 will normally only be used if the password prompt provided by systems
 such as PAM matches the string
-\(lqPassword:\(rq.
+``Password:''.
 If
 \fIpassprompt_override\fR
 is set,
@@ -2314,10 +2318,10 @@ If set, root is allowed to run
 \fBsudo\fR
 too.
 Disabling this prevents users from
-\(lqchaining\(rq
+``chaining''
 \fBsudo\fR
 commands to get a root shell by doing something like
-\(lq\fRsudo sudo /bin/sh\fR\(rq.
+``\fRsudo sudo /bin/sh\fR''.
 Note, however, that turning off
 \fIroot_sudo\fR
 will also prevent root from running
@@ -2576,7 +2580,7 @@ flag is set,
 \fBsudo\fR
 will prompt for a password even when it would be visible on the screen.
 This makes it possible to run things like
-\(lq\fRssh somehost sudo ls\fR\(rq
+``\fRssh somehost sudo ls\fR''
 since by default,
 ssh(1)
 does
@@ -2646,9 +2650,9 @@ If set to a value less than
 \fR0\fR
 the user's time stamp will never expire.
 This can be used to allow users to create or delete their own time stamps via
-\(lq\fRsudo -v\fR\(rq
+``\fRsudo -v\fR''
 and
-\(lq\fRsudo -k\fR\(rq
+``\fRsudo -k\fR''
 respectively.
 .TP 18n
 umask
@@ -2677,7 +2681,7 @@ unless insults are enabled.
 .TP 18n
 editor
 A colon
-(\(oq:\&\(cq)
+(`:\&')
 separated list of editors allowed to be used with
 \fBvisudo\fR.
 \fBvisudo\fR
@@ -2705,17 +2709,14 @@ The default is
 \fI@iolog_dir@\fR.
 .sp
 The following percent
-(\(oq%\(cq)
+(`%')
 escape sequences are supported:
-.PP
-.RS 18n
-.PD 0
+.RS
 .TP 6n
 \fR%{seq}\fR
 expanded to a monotonically increasing base-36 sequence number, such as 0100A5,
 where every two digits are used to form a new directory, e.g.\&
 \fI01/00/A5\fR
-.PD
 .TP 6n
 \fR%{user}\fR
 expanded to the invoking user's login name
@@ -2742,11 +2743,13 @@ strftime(3)
 function will be expanded.
 .sp
 To include a literal
-\(oq%\(cq
+`%'
 character, the string
-\(oq%%\(cq
+`%%'
 should be used.
+.PP
 .RE
+.PD 0
 .TP 18n
 iolog_file
 The path name, relative to
@@ -2764,12 +2767,12 @@ Note that
 \fIiolog_file\fR
 may contain directory components.
 The default is
-\(lq\fR%{seq}\fR\(rq.
+``\fR%{seq}\fR''.
 .sp
 See the
 \fIiolog_dir\fR
 option above for a list of supported percent
-(\(oq%\(cq)
+(`%')
 escape sequences.
 .sp
 In addition to the escape sequences, path names that end in six or
@@ -2791,6 +2794,7 @@ overwritten unless
 ends in six or
 more
 \fRX\fRs.
+.PD
 .TP 18n
 limitprivs
 The default Solaris limit privileges to use when constructing a new
@@ -2810,29 +2814,29 @@ The escape
 \fR%h\fR
 will expand to the host name of the machine.
 Default is
-\(lq\fR@mailsub@\fR\(rq.
+``\fR@mailsub@\fR''.
 .TP 18n
 maxseq
 The maximum sequence number that will be substituted for the
-\(lq\fR%{seq}\fR\(rq
+``\fR%{seq}\fR''
 escape in the I/O log file (see the
 \fIiolog_dir\fR
 description above for more information).
 While the value substituted for
-\(lq\fR%{seq}\fR\(rq
+``\fR%{seq}\fR''
 is in base 36,
 \fImaxseq\fR
 itself should be expressed in decimal.
 Values larger than 2176782336 (which corresponds to the
 base 36 sequence number
-\(lqZZZZZZ\(rq)
+``ZZZZZZ'')
 will be silently truncated to 2176782336.
 The default value is 2176782336.
 .sp
 Once the local sequence number reaches the value of
 \fImaxseq\fR,
 it will
-\(lqroll over\(rq
+``roll over''
 to zero, after which
 \fBsudoers\fR
 will truncate and re-use any existing I/O log pathnames.
@@ -2847,6 +2851,29 @@ The path to the noexec file should now be set in the
 sudo.conf(@mansectform@)
 file.
 .TP 18n
+pam_login_service
+.br
+On systems that use PAM for authentication, this is the service
+name used when the
+\fB\-i\fR
+option is specified.
+The default value is
+``\fR@pam_login_service@\fR''.
+See the description of
+\fIpam_service\fR
+for more information.
+.TP 18n
+pam_service
+On systems that use PAM for authentication, the service name
+specifies the PAM policy to apply.
+This usually corresponds to an entry in the
+\fIpam.conf\fR
+file or a file in the
+\fI/etc/pam.d\fR
+directory.
+The default value is
+``\fRsudo\fR''.
+.TP 18n
 passprompt
 The default prompt to use when asking for a password; can be overridden via the
 \fB\-p\fR
@@ -2854,18 +2881,15 @@ option or the
 \fRSUDO_PROMPT\fR
 environment variable.
 The following percent
-(\(oq%\(cq)
+(`%')
 escape sequences are supported:
-.PP
-.RS 18n
-.PD 0
+.RS
 .TP 6n
 \fR%H\fR
 expanded to the local host name including the domain name
 (only if the machine's host name is fully qualified or the
 \fIfqdn\fR
 option is set)
-.PD
 .TP 6n
 \fR%h\fR
 expanded to the local host name without the domain name
@@ -2894,8 +2918,10 @@ characters are collapsed into a single
 character
 .PP
 The default value is
-\(lq\fR@passprompt@\fR\(rq.
+``\fR@passprompt@\fR''.
+.PP
 .RE
+.PD 0
 .TP 18n
 privs
 The default Solaris privileges to use when constructing a new
@@ -2913,6 +2939,7 @@ The default privileges may be overridden on a per-command basis in
 This option is only available if
 \fBsudoers\fR
 is built on Solaris 10 or higher.
+.PD
 .TP 18n
 role
 The default SELinux role to use when constructing a new security
@@ -2961,7 +2988,7 @@ Locale to use when parsing the sudoers file, logging commands, and
 sending email.
 Note that changing the locale may affect how sudoers is interpreted.
 Defaults to
-\(lq\fRC\fR\(rq.
+``\fRC\fR''.
 .TP 18n
 timestampdir
 The directory in which
@@ -2993,9 +3020,9 @@ The
 option specifies the fully qualified path to a file containing variables
 to be set in the environment of the program being run.
 Entries in this file should either be of the form
-\(lq\fRVARIABLE=value\fR\(rq
+``\fRVARIABLE=value\fR''
 or
-\(lq\fRexport VARIABLE=value\fR\(rq.
+``\fRexport VARIABLE=value\fR''.
 The value may optionally be surrounded by single or double quotes.
 Variables in this file are subject to other
 \fBsudo\fR
@@ -3030,13 +3057,10 @@ lecture
 This option controls when a short lecture will be printed along with
 the password prompt.
 It has the following possible values:
-.PP
-.RS 14n
-.PD 0
+.RS
 .TP 8n
 always
 Always lecture the user.
-.PD
 .TP 8n
 never
 Never lecture the user.
@@ -3053,7 +3077,9 @@ Negating the option results in a value of
 being used.
 The default value is
 \fI@lecture@\fR.
+.PP
 .RE
+.PD 0
 .TP 14n
 lecture_file
 Path to a file containing an alternate
@@ -3063,6 +3089,7 @@ file exists.
 By default,
 \fBsudo\fR
 uses a built-in lecture.
+.PD
 .TP 14n
 listpw
 This option controls when a password will be required when a user runs
@@ -3071,9 +3098,7 @@ with the
 \fB\-l\fR
 option.
 It has the following possible values:
-.PP
-.RS 14n
-.PD 0
+.RS
 .TP 10n
 all
 All the user's
@@ -3082,7 +3107,6 @@ entries for the current host must have
 the
 \fRNOPASSWD\fR
 flag set to avoid entering a password.
-.PD
 .TP 10n
 always
 The user must always enter a password to use the
@@ -3110,7 +3134,9 @@ Negating the option results in a value of
 being used.
 The default value is
 \fIany\fR.
+.PP
 .RE
+.PD 0
 .TP 14n
 logfile
 Path to the
@@ -3121,6 +3147,7 @@ negating this option turns it off.
 By default,
 \fBsudo\fR
 logs via syslog.
+.PD
 .TP 14n
 mailerflags
 Flags to use when invoking mailer. Defaults to
@@ -3132,7 +3159,7 @@ Defaults to the path to sendmail found at configure time.
 .TP 14n
 mailfrom
 Address to use for the
-\(lqfrom\(rq
+``from''
 address when sending warning and error mail.
 The address should be enclosed in double quotes
 (\&"")
@@ -3166,9 +3193,9 @@ to have a sane
 \fRPATH\fR
 environment variable you may want to use this.
 Another use is if you want to have the
-\(lqroot path\(rq
+``root path''
 be separate from the
-\(lquser path\(rq.
+``user path''.
 Users in the group specified by the
 \fIexempt_group\fR
 option are not affected by
@@ -3205,9 +3232,7 @@ with the
 \fB\-v\fR
 option.
 It has the following possible values:
-.PP
-.RS 14n
-.PD 0
+.RS
 .TP 8n
 all
 All the user's
@@ -3215,7 +3240,6 @@ All the user's
 entries for the current host must have the
 \fRNOPASSWD\fR
 flag set to avoid entering a password.
-.PD
 .TP 8n
 always
 The user must always enter a password to use the
@@ -3249,9 +3273,9 @@ The default value is
 env_check
 Environment variables to be removed from the user's environment if
 the variable's value contains
-\(oq%\(cq
+`%'
 or
-\(oq/\(cq
+`/'
 characters.
 This can be used to guard against printf-style format vulnerabilities
 in poorly-written programs.
@@ -3356,12 +3380,16 @@ The path to the group file should be specified as an option
 to the plugin.
 For example, if the group file to be used is
 \fI/etc/sudo-group\fR:
+.RS
 .nf
 .sp
-.RS 10n
+.RS 0n
 Defaults group_plugin="group_file.so /etc/sudo-group"
 .RE
 .fi
+.PP
+.RE
+.PD 0
 .TP 10n
 system_group
 The
@@ -3373,12 +3401,15 @@ and
 This plugin can be used in instances where the user belongs to
 groups not present in the user's supplemental group vector.
 This plugin takes no options:
+.RS
 .nf
 .sp
-.RS 10n
+.RS 0n
 Defaults group_plugin=system_group.so
 .RE
 .fi
+.RE
+.PD
 .PP
 The group provider plugin API is described in detail in
 sudo_plugin(@mansectsu@).
@@ -3405,7 +3436,7 @@ Where the fields are as follows:
 date
 The date the command was run.
 Typically, this is in the format
-\(lqMMM, DD, HH:MM:SS\(rq.
+``MMM, DD, HH:MM:SS''.
 If logging via
 syslog(3),
 the actual date format is controlled by the syslog daemon.
@@ -3435,13 +3466,13 @@ The login name of the user who ran
 .TP 14n
 ttyname
 The short name of the terminal (e.g.\&
-\(lqconsole\(rq,
-\(lqtty01\(rq,
+``console'',
+``tty01'',
 or
-\(lqpts/0\(rq)
+``pts/0'')
 \fBsudo\fR
 was run on, or
-\(lqunknown\(rq
+``unknown''
 if there was no terminal present.
 .TP 14n
 cwd
@@ -3473,7 +3504,7 @@ The actual command that was executed.
 Messages are logged using the locale specified by
 \fIsudoers_locale\fR,
 which defaults to the
-\(lq\fRC\fR\(rq
+``\fRC\fR''
 locale.
 .SS "Denied command log entries"
 If the user is not allowed to run the command, the reason for the denial
@@ -3556,9 +3587,9 @@ using group permissions to avoid this problem.
 Consider either changing the ownership of
 \fI@sysconfdir@/sudoers\fR
 or adding an argument like
-\(lqsudoers_uid=N\(rq
+``sudoers_uid=N''
 (where
-\(oqN\(cq
+`N'
 is the user ID that owns the
 \fIsudoers\fR
 file) to the end of the
@@ -3585,9 +3616,9 @@ file has the wrong owner.
 If you wish to change the
 \fIsudoers\fR
 file owner, please add
-\(lqsudoers_uid=N\(rq
+``sudoers_uid=N''
 (where
-\(oqN\(cq
+`N'
 is the user ID that owns the
 \fIsudoers\fR
 file) to the
@@ -3606,7 +3637,7 @@ The
 file must not be world-writable, the default file mode
 is 0440 (readable by owner and group, writable by none).
 The default mode may be changed via the
-\(lqsudoers_mode\(rq
+``sudoers_mode''
 option to the
 \fBsudoers\fR
 \fRPlugin\fR
@@ -3621,9 +3652,9 @@ file has the wrong group ownership.
 If you wish to change the
 \fIsudoers\fR
 file group ownership, please add
-\(lqsudoers_gid=N\(rq
+``sudoers_gid=N''
 (where
-\(oqN\(cq
+`N'
 is the group ID that owns the
 \fIsudoers\fR
 file) to the
@@ -3666,9 +3697,9 @@ To prevent the command line arguments from being truncated,
 \fBsudoers\fR
 will split up log messages that are larger than 960 characters
 (not including the date, hostname, and the string
-\(lqsudo\(rq).
+``sudo'').
 When a message is split, additional parts will include the string
-\(lq(command continued)\(rq
+``(command continued)''
 after the user name and before the continued command line arguments.
 .SS "Notes on logging to a file"
 If the
@@ -3708,7 +3739,7 @@ on the log files.
 If the
 \fIloglinelen\fR
 option is set to 0 (or negated with a
-\(oq\&!\(cq),
+`\&!'),
 word wrap will be disabled.
 .SH "FILES"
 .TP 26n
@@ -4013,9 +4044,9 @@ may run any command on machines in the
 netgroup.
 \fBsudo\fR
 knows that
-\(lqbiglab\(rq
+``biglab''
 is a netgroup due to the
-\(oq+\(cq
+`+'
 prefix.
 .nf
 .sp
@@ -4141,13 +4172,13 @@ Any user may mount or unmount a CD-ROM on the machines in the CDROM
 This is a bit tedious for users to type, so it is a prime candidate
 for encapsulating in a shell script.
 .SH "SECURITY NOTES"
-.SS "Limitations of the \(oq!\&\(cq operator"
+.SS "Limitations of the `!\&' operator"
 It is generally not effective to
-\(lqsubtract\(rq
+``subtract''
 commands from
 \fBALL\fR
 using the
-\(oq!\&\(cq
+`!\&'
 operator.
 A user can trivially circumvent this by copying the desired command
 to a different name and then executing that.
@@ -4174,7 +4205,7 @@ In general, if a user has sudo
 \fBALL\fR
 there is nothing to prevent them from creating their own program that gives
 them a root shell (or making their own copy of a shell) regardless of any
-\(oq!\&\(cq
+`!\&'
 elements in the user specification.
 .SS "Security implications of \fIfast_glob\fR"
 If the
@@ -4278,13 +4309,13 @@ for a command, use the
 tag as documented
 in the User Specification section above.
 Here is that example again:
+.RS
 .nf
 .sp
-.RS 10n
+.RS 0n
 aaron  shanty = NOEXEC: /usr/bin/more, /usr/bin/vi
 .RE
 .fi
-.RS 10n
 .sp
 This allows user
 \fBaaron\fR
@@ -4330,7 +4361,7 @@ However, because
 \fIsudoers\fR
 checks the ownership and mode of the directory and its
 contents, the only damage that can be done is to
-\(lqhide\(rq
+``hide''
 files by putting them in the time stamp dir.
 This is unlikely to happen since once the time stamp dir is owned by root
 and inaccessible by any other user, the user placing files there would be
@@ -4472,6 +4503,7 @@ redblack tree internals
 utility functions
 .PD 0
 .PP
+.PD
 For example:
 .nf
 .sp
@@ -4479,7 +4511,6 @@ For example:
 Debug sudo /var/log/sudo_debug match@info,nss@info
 .RE
 .fi
-.PD
 .PP
 For more information, see the
 sudo.conf(@mansectform@)
@@ -4533,7 +4564,7 @@ search the archives.
 .SH "DISCLAIMER"
 \fBsudo\fR
 is provided
-\(lqAS IS\(rq
+``AS IS''
 and any express or implied warranties, including, but not limited
 to, the implied warranties of merchantability and fitness for a
 particular purpose are disclaimed.
index 90a0eaeb9300652c5ac74c18848814b0df3162e8..ef8db9bb9d425af33302f603d8a135273ada2327 100644 (file)
@@ -19,7 +19,7 @@
 .\" Agency (DARPA) and Air Force Research Laboratory, Air Force
 .\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
 .\"
-.Dd July 16, 2013
+.Dd August 6, 2013
 .Dt SUDOERS @mansectform@
 .Os Sudo @PACKAGE_VERSION@
 .Sh NAME
@@ -2661,6 +2661,26 @@ version 1.8.1 this option is no longer supported.
 The path to the noexec file should now be set in the
 .Xr sudo.conf @mansectform@
 file.
+.It pam_login_service
+On systems that use PAM for authentication, this is the service
+name used when the
+.Fl i
+option is specified.
+The default value is
+.Dq Li @pam_login_service@ .
+See the description of
+.Em pam_service
+for more information.
+.It pam_service
+On systems that use PAM for authentication, the service name
+specifies the PAM policy to apply.
+This usually corresponds to an entry in the
+.Pa pam.conf
+file or a file in the
+.Pa /etc/pam.d
+directory.
+The default value is
+.Dq Li sudo .
 .It passprompt
 The default prompt to use when asking for a password; can be overridden via the
 .Fl p
index 0e263b98a4fdb230ca6e6f7768406dea80a6864f..f10e805ebbd3d905c5b7bd6e303f57cc8c4901fa 100644 (file)
@@ -93,12 +93,8 @@ sudo_pam_init(struct passwd *pw, sudo_auth *auth)
     if (auth != NULL)
        auth->data = (void *) &pam_status;
     pam_conv.conv = converse;
-#ifdef HAVE_PAM_LOGIN
-    if (ISSET(sudo_mode, MODE_LOGIN_SHELL))
-       pam_status = pam_start("sudo-i", pw->pw_name, &pam_conv, &pamh);
-    else
-#endif
-       pam_status = pam_start("sudo", pw->pw_name, &pam_conv, &pamh);
+    pam_status = pam_start(ISSET(sudo_mode, MODE_LOGIN_SHELL) ?
+       def_pam_login_service : def_pam_service, pw->pw_name, &pam_conv, &pamh);
     if (pam_status != PAM_SUCCESS) {
        log_warning(USE_ERRNO|NO_MAIL, N_("unable to initialize PAM"));
        debug_return_int(AUTH_FATAL);
index c4a5dd103809c4e928deae04e9a6e5939dbe8fab..3ba76481cbe5a112680ee40d37d5feff8c4fca2a 100644 (file)
@@ -354,6 +354,14 @@ struct sudo_defs_types sudo_defs_table[] = {
        "exec_background", T_FLAG,
        N_("Run commands on a pty in the background"),
        NULL,
+    }, {
+       "pam_service", T_STR,
+       N_("PAM service name to use"),
+       NULL,
+    }, {
+       "pam_login_service", T_STR,
+       N_("PAM service name to use for login shells"),
+       NULL,
     }, {
        "pam_session", T_FLAG,
        N_("Create a new PAM session for the command to run in"),
index 36fba1b6139dc63a9da8fb977e2f58ad027de6f4..f83bacf6add3ec7552eb75bf3c65f358c2d54a56 100644 (file)
 #define I_LIMITPRIVS            81
 #define def_exec_background     (sudo_defs_table[82].sd_un.flag)
 #define I_EXEC_BACKGROUND       82
-#define def_pam_session         (sudo_defs_table[83].sd_un.flag)
-#define I_PAM_SESSION           83
-#define def_maxseq              (sudo_defs_table[84].sd_un.ival)
-#define I_MAXSEQ                84
+#define def_pam_service         (sudo_defs_table[83].sd_un.str)
+#define I_PAM_SERVICE           83
+#define def_pam_login_service   (sudo_defs_table[84].sd_un.str)
+#define I_PAM_LOGIN_SERVICE     84
+#define def_pam_session         (sudo_defs_table[85].sd_un.flag)
+#define I_PAM_SESSION           85
+#define def_maxseq              (sudo_defs_table[86].sd_un.ival)
+#define I_MAXSEQ                86
 
 enum def_tuple {
        never,
index 9f8ffa088233dd99675c0babd8a6be9a9411e24d..922e39faeb97a217bca2fb6ec4535368fb3e70ad 100644 (file)
@@ -262,6 +262,12 @@ limitprivs
 exec_background
        T_FLAG
        "Run commands on a pty in the background"
+pam_service
+       T_STR
+       "PAM service name to use"
+pam_login_service
+       T_STR
+       "PAM service name to use for login shells"
 pam_session
        T_FLAG
        "Create a new PAM session for the command to run in"
index dfa2327848baa4447e83ec22024bf26962c436ad..f263033b6e184730a18e44341b90523e5ce9a051 100644 (file)
@@ -421,6 +421,12 @@ init_defaults(void)
     def_env_reset = ENV_RESET;
     def_set_logname = true;
     def_closefrom = STDERR_FILENO + 1;
+    def_pam_service = estrdup("sudo");
+#ifdef HAVE_PAM_LOGIN
+    def_pam_login_service = estrdup("sudo-i");
+#else
+    def_pam_login_service = estrdup("sudo");
+#endif
 #ifdef NO_PAM_SESSION
     def_pam_session = false;
 #else