]> granicus.if.org Git - sudo/commitdiff
If the sudoreplay ID option is a fully-qualified path, use it directly. master
authorTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 27 Aug 2019 19:40:38 +0000 (13:40 -0600)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 27 Aug 2019 19:40:38 +0000 (13:40 -0600)
Previously, one had to use the -d option to override the I/O log directory.

doc/sudoreplay.man.in
doc/sudoreplay.mdoc.in
plugins/sudoers/sudoreplay.c

index bb6726f9290de556769cf0690270d2ac5dd99fae..bfc1197a07a1f4b721ac3cc036fe8e5111a823f7 100644 (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
index 2642e82bd8c076fae5ff340efe768441375a0bfc..45376cd5bd4d1545656270b74b44f0ba587d6101 100644 (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
index f4bf890129d94688ecb7894fd599929d766703a8..5c2e0d2338d7f5ec6b75d819fe8e7e819d026ee2 100644 (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 if (id[0] == '/') {
+       plen = snprintf(path, sizeof(path), "%s/timing", id);
+       if (plen < 0 || plen >= ssizeof(path))
+           sudo_fatalx(U_("%s/timing: %s"), id, strerror(ENAMETOOLONG));
     } else {
-       plen = snprintf(path, sizeof(path), "%s/%s/timing",
-           session_dir, id);
+       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));
+           sudo_fatalx(U_("%s/%s/timing: %s"), session_dir, id,
+               strerror(ENAMETOOLONG));
     }
     plen -= 7;