Skip to content

Commit 5c16648

Browse files
committed
sudo_sendlog: Compressed I/O logs can't be opened "r+"
We should only need to open the I/O log file read-only anyway.
1 parent f0d2ff6 commit 5c16648

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

logsrvd/sendlog.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,6 @@ main(int argc, char *argv[])
17341734
bool accept_only = false;
17351735
char *reject_reason = NULL;
17361736
const char *iolog_id = NULL;
1737-
const char *open_mode = "r";
17381737
const char *errstr;
17391738
int ch, sock, iolog_dir_fd, finished;
17401739
debug_decl_vars(main, SUDO_DEBUG_MAIN);
@@ -1782,7 +1781,6 @@ main(int argc, char *argv[])
17821781
case 'r':
17831782
if (!parse_timespec(&restart, optarg))
17841783
goto bad;
1785-
open_mode = "r+";
17861784
break;
17871785
case 's':
17881786
if (!parse_timespec(&stop_after, optarg))
@@ -1879,7 +1877,7 @@ main(int argc, char *argv[])
18791877
goto bad;
18801878

18811879
/* Open the I/O log files and seek to restart point if there is one. */
1882-
if (!iolog_open_all(iolog_dir_fd, iolog_dir, closure->iolog_files, open_mode))
1880+
if (!iolog_open_all(iolog_dir_fd, iolog_dir, closure->iolog_files, "r"))
18831881
goto bad;
18841882
if (sudo_timespecisset(&closure->restart)) {
18851883
if (!iolog_seekto(iolog_dir_fd, iolog_dir, closure->iolog_files,

0 commit comments

Comments
 (0)