From: Todd C. Miller Date: Wed, 30 Nov 2016 20:38:01 +0000 (-0700) Subject: Allow stdin and ttyin to be displayed too. The only one that is X-Git-Tag: SUDO_1_8_19^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb1f04401721b1b0078801d0cfec0ac34351e881;p=sudo Allow stdin and ttyin to be displayed too. The only one that is really useful in sudoreplay is stdin when input is from a pipe. --- diff --git a/doc/sudoreplay.cat b/doc/sudoreplay.cat index 43dbacf84..61c9998e5 100644 --- a/doc/sudoreplay.cat +++ b/doc/sudoreplay.cat @@ -44,8 +44,8 @@ DDEESSCCRRIIPPTTIIOONN Select which I/O type(s) to display. By default, ssuuddoorreeppllaayy will display the command's standard output, standard error and tty output. The _f_i_l_t_e_r argument is a comma-separated - list, consisting of one or more of following: _s_t_d_o_u_t, _s_t_d_e_r_r, - and _t_t_y_o_u_t. + list, consisting of one or more of following: _s_t_d_i_n, _s_t_d_o_u_t, + _s_t_d_e_r_r, _t_t_y_i_n, and _t_t_y_o_u_t. --hh, ----hheellpp Display a short help message to the standard output and exit. @@ -276,4 +276,4 @@ DDIISSCCLLAAIIMMEERR file distributed with ssuuddoo or https://www.sudo.ws/license.html for complete details. -Sudo 1.8.19 May 4, 2016 Sudo 1.8.19 +Sudo 1.8.19 November 30, 2016 Sudo 1.8.19 diff --git a/doc/sudoreplay.man.in b/doc/sudoreplay.man.in index 3044ef7c4..cdd6b69db 100644 --- a/doc/sudoreplay.man.in +++ b/doc/sudoreplay.man.in @@ -16,7 +16,7 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.TH "SUDOREPLAY" "8" "May 4, 2016" "Sudo @PACKAGE_VERSION@" "System Manager's Manual" +.TH "SUDOREPLAY" "8" "November 30, 2016" "Sudo @PACKAGE_VERSION@" "System Manager's Manual" .nh .if n .ad l .SH "NAME" @@ -110,8 +110,10 @@ will display the command's standard output, standard error and tty output. The \fIfilter\fR argument is a comma-separated list, consisting of one or more of following: +\fIstdin\fR, \fIstdout\fR, \fIstderr\fR, +\fIttyin\fR, and \fIttyout\fR. .TP 12n diff --git a/doc/sudoreplay.mdoc.in b/doc/sudoreplay.mdoc.in index c49fb51f9..d9efa414b 100644 --- a/doc/sudoreplay.mdoc.in +++ b/doc/sudoreplay.mdoc.in @@ -14,7 +14,7 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 4, 2016 +.Dd November 30, 2016 .Dt SUDOREPLAY @mansectsu@ .Os Sudo @PACKAGE_VERSION@ .Sh NAME @@ -104,8 +104,10 @@ will display the command's standard output, standard error and tty output. The .Ar filter argument is a comma-separated list, consisting of one or more of following: +.Em stdin , .Em stdout , .Em stderr , +.Em ttyin , and .Em ttyout . .It Fl h , -help diff --git a/plugins/sudoers/sudoreplay.c b/plugins/sudoers/sudoreplay.c index d82f0f91e..84ae0aab6 100644 --- a/plugins/sudoers/sudoreplay.c +++ b/plugins/sudoers/sudoreplay.c @@ -222,10 +222,14 @@ main(int argc, char *argv[]) /* Set the replay filter. */ def_filter = false; for (cp = strtok_r(optarg, ",", &ep); cp; cp = strtok_r(NULL, ",", &ep)) { - if (strcmp(cp, "stdout") == 0) + if (strcmp(cp, "stdin") == 0) + io_log_files[IOFD_STDIN].enabled = true; + else if (strcmp(cp, "stdout") == 0) io_log_files[IOFD_STDOUT].enabled = true; else if (strcmp(cp, "stderr") == 0) io_log_files[IOFD_STDERR].enabled = true; + else if (strcmp(cp, "ttyin") == 0) + io_log_files[IOFD_TTYIN].enabled = true; else if (strcmp(cp, "ttyout") == 0) io_log_files[IOFD_TTYOUT].enabled = true; else