Commit Graph

31 Commits

Author SHA1 Message Date
Todd C. Miller
6734a99f8a libiolog: silence -Wconversion warnings. 2023-07-07 15:07:04 -06:00
Todd C. Miller
2f4b406809 iolog_gets: change size parameter to int to match fgets/gzgets
Return an error, setting errno to EINVAL, for negative sizes.
2023-05-05 10:20:21 -06:00
Todd C. Miller
9d654482b2 Convert remaining uses of sudo_mkdir_parents() to sudo_open_parent_dir(). 2022-09-21 19:08:15 -06:00
Todd C. Miller
13672f28df Make sudo pass -Wwrite-strings 2022-06-28 16:33:15 -06:00
Todd C. Miller
f5ac1317c4 Make sudo pass -Wmissing-prototypes 2022-06-27 12:48:03 -06:00
Todd C. Miller
946404434e lib/iolog: add support for filtering password out of tty input
If a password regex is found in the tty output, tty input will be
replaced with '*' chars until a newline or another tty output
character is received.
2022-01-28 08:52:41 -07:00
Todd C. Miller
a554629d84 Flush I/O logs before we send a commit point.
The commit point message means we have written the data to disk so
we should not be buffering it any longer.
We do not currently fsync(2) the data after flushing, perhaps we should.
2021-10-15 19:10:34 -06:00
Todd C. Miller
23d04dde24 iolog_nextid(): make iolog_dir argument const.
We make a copy of the directory so there's no real reason that
parameter can't be const.
2021-09-21 19:09:21 -06:00
Todd C. Miller
851247e58c Split iolog_fileio.c into multiple files. 2021-02-26 21:07:48 -07:00
Todd C. Miller
d51d4af7a6 Break out I/O log config handling into iolog_conf.c. 2021-02-26 15:02:58 -07:00
Todd C. Miller
b93aad4e95 Move iolog info log writing to iolog_loginfo.c 2021-02-24 15:01:37 -07:00
Todd C. Miller
d2901f4121 Add fuzzer for legacy I/O log info file. 2021-02-03 07:41:20 -07:00
Todd C. Miller
db72498257 Use struct eventlog in place of struct iolog_info. 2020-10-26 15:31:41 -06:00
Todd C. Miller
bd254e1042 Read/write runchroot and runcwd entries in the JSON event log. 2020-09-01 06:26:05 -06:00
Todd C. Miller
0312292e99 Add iolog_clearerr() that acts like clearerr(3).
Works for both compressed and uncompressed I/O logs.
2020-05-18 14:16:47 -06:00
Todd C. Miller
d85d370c63 Add dependent system includes to make sudo_*.h more standalone.
In the past we've relied on the various .c files to include the
system headers that define types that the sudo_*.h headers require.
This is fragile and can cause issues when includes get re-ordered.
2020-05-18 04:47:21 -06:00
Todd C. Miller
83d1bee918 Rename sudo_parse_host_port -> iolog_parse_host_port and mv to lib/iolog
It is not used outside of the I/O log client and server and the
host:port syntax may change in the future.
2020-05-11 08:47:54 -06:00
Todd C. Miller
056173e572 Parse I/O JSON info file in JSON if present.
The JSON version includes more information than the original "log"
file in the I/O log dir.
2020-03-29 05:05:08 -06:00
Todd C. Miller
ea9b711a70 Write an extended I/O info log in JSON format.
This will be used by sudoreplay if it exists to get more information
about the command being replayed.
2020-03-29 05:05:08 -06:00
Todd C. Miller
a644c1d1d2 iolog_parse_loginfo() now opens the log file itself. 2020-03-29 05:05:08 -06:00
Todd C. Miller
9e57bea4e3 Fix coverity CID 206586.
Potential use after free calling gzstrerror() after gzclose().
2020-01-05 07:48:48 -07:00
Todd C. Miller
ee91b7360b Simplify expand_iolog_path() 2019-10-24 20:04:33 -06:00
Todd C. Miller
13e3eaad5f Simplify iolog_set_user and iolog_set_group 2019-10-24 20:04:33 -06:00
Todd C. Miller
56c21243d7 Add iolog_ prefix to exported functions in iolog_util.c 2019-10-24 20:04:33 -06:00
Todd C. Miller
aaf5d0dc6e Read logsrvd.conf in two steps: first read, then apply if OK.
This fixes a problem where when logsrvd.conf was reloaded while
running (due to SIGHUP) and there was an error we could end up with
a partial config.
2019-10-24 20:04:33 -06:00
Todd C. Miller
b58ecb7e6d Move read_timing_record() into libsudo_iolog 2019-10-24 20:04:32 -06:00
Todd C. Miller
3394785f6d Add restart support for compresses I/O logs. 2019-10-24 20:04:32 -06:00
Todd C. Miller
534aba7a3e Make the logsrvd port and list address configurable. 2019-10-24 20:04:32 -06:00
Todd C. Miller
282263c113 Use openat(2) when opening files in the I/O log directory. 2019-10-24 20:04:31 -06:00
Todd C. Miller
7ba7c5835e Enable sudo_logsrvd.conf settings. 2019-10-24 20:04:31 -06:00
Todd C. Miller
059b55ce72 Refactor code in sudoers that creates I/O log files to share with logsrvd. 2019-10-24 20:04:31 -06:00