From f7fa520540aa5148dde5ce815b83db8aee7dac1d Mon Sep 17 00:00:00 2001
From: "Todd C. Miller" <Todd.Miller@courtesan.com>
Date: Sun, 27 Feb 2000 03:56:41 +0000
Subject: [PATCH] document -S flag

---
 sudo.cat | 36 ++++++++++++++++++------------------
 sudo.man | 16 +++++++++++-----
 sudo.pod | 10 ++++++++--
 3 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/sudo.cat b/sudo.cat
index ed0d4187b..99cde97ef 100644
--- a/sudo.cat
+++ b/sudo.cat
@@ -8,8 +8,8 @@ NNNNAAAAMMMMEEEE
        sudo - execute a command as another user
 
 SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
-       ssssuuuuddddoooo ----VVVV | ----hhhh | ----llll | ----LLLL | ----vvvv | ----kkkk | ----KKKK | ----ssss | ----HHHH | [ ----bbbb ] |
-       [ ----pppp prompt ] [ ----uuuu username/#uid] _c_o_m_m_a_n_d
+       ssssuuuuddddoooo ----VVVV | ----hhhh | ----llll | ----LLLL | ----vvvv | ----kkkk | ----KKKK | ----ssss | [ ----HHHH ] [----SSSS ]
+       [ ----bbbb ] | [ ----pppp prompt ] [ ----uuuu username/#uid ] _c_o_m_m_a_n_d
 
 DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
        ssssuuuuddddoooo allows a permitted user to execute a _c_o_m_m_a_n_d as the
@@ -61,7 +61,7 @@ OOOOPPPPTTTTIIIIOOOONNNNSSSS
 
 
 
-15/Feb/2000                   1.6.3                             1
+26/Feb/2000                   1.6.3                             1
 
 
 
@@ -115,19 +115,19 @@ sudo(8)                MAINTENANCE COMMANDS               sudo(8)
            default) as specified in _p_a_s_s_w_d(5).  By default, ssssuuuuddddoooo
            does not modify _H_O_M_E.
 
+       -S  The -S (_s_t_d_i_n) option causes ssssuuuuddddoooo to read the password
+           from standard input instead of the terminal device.
+
        --  The -- flag indicates that ssssuuuuddddoooo should stop processing
            command line arguments.  It is most useful in
            conjunction with the -s flag.
 
 RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
        ssssuuuuddddoooo quits with an exit value of 1 if there is a
-       configuration/permission problem or if ssssuuuuddddoooo cannot execute
-       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
 
 
 
-15/Feb/2000                   1.6.3                             2
+26/Feb/2000                   1.6.3                             2
 
 
 
@@ -136,6 +136,9 @@ RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEES
 sudo(8)                MAINTENANCE COMMANDS               sudo(8)
 
 
+       configuration/permission problem or if ssssuuuuddddoooo cannot execute
+       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
        entries in the user's PATH an error is printed on stderr.
        (If the directory does not exist or if it is not really a
        directory, the entry is ignored and no error is printed.)
@@ -188,12 +191,9 @@ SSSSEEEECCCCUUUURRRRIIIITTTTYYYY NNNNOOOOTTTTE
        instance) or create /tmp/.odus with the appropriate owner
        (root) and permissions (0700) in the system startup files.
 
-       ssssuuuuddddoooo will not honor timestamps set far in the future.
-       Timestamps with a date greater than current_time + 2 *
 
 
-
-15/Feb/2000                   1.6.3                             3
+26/Feb/2000                   1.6.3                             3
 
 
 
@@ -202,6 +202,8 @@ SSSSEEEECCCCUUUURRRRIIIITTTTYYYY NNNNOOOOTTTTE
 sudo(8)                MAINTENANCE COMMANDS               sudo(8)
 
 
+       ssssuuuuddddoooo will not honor timestamps set far in the future.
+       Timestamps with a date greater than current_time + 2 *
        TIMEOUT will be ignored and sudo will log and complain.
        This is done to keep a user from creating his/her own
        timestamp with a bogus date on system that allow users to
@@ -254,12 +256,10 @@ EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
         SUDO_PS1               If set, PS1 will be set to its value
 
 
-FFFFIIIILLLLEEEESSSS
 
 
 
-
-15/Feb/2000                   1.6.3                             4
+26/Feb/2000                   1.6.3                             4
 
 
 
@@ -268,6 +268,7 @@ FFFFIIIILLLLEEEESSSS
 sudo(8)                MAINTENANCE COMMANDS               sudo(8)
 
 
+FFFFIIIILLLLEEEESSSS
         /etc/sudoers           List of who can run what
         /var/run/sudo          Directory containing timestamps
 
@@ -321,11 +322,10 @@ CCCCAAAAVVVVEEEEAAAATTTTSSSS
        escapes.
 
        If users have sudo ALL there is nothing to prevent them
-       from creating their own program that gives them a root
 
 
 
-15/Feb/2000                   1.6.3                             5
+26/Feb/2000                   1.6.3                             5
 
 
 
@@ -334,6 +334,7 @@ CCCCAAAAVVVVEEEEAAAATTTTSSSS
 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.
 
@@ -390,7 +391,6 @@ SSSSEEEEEEEE AAAALLLLSSSSOOOO
 
 
 
-
-15/Feb/2000                   1.6.3                             6
+26/Feb/2000                   1.6.3                             6
 
 
diff --git a/sudo.man b/sudo.man
index ef1157fe7..81f6bfdb3 100644
--- a/sudo.man
+++ b/sudo.man
@@ -2,8 +2,8 @@
 ''' $RCSfile$$Revision$$Date$
 '''
 ''' $Log$
-''' Revision 1.44  2000/02/16 00:07:28  millert
-''' crank versino to 1.6.3
+''' Revision 1.45  2000/02/27 03:56:40  millert
+''' document -S flag
 '''
 '''
 .de Sh
@@ -96,7 +96,7 @@
 .nr % 0
 .rr F
 .\}
-.TH sudo 8 "1.6.3" "15/Feb/2000" "MAINTENANCE COMMANDS"
+.TH sudo 8 "1.6.3" "26/Feb/2000" "MAINTENANCE COMMANDS"
 .UC
 .if n .hy 0
 .if n .na
@@ -193,8 +193,9 @@
 .SH "NAME"
 sudo \- execute a command as another user
 .SH "SYNOPSIS"
-\fBsudo\fR \fB\-V\fR | \fB\-h\fR | \fB\-l\fR | \fB\-L\fR | \fB\-v\fR | \fB\-k\fR | \fB\-K\fR | \fB\-s\fR | \fB\-H\fR |
-[ \fB\-b\fR ] | [ \fB\-p\fR prompt ] [ \fB\-u\fR username/#uid] \fIcommand\fR
+\fBsudo\fR \fB\-V\fR | \fB\-h\fR | \fB\-l\fR | \fB\-L\fR | \fB\-v\fR | \fB\-k\fR | \fB\-K\fR | \fB\-s\fR |
+[ \fB\-H\fR ] [\fB\-S\fR ] [ \fB\-b\fR ] | [ \fB\-p\fR prompt ]
+[ \fB\-u\fR username/#uid ] \fIcommand\fR
 .SH "DESCRIPTION"
 \fBsudo\fR allows a permitted user to execute a \fIcommand\fR as the
 superuser or another user, as specified in the sudoers file.  The
@@ -275,6 +276,9 @@ in \fIpasswd\fR\|(5).
 The \f(CW-H\fR (\fI\s-1HOME\s0\fR) option sets the \fI\s-1HOME\s0\fR environment variable
 to the homedir of the target user (root by default) as specified
 in \fIpasswd\fR\|(5).  By default, \fBsudo\fR does not modify \fI\s-1HOME\s0\fR.
+.Ip "-S" 4
+The \f(CW-S\fR (\fIstdin\fR) option causes \fBsudo\fR to read the password from
+standard input instead of the terminal device.
 .Ip "--" 4
 The \f(CW--\fR flag indicates that \fBsudo\fR should stop processing command
 line arguments.  It is most useful in conjunction with the \f(CW-s\fR flag.
@@ -482,6 +486,8 @@ are generally safe).
 
 .IX Item "-H"
 
+.IX Item "-S"
+
 .IX Item "--"
 
 .IX Header "RETURN VALUES"
diff --git a/sudo.pod b/sudo.pod
index c92cd3000..9169e8826 100644
--- a/sudo.pod
+++ b/sudo.pod
@@ -41,8 +41,9 @@ sudo - execute a command as another user
 
 =head1 SYNOPSIS
 
-B<sudo> B<-V> | B<-h> | B<-l> | B<-L> | B<-v> | B<-k> | B<-K> | B<-s> | B<-H> |
-[ B<-b> ] | [ B<-p> prompt ] [ B<-u> username/#uid] I<command>
+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<-u> username/#uid ] I<command>
 
 =head1 DESCRIPTION
 
@@ -154,6 +155,11 @@ The C<-H> (I<HOME>) option sets the I<HOME> environment variable
 to the homedir of the target user (root by default) as specified
 in passwd(5).  By default, B<sudo> does not modify I<HOME>.
 
+=item -S
+
+The C<-S> (I<stdin>) option causes B<sudo> to read the password from
+standard input instead of the terminal device.
+
 =item --
 
 The C<--> flag indicates that B<sudo> should stop processing command
