]> granicus.if.org Git - sudo/commitdiff
Document -D level command line flag which maps to the debug_level setting.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 24 Feb 2010 12:48:53 +0000 (07:48 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 24 Feb 2010 12:48:53 +0000 (07:48 -0500)
doc/sudo.cat
doc/sudo.man.in
doc/sudo.pod
doc/sudo_plugin.man.in
doc/sudo_plugin.pod
src/Makefile.in
src/parse_args.c
src/sudo_usage.h.in

index 1b33f2ce2aa7fbe292546d5ca5dd94464805352f..3e8853fe1a06a54c550a77651f89bad242b2c192 100644 (file)
@@ -8,19 +8,19 @@ N\bNA\bAM\bME\bE
        sudo, sudoedit - execute a command as another user
 
 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
-       s\bsu\bud\bdo\bo -\b-h\bh | -\b-K\bK | -\b-k\bk | -\b-L\bL | -\b-V\bV
+       s\bsu\bud\bdo\b[-\b-D\bD _\bl_\be_\bv_\be_\bl] -\b-h\bh | -\b-K\bK | -\b-k\bk | -\b-L\bL | -\b-V\bV
 
-       s\bsu\bud\bdo\bo -\b-v\bv [-\b-A\bAk\bkn\bnS\bS] [-\b-a\ba _\ba_\bu_\bt_\bh_\b__\bt_\by_\bp_\be] [-\b-g\bg _\bg_\br_\bo_\bu_\bp _\bn_\ba_\bm_\be|_\b#_\bg_\bi_\bd] [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt]
-       [-\b-u\bu _\bu_\bs_\be_\br_\bn_\ba_\bm_\be|_\b#_\bu_\bi_\bd]
+       s\bsu\bud\bdo\bo -\b-v\bv [-\b-A\bAk\bkn\bnS\bS] [-\b-a\ba _\ba_\bu_\bt_\bh_\b__\bt_\by_\bp_\be] [-\b-D\bD _\bl_\be_\bv_\be_\bl] [-\b-g\bg _\bg_\br_\bo_\bu_\bp _\bn_\ba_\bm_\be|_\b#_\bg_\bi_\bd]
+       [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt] [-\b-u\bu _\bu_\bs_\be_\br_\bn_\ba_\bm_\be|_\b#_\bu_\bi_\bd]
 
-       s\bsu\bud\bdo\bo -\b-l\bl[\b[l\bl]\b] [-\b-A\bAk\bkn\bnS\bS] [-\b-a\ba _\ba_\bu_\bt_\bh_\b__\bt_\by_\bp_\be] [-\b-g\bg _\bg_\br_\bo_\bu_\bp _\bn_\ba_\bm_\be|_\b#_\bg_\bi_\bd] [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt]
-       [-\b-U\bU _\bu_\bs_\be_\br _\bn_\ba_\bm_\be] [-\b-u\bu _\bu_\bs_\be_\br _\bn_\ba_\bm_\be|_\b#_\bu_\bi_\bd] [_\bc_\bo_\bm_\bm_\ba_\bn_\bd]
+       s\bsu\bud\bdo\bo -\b-l\bl[\b[l\bl]\b] [-\b-A\bAk\bkn\bnS\bS] [-\b-a\ba _\ba_\bu_\bt_\bh_\b__\bt_\by_\bp_\be] [-\b-D\bD _\bl_\be_\bv_\be_\bl] [-\b-g\bg _\bg_\br_\bo_\bu_\bp _\bn_\ba_\bm_\be|_\b#_\bg_\bi_\bd]
+       [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt] [-\b-U\bU _\bu_\bs_\be_\br _\bn_\ba_\bm_\be] [-\b-u\bu _\bu_\bs_\be_\br _\bn_\ba_\bm_\be|_\b#_\bu_\bi_\bd] [_\bc_\bo_\bm_\bm_\ba_\bn_\bd]
 
-       s\bsu\bud\bdo\bo [-\b-A\bAb\bbE\bEH\bHn\bnP\bPS\bS] [-\b-a\ba _\ba_\bu_\bt_\bh_\b__\bt_\by_\bp_\be] [-\b-C\bC _\bf_\bd] [-\b-c\bc _\bc_\bl_\ba_\bs_\bs|_\b-]
+       s\bsu\bud\bdo\bo [-\b-A\bAb\bbE\bEH\bHn\bnP\bPS\bS] [-\b-a\ba _\ba_\bu_\bt_\bh_\b__\bt_\by_\bp_\be] [-\b-C\bC _\bf_\bd] [-\b-D\bD _\bl_\be_\bv_\be_\bl] [-\b-c\bc _\bc_\bl_\ba_\bs_\bs|_\b-]
        [-\b-g\bg _\bg_\br_\bo_\bu_\bp _\bn_\ba_\bm_\be|_\b#_\bg_\bi_\bd] [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt] [-\b-u\bu _\bu_\bs_\be_\br _\bn_\ba_\bm_\be|_\b#_\bu_\bi_\bd] [V\bVA\bAR\bR=_\bv_\ba_\bl_\bu_\be]
        [-\b-i\bi | -\b-s\bs] [_\bc_\bo_\bm_\bm_\ba_\bn_\bd]
 
-       s\bsu\bud\bdo\boe\bed\bdi\bit\bt [-\b-A\bAn\bnS\bS] [-\b-a\ba _\ba_\bu_\bt_\bh_\b__\bt_\by_\bp_\be] [-\b-C\bC _\bf_\bd] [-\b-c\bc _\bc_\bl_\ba_\bs_\bs|_\b-]
+       s\bsu\bud\bdo\boe\bed\bdi\bit\bt [-\b-A\bAn\bnS\bS] [-\b-a\ba _\ba_\bu_\bt_\bh_\b__\bt_\by_\bp_\be] [-\b-C\bC _\bf_\bd] [-\b-c\bc _\bc_\bl_\ba_\bs_\bs|_\b-] [-\b-D\bD _\bl_\be_\bv_\be_\bl]
        [-\b-g\bg _\bg_\br_\bo_\bu_\bp _\bn_\ba_\bm_\be|_\b#_\bg_\bi_\bd] [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt] [-\b-u\bu _\bu_\bs_\be_\br _\bn_\ba_\bm_\be|_\b#_\bu_\bi_\bd] file ...
 
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
@@ -61,7 +61,7 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
 
 
 
-1.7.3b2                 December 19, 2009                       1
+1.8.0a1                 February 24, 2010                       1
 
 
 
@@ -122,12 +122,12 @@ O\bOP\bPT\bTI\bIO\bON\bNS\bS
                    is already root.  This option is only available on systems
                    with BSD login classes.
 
-       -E          The -\b-E\bE (_\bp_\br_\be_\bs_\be_\br_\bv_\be _\be_\bn_\bv_\bi_\br_\bo_\bn_\bm_\be_\bn_\bt) option will override the
-                   _\be_\bn_\bv_\b__\br_\be_\bs_\be_\bt option in _\bs_\bu_\bd_\bo_\be_\br_\bs(4)).  It is only available when
+       -D _\bl_\be_\bv_\be_\bl    Enable debugging of s\bsu\bud\bdo\bo plugins and s\bsu\bud\bdo\bo itself.  The
+                   _\bl_\be_\bv_\be_\bl may be a value from 1 through 9.
 
 
 
-1.7.3b2                 December 19, 2009                       2
+1.8.0a1                 February 24, 2010                       2
 
 
 
@@ -136,6 +136,8 @@ O\bOP\bPT\bTI\bIO\bON\bNS\bS
 SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 
 
+       -E          The -\b-E\bE (_\bp_\br_\be_\bs_\be_\br_\bv_\be _\be_\bn_\bv_\bi_\br_\bo_\bn_\bm_\be_\bn_\bt) option will override the
+                   _\be_\bn_\bv_\b__\br_\be_\bs_\be_\bt option in _\bs_\bu_\bd_\bo_\be_\br_\bs(4)).  It is only available when
                    either the matching command has the SETENV tag or the
                    _\bs_\be_\bt_\be_\bn_\bv option is set in _\bs_\bu_\bd_\bo_\be_\br_\bs(4).
 
@@ -188,12 +190,10 @@ SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
                    The -\b-i\bi (_\bs_\bi_\bm_\bu_\bl_\ba_\bt_\be _\bi_\bn_\bi_\bt_\bi_\ba_\bl _\bl_\bo_\bg_\bi_\bn) option runs the shell
                    specified in the _\bp_\ba_\bs_\bs_\bw_\bd(4) entry of the target user as a
                    login shell.  This means that login-specific resource files
-                   such as .profile or .login will be read by the shell.  If a
-                   command is specified, it is passed to the shell for
 
 
 
-1.7.3b2                 December 19, 2009                       3
+1.8.0a1                 February 24, 2010                       3
 
 
 
@@ -202,6 +202,8 @@ SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 
 
+                   such as .profile or .login will be read by the shell.  If a
+                   command is specified, it is passed to the shell for
                    execution.  Otherwise, an interactive shell is executed.
                    s\bsu\bud\bdo\bo attempts to change to that user's home directory
                    before running the shell.  It also initializes the
@@ -254,12 +256,10 @@ SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
                    preserve the invoking user's group vector unaltered.  By
                    default, s\bsu\bud\bdo\bo will initialize the group vector to the list
                    of groups the target user is in.  The real and effective
-                   group IDs, however, are still set to match the target user.
 
 
 
-
-1.7.3b2                 December 19, 2009                       4
+1.8.0a1                 February 24, 2010                       4
 
 
 
@@ -268,6 +268,8 @@ SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 
 
+                   group IDs, however, are still set to match the target user.
+
        -p _\bp_\br_\bo_\bm_\bp_\bt   The -\b-p\bp (_\bp_\br_\bo_\bm_\bp_\bt) option allows you to override the default
                    password prompt and use a custom one.  The following
                    percent (`%') escapes are supported:
@@ -320,12 +322,10 @@ SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 
        -V          The -\b-V\bV (_\bv_\be_\br_\bs_\bi_\bo_\bn) option causes s\bsu\bud\bdo\bo to print the version
                    number and exit.  If the invoking user is already root the
-                   -\b-V\bV option will print out a list of the defaults s\bsu\bud\bdo\bo was
-                   compiled with as well as the machine's local network
 
 
 
-1.7.3b2                 December 19, 2009                       5
+1.8.0a1                 February 24, 2010                       5
 
 
 
@@ -334,6 +334,8 @@ SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 
 
+                   -\b-V\bV option will print out a list of the defaults s\bsu\bud\bdo\bo was
+                   compiled with as well as the machine's local network
                    addresses.
 
        -v          If given the -\b-v\bv (_\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be) option, s\bsu\bud\bdo\bo will update the
@@ -387,11 +389,9 @@ S\bSE\bEC\bCU\bUR\bRI\bIT\bTY\bY N\bNO\bOT\bTE\bES\bS
        blacklist all potentially dangerous environment variables, use of the
        default _\be_\bn_\bv_\b__\br_\be_\bs_\be_\bt behavior is encouraged.
 
-       In all cases, environment variables with a value beginning with () are
-
 
 
-1.7.3b2                 December 19, 2009                       6
+1.8.0a1                 February 24, 2010                       6
 
 
 
@@ -400,6 +400,7 @@ S\bSE\bEC\bCU\bUR\bRI\bIT\bTY\bY N\bNO\bOT\bTE\bES\bS
 SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 
 
+       In all cases, environment variables with a value beginning with () are
        removed as they could be interpreted as b\bba\bas\bsh\bh functions.  The list of
        environment variables that s\bsu\bud\bdo\bo allows or denies is contained in the
        output of sudo -V when run as root.
@@ -453,11 +454,10 @@ SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
        s\bsu\bud\bdo\bo utilizes the following environment variables:
 
-       EDITOR          Default editor to use in -\b-e\be (sudoedit) mode if neither
 
 
 
-1.7.3b2                 December 19, 2009                       7
+1.8.0a1                 February 24, 2010                       7
 
 
 
@@ -466,6 +466,7 @@ E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
 SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 
 
+       EDITOR          Default editor to use in -\b-e\be (sudoedit) mode if neither
                        SUDO_EDITOR nor VISUAL is set
 
        HOME            In -\b-s\bs or -\b-H\bH mode (or if sudo was configured with the
@@ -522,8 +523,7 @@ E\bEX\bXA\bAM\bMP\bPL\bLE\bES\bS
 
 
 
-
-1.7.3b2                 December 19, 2009                       8
+1.8.0a1                 February 24, 2010                       8
 
 
 
@@ -557,8 +557,7 @@ SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
         $ sudo sh -c "cd /home ; du -s * | sort -rn > USAGE"
 
 S\bSE\bEE\bE A\bAL\bLS\bSO\bO
-       _\bg_\br_\be_\bp(1), _\bs_\bu(1), _\bs_\bt_\ba_\bt(2), _\bl_\bo_\bg_\bi_\bn_\b__\bc_\ba_\bp(3), _\bp_\ba_\bs_\bs_\bw_\bd(4), _\bs_\bu_\bd_\bo_\be_\br_\bs(5),
-       _\bv_\bi_\bs_\bu_\bd_\bo(1m)
+       _\bg_\br_\be_\bp(1), _\bs_\bu(1), _\bs_\bt_\ba_\bt(2), _\bl_\bo_\bg_\bi_\bn_\b__\bc_\ba_\bp(3), _\bp_\ba_\bs_\bs_\bw_\bd(4), _\bs_\bu_\bd_\bo_\be_\br_\bs(4), _\bv_\bi_\bs_\bu_\bd_\bo(1m)
 
 A\bAU\bUT\bTH\bHO\bOR\bRS\bS
        Many people have worked on s\bsu\bud\bdo\bo over the years; this version consists
@@ -586,10 +585,11 @@ C\bCA\bAV\bVE\bEA\bAT\bTS\bS
 
        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.
 
 
 
-1.7.3b2                 December 19, 2009                       9
+1.8.0a1                 February 24, 2010                       9
 
 
 
@@ -598,8 +598,6 @@ C\bCA\bAV\bVE\bEA\bAT\bTS\bS
 SUDO(1m)               MAINTENANCE COMMANDS              SUDO(1m)
 
 
-       elements in the user specification.
-
        Running shell scripts via s\bsu\bud\bdo\bo can expose the same kernel bugs that
        make setuid shell scripts unsafe on some operating systems (if your OS
        has a /dev/fd/ directory, setuid shell scripts are generally safe).
@@ -655,6 +653,8 @@ D\bDI\bIS\bSC\bCL\bLA\bAI\bIM\bME\bER\bR
 
 
 
-1.7.3b2                 December 19, 2009                      10
+
+
+1.8.0a1                 February 24, 2010                      10
 
 
index f56637c7ebe8c7252cb224a60ff5d4880a414bc3..c68a6f71fb6a458dc649a4bb22bb07fb59029df7 100644 (file)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1994-1996, 1998-2005, 2007-2009
+.\" Copyright (c) 1994-1996, 1998-2005, 2007-2010
 .\"    Todd C. Miller <Todd.Miller@courtesan.com>
 .\" 
 .\" Permission to use, copy, modify, and distribute this software for any
 .\" ========================================================================
 .\"
 .IX Title "SUDO @mansectsu@"
-.TH SUDO @mansectsu@ "December 19, 2009" "1.7.3b2" "MAINTENANCE COMMANDS"
+.TH SUDO @mansectsu@ "February 24, 2010" "1.8.0a1" "MAINTENANCE COMMANDS"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
 sudo, sudoedit \- execute a command as another user
 .SH "SYNOPSIS"
 .IX Header "SYNOPSIS"
-\&\fBsudo\fR \fB\-h\fR | \fB\-K\fR | \fB\-k\fR | \fB\-L\fR | \fB\-V\fR
+\&\fBsudo\fR [\fB\-D\fR\ \fIlevel\fR] \fB\-h\fR | \fB\-K\fR | \fB\-k\fR | \fB\-L\fR | \fB\-V\fR
 .PP
 \&\fBsudo\fR \fB\-v\fR [\fB\-AknS\fR]
 @BAMAN@[\fB\-a\fR\ \fIauth_type\fR]
+[\fB\-D\fR\ \fIlevel\fR]
 [\fB\-g\fR\ \fIgroup\ name\fR|\fI#gid\fR] [\fB\-p\fR\ \fIprompt\fR]
 [\fB\-u\fR\ \fIusername\fR|\fI#uid\fR]
 .PP
 \&\fBsudo\fR \fB\-l[l]\fR [\fB\-AknS\fR]
 @BAMAN@[\fB\-a\fR\ \fIauth_type\fR]
+[\fB\-D\fR\ \fIlevel\fR]
 [\fB\-g\fR\ \fIgroup\ name\fR|\fI#gid\fR] [\fB\-p\fR\ \fIprompt\fR]
 [\fB\-U\fR\ \fIuser\ name\fR] [\fB\-u\fR\ \fIuser\ name\fR|\fI#uid\fR] [\fIcommand\fR]
 .PP
 \&\fBsudo\fR [\fB\-AbEHnPS\fR]
 @BAMAN@[\fB\-a\fR\ \fIauth_type\fR]
 [\fB\-C\fR\ \fIfd\fR]
+[\fB\-D\fR\ \fIlevel\fR]
 @LCMAN@[\fB\-c\fR\ \fIclass\fR|\fI\-\fR]
 [\fB\-g\fR\ \fIgroup\ name\fR|\fI#gid\fR] [\fB\-p\fR\ \fIprompt\fR]
 @SEMAN@[\fB\-r\fR\ \fIrole\fR] [\fB\-t\fR\ \fItype\fR]
@@ -178,6 +181,7 @@ sudo, sudoedit \- execute a command as another user
 @BAMAN@[\fB\-a\fR\ \fIauth_type\fR]
 [\fB\-C\fR\ \fIfd\fR]
 @LCMAN@[\fB\-c\fR\ \fIclass\fR|\fI\-\fR]
+[\fB\-D\fR\ \fIlevel\fR]
 [\fB\-g\fR\ \fIgroup\ name\fR|\fI#gid\fR] [\fB\-p\fR\ \fIprompt\fR]
 [\fB\-u\fR\ \fIuser\ name\fR|\fI#uid\fR] file ...
 .SH "DESCRIPTION"
@@ -271,6 +275,10 @@ administrator has enabled the \fIclosefrom_override\fR option in
 @LCMAN@argument specifies an existing user class, the command must be run
 @LCMAN@as root, or the \fBsudo\fR command must be run from a shell that is already
 @LCMAN@root.  This option is only available on systems with \s-1BSD\s0 login classes.
+.IP "\-D \fIlevel\fR" 12
+.IX Item "-D level"
+Enable debugging of \fBsudo\fR plugins and \fBsudo\fR itself.  The \fIlevel\fR
+may be a value from 1 through 9.
 .IP "\-E" 12
 .IX Item "-E"
 The \fB\-E\fR (\fIpreserve\fR \fIenvironment\fR) option will override the
index 4eb0613c927dc9e22d85818143ddf23a0dcca809..96058ce7447f3834b4b15db959adf59b2bd4f32d 100644 (file)
@@ -1,4 +1,4 @@
-Copyright (c) 1994-1996, 1998-2005, 2007-2009
+Copyright (c) 1994-1996, 1998-2005, 2007-2010
        Todd C. Miller <Todd.Miller@courtesan.com>
 
 Permission to use, copy, modify, and distribute this software for any
@@ -26,21 +26,24 @@ sudo, sudoedit - execute a command as another user
 
 =head1 SYNOPSIS
 
-B<sudo> B<-h> | B<-K> | B<-k> | B<-L> | B<-V>
+B<sudo> S<[B<-D> I<level>]> B<-h> | B<-K> | B<-k> | B<-L> | B<-V>
 
 B<sudo> B<-v> [B<-AknS>]
 S<[B<-a> I<auth_type>]>
+S<[B<-D> I<level>]>
 S<[B<-g> I<group name>|I<#gid>]> S<[B<-p> I<prompt>]>
 S<[B<-u> I<username>|I<#uid>]>
 
 B<sudo> B<-l[l]> [B<-AknS>]
 S<[B<-a> I<auth_type>]>
+S<[B<-D> I<level>]>
 S<[B<-g> I<group name>|I<#gid>]> S<[B<-p> I<prompt>]>
 S<[B<-U> I<user name>]> S<[B<-u> I<user name>|I<#uid>]> [I<command>]
 
 B<sudo> [B<-AbEHnPS>]
 S<[B<-a> I<auth_type>]>
 S<[B<-C> I<fd>]>
+S<[B<-D> I<level>]>
 S<[B<-c> I<class>|I<->]>
 S<[B<-g> I<group name>|I<#gid>]> S<[B<-p> I<prompt>]>
 S<[B<-r> I<role>]> S<[B<-t> I<type>]>
@@ -51,6 +54,7 @@ B<sudoedit> [B<-AnS>]
 S<[B<-a> I<auth_type>]>
 S<[B<-C> I<fd>]>
 S<[B<-c> I<class>|I<->]>
+S<[B<-D> I<level>]>
 S<[B<-g> I<group name>|I<#gid>]> S<[B<-p> I<prompt>]>
 S<[B<-u> I<user name>|I<#uid>]> file ...
 
@@ -154,6 +158,11 @@ 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.
 
+=item -D I<level>
+
+Enable debugging of B<sudo> plugins and B<sudo> itself.  The I<level>
+may be a value from 1 through 9.
+
 =item -E
 
 The B<-E> (I<preserve> I<environment>) option will override the
index 0869f03564c4354bea64cdfb5fe655149d20aa31..c0571314f43981c0d9598aae69234f8647b72a64 100644 (file)
@@ -1,3 +1,18 @@
+.\" Copyright (c) 2009-2010 Todd C. Miller <Todd.Miller@courtesan.com>
+.\" 
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\" 
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\" 
 .\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
 .\"
 .\" Standard preamble:
index 9fd20b996a39e3d381c3b90fff2e208b0ad5315b..ec20757974108048bba9ab29c13d3bf320612520 100644 (file)
@@ -1,3 +1,18 @@
+Copyright (c) 2009-2010 Todd C. Miller <Todd.Miller@courtesan.com>
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 =pod
 
 =head1 Sudo Plugin API
index aa9936d969eaa85b4874ddbc50f21ff465b4be8e..2feec155f3a611854d299a8f6f9f5d6e9f75cec2 100644 (file)
@@ -131,7 +131,7 @@ list.o: $(srcdir)/list.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/list.c
 load_plugins.o: $(srcdir)/load_plugins.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/load_plugins.c
-parse_args.o: $(srcdir)/parse_args.c $(SUDODEP)
+parse_args.o: $(srcdir)/parse_args.c sudo_usage.h $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/parse_args.c
 pty.o: $(srcdir)/pty.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/pty.c
@@ -139,7 +139,7 @@ script.o: $(srcdir)/script.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/script.c
 selinux.o: $(srcdir)/selinux.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/selinux.c
-sudo.o: $(srcdir)/sudo.c $(SUDODEP) sudo_usage.h
+sudo.o: $(srcdir)/sudo.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo.c
 sudo_edit.o: $(srcdir)/sudo_edit.c $(SUDODEP)
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo_edit.c
index b706b1c77138e6a7dfcc464df6fceb36edecf2d3..334d4ea2fdb17c438ac161e0dc05b600d73a03fe 100644 (file)
@@ -188,8 +188,11 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp,
                    break;
 #endif
                case 'D':
+                   if ((debug_level = atoi(optarg)) < 1 || debug_level > 9) {
+                       warningx("the argument to -D must be between 1 and 9 inclusive");
+                       usage(1);
+                   }
                    sudo_settings.D.value = optarg;
-                   debug_level = atoi(optarg);
                    break;
                case 'E':
                    sudo_settings.c.value = "true";
index aeccc21ed3fdbe415b36086cabbfa9ac41d04cc9..f11990c8857886138e2f37c398f99e86e3128094 100644 (file)
  * Usage strings for sudo.  These are here because we
  * need to be able to substitute values from configure.
  */
-#define SUDO_USAGE1 " -h | -K | -k | -L | -V"
-#define SUDO_USAGE2 " -v [-AknS] @BSDAUTH_USAGE@[-g groupname|#gid] [-p prompt] [-u user name|#uid]"
-#define SUDO_USAGE3 " -l[l] [-AknS] @BSDAUTH_USAGE@[-g groupname|#gid] [-p prompt] [-U user name] [-u user name|#uid] [-g groupname|#gid] [command]"
-#define SUDO_USAGE4 " [-AbEHknPS] @BSDAUTH_USAGE@@SELINUX_USAGE@[-C fd] @LOGINCAP_USAGE@[-g groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [<command>]"
-#define SUDO_USAGE5 " -e [-AknS] @BSDAUTH_USAGE@@SELINUX_USAGE@[-C fd] @LOGINCAP_USAGE@[-g groupname|#gid] [-p prompt] [-u user name|#uid] file ..."
+#define SUDO_USAGE1 " [-D level] -h | -K | -k | -L | -V"
+#define SUDO_USAGE2 " -v [-AknS] @BSDAUTH_USAGE@[-D level] [-g groupname|#gid] [-p prompt] [-u user name|#uid]"
+#define SUDO_USAGE3 " -l[l] [-AknS] @BSDAUTH_USAGE@[-D level] [-g groupname|#gid] [-p prompt] [-U user name] [-u user name|#uid] [-g groupname|#gid] [command]"
+#define SUDO_USAGE4 " [-AbEHknPS] @BSDAUTH_USAGE@@SELINUX_USAGE@[-C fd] [-D level] @LOGINCAP_USAGE@[-g groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [<command>]"
+#define SUDO_USAGE5 " -e [-AknS] @BSDAUTH_USAGE@@SELINUX_USAGE@[-C fd] [-D level] @LOGINCAP_USAGE@[-g groupname|#gid] [-p prompt] [-u user name|#uid] file ..."
 
 #endif /* _SUDO_USAGE_H */