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.
This commit is contained in:
Todd C. Miller
2016-11-30 13:38:01 -07:00
parent 52d6a5e40d
commit cb1f044017
4 changed files with 14 additions and 6 deletions

View File

@@ -44,8 +44,8 @@ DDEESSCCRRIIPPTTIIOONN
Select which I/O type(s) to display. By default, ssuuddoorreeppllaayy Select which I/O type(s) to display. By default, ssuuddoorreeppllaayy
will display the command's standard output, standard error will display the command's standard output, standard error
and tty output. The _f_i_l_t_e_r argument is a comma-separated 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, list, consisting of one or more of following: _s_t_d_i_n, _s_t_d_o_u_t,
and _t_t_y_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. --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 file distributed with ssuuddoo or https://www.sudo.ws/license.html for
complete details. complete details.
Sudo 1.8.19 May 4, 2016 Sudo 1.8.19 Sudo 1.8.19 November 30, 2016 Sudo 1.8.19

View File

@@ -16,7 +16,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" 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 .nh
.if n .ad l .if n .ad l
.SH "NAME" .SH "NAME"
@@ -110,8 +110,10 @@ will display the command's standard output, standard error and tty output.
The The
\fIfilter\fR \fIfilter\fR
argument is a comma-separated list, consisting of one or more of following: argument is a comma-separated list, consisting of one or more of following:
\fIstdin\fR,
\fIstdout\fR, \fIstdout\fR,
\fIstderr\fR, \fIstderr\fR,
\fIttyin\fR,
and and
\fIttyout\fR. \fIttyout\fR.
.TP 12n .TP 12n

View File

@@ -14,7 +14,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd May 4, 2016 .Dd November 30, 2016
.Dt SUDOREPLAY @mansectsu@ .Dt SUDOREPLAY @mansectsu@
.Os Sudo @PACKAGE_VERSION@ .Os Sudo @PACKAGE_VERSION@
.Sh NAME .Sh NAME
@@ -104,8 +104,10 @@ will display the command's standard output, standard error and tty output.
The The
.Ar filter .Ar filter
argument is a comma-separated list, consisting of one or more of following: argument is a comma-separated list, consisting of one or more of following:
.Em stdin ,
.Em stdout , .Em stdout ,
.Em stderr , .Em stderr ,
.Em ttyin ,
and and
.Em ttyout . .Em ttyout .
.It Fl h , -help .It Fl h , -help

View File

@@ -222,10 +222,14 @@ main(int argc, char *argv[])
/* Set the replay filter. */ /* Set the replay filter. */
def_filter = false; def_filter = false;
for (cp = strtok_r(optarg, ",", &ep); cp; cp = strtok_r(NULL, ",", &ep)) { 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; io_log_files[IOFD_STDOUT].enabled = true;
else if (strcmp(cp, "stderr") == 0) else if (strcmp(cp, "stderr") == 0)
io_log_files[IOFD_STDERR].enabled = true; 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) else if (strcmp(cp, "ttyout") == 0)
io_log_files[IOFD_TTYOUT].enabled = true; io_log_files[IOFD_TTYOUT].enabled = true;
else else