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.
This commit is contained in:
Todd C. Miller
2020-03-29 05:05:08 -06:00
parent a644c1d1d2
commit ea9b711a70
12 changed files with 270 additions and 47 deletions

View File

@@ -64,9 +64,14 @@ struct iolog_info {
char *runas_group;
char *tty;
char *cmd;
time_t tstamp;
char *host;
struct timespec tstamp;
int lines;
int cols;
uid_t runas_uid;
gid_t runas_gid;
char **argv;
char **envp;
};
struct timing_closure {
@@ -123,7 +128,7 @@ bool iolog_mkpath(char *path);
bool iolog_nextid(char *iolog_dir, char sessid[7]);
bool iolog_open(struct iolog_file *iol, int dfd, int iofd, const char *mode);
bool iolog_rename(const char *from, const char *to);
bool iolog_write_info_file(int dfd, const char *parent, struct iolog_info *log_info, char * const argv[]);
bool iolog_write_info_file(int dfd, const char *parent, struct iolog_info *log_info);
char *iolog_gets(struct iolog_file *iol, char *buf, size_t nbytes, const char **errsttr);
const char *iolog_fd_to_name(int iofd);
int iolog_openat(int fdf, const char *path, int flags);