]> granicus.if.org Git - sudo/blobdiff - plugins/sudoers/sudoreplay.c
If the sudoreplay ID option is a fully-qualified path, use it directly.
[sudo] / plugins / sudoers / sudoreplay.c
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;