If the sudoreplay ID option is a fully-qualified path, use it directly.

Previously, one had to use the -d option to override the I/O log directory.
This commit is contained in:
Todd C. Miller
2019-08-27 13:40:38 -06:00
parent 91d508d408
commit 9eeedb470f
3 changed files with 34 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
.\"
.\" SPDX-License-Identifier: ISC
.\"
.\" Copyright (c) 2009-2018 Todd C. Miller <Todd.Miller@sudo.ws>
.\" Copyright (c) 2009-2019 Todd C. Miller <Todd.Miller@sudo.ws>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
@@ -16,7 +16,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.TH "SUDOREPLAY" "@mansectsu@" "October 6, 2018" "Sudo @PACKAGE_VERSION@" "System Manager's Manual"
.TH "SUDOREPLAY" "@mansectsu@" "August 27, 2019" "Sudo @PACKAGE_VERSION@" "System Manager's Manual"
.nh
.if n .ad l
.SH "NAME"
@@ -51,11 +51,20 @@ The
should either be a six character sequence of digits and
upper case letters, e.g.,
\fR0100A5\fR,
or a pattern matching the
a pattern matching the
\fIiolog_file\fR
option in the
\fIsudoers\fR
file.
file, or a path name.
Path names may be relative to the
\fIiolog_dir\fR
option in the
\fIsudoers\fR
file (unless overridden by the
\fB\-d\fR
option) or fully qualified, beginning with a
\(oq/\(cq
character.
When a command is run via
\fBsudo\fR
with

View File

@@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: ISC
.\"
.\" Copyright (c) 2009-2018 Todd C. Miller <Todd.Miller@sudo.ws>
.\" Copyright (c) 2009-2019 Todd C. Miller <Todd.Miller@sudo.ws>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd October 6, 2018
.Dd August 27, 2019
.Dt SUDOREPLAY @mansectsu@
.Os Sudo @PACKAGE_VERSION@
.Sh NAME
@@ -49,11 +49,20 @@ The
should either be a six character sequence of digits and
upper case letters, e.g.,
.Li 0100A5 ,
or a pattern matching the
a pattern matching the
.Em iolog_file
option in the
.Em sudoers
file.
file, or a path name.
Path names may be relative to the
.Em iolog_dir
option in the
.Em sudoers
file (unless overridden by the
.Fl d
option) or fully qualified, beginning with a
.Ql /
character.
When a command is run via
.Nm sudo
with

View File

@@ -320,12 +320,15 @@ main(int argc, char *argv[])
if (plen < 0 || plen >= ssizeof(path))
sudo_fatalx(U_("%s/%.2s/%.2s/%.2s/timing: %s"), session_dir,
id, &id[2], &id[4], strerror(ENAMETOOLONG));
} else {
plen = snprintf(path, sizeof(path), "%s/%s/timing",
session_dir, id);
} else if (id[0] == '/') {
plen = snprintf(path, sizeof(path), "%s/timing", id);
if (plen < 0 || plen >= ssizeof(path))
sudo_fatalx(U_("%s/%s/timing: %s"), session_dir,
id, strerror(ENAMETOOLONG));
sudo_fatalx(U_("%s/timing: %s"), id, strerror(ENAMETOOLONG));
} else {
plen = snprintf(path, sizeof(path), "%s/%s/timing", session_dir, id);
if (plen < 0 || plen >= ssizeof(path))
sudo_fatalx(U_("%s/%s/timing: %s"), session_dir, id,
strerror(ENAMETOOLONG));
}
plen -= 7;