Fix logging intercepted commands to a log server in sudoers.

Only available when the server supports the subcommands capability.
This commit is contained in:
Todd C. Miller
2021-08-09 15:50:26 -06:00
parent 3a090dcdcd
commit 2e99450d40
5 changed files with 118 additions and 51 deletions

View File

@@ -94,6 +94,7 @@ struct client_closure {
SSL *ssl;
bool ssl_initialized;
#endif /* HAVE_OPENSSL */
bool subcommands;
enum client_state state;
enum client_state initial_state; /* XXX - bad name */
struct connection_buffer_list write_bufs;
@@ -113,6 +114,8 @@ struct client_closure {
struct client_closure *log_server_open(struct log_details *details, struct timespec *now, bool log_io, enum client_state initial_state, const char *reason, struct sudo_plugin_event * (*event_alloc)(void));
bool log_server_close(struct client_closure *closure, int exit_status, int error);
bool fmt_client_message(struct client_closure *closure, ClientMessage *msg);
bool fmt_accept_message(struct client_closure *closure, struct eventlog *evlog);
bool fmt_reject_message(struct client_closure *closure, struct eventlog *evlog);
bool fmt_exit_message(struct client_closure *closure, int exit_status, int error);
bool fmt_io_buf(struct client_closure *closure, int type, const char *buf, unsigned int len, struct timespec *delay);
bool fmt_suspend(struct client_closure *closure, const char *signame, struct timespec *delay);
@@ -120,5 +123,6 @@ bool fmt_winsize(struct client_closure *closure, unsigned int lines, unsigned in
bool log_server_connect(struct client_closure *closure);
void client_closure_free(struct client_closure *closure);
bool read_server_hello(struct client_closure *closure);
extern struct client_closure *client_closure;
#endif /* SUDOERS_LOG_CLIENT_H */