diff --git a/plugins/sudoers/audit.c b/plugins/sudoers/audit.c index 6c86f910c..eb8fe1f7c 100644 --- a/plugins/sudoers/audit.c +++ b/plugins/sudoers/audit.c @@ -251,7 +251,7 @@ audit_to_eventlog(const struct sudoers_context *ctx, struct eventlog *evlog, static bool log_server_accept(const struct sudoers_context *ctx, struct eventlog *evlog) { - struct timespec now; + struct timespec start_time; bool ret = false; debug_decl(log_server_accept, SUDOERS_DEBUG_PLUGIN); @@ -268,7 +268,7 @@ log_server_accept(const struct sudoers_context *ctx, struct eventlog *evlog) debug_return_bool(true); } - if (sudo_gettime_real(&now) == -1) { + if (sudo_gettime_awake(&start_time) == -1) { sudo_warn("%s", U_("unable to get time of day")); goto done; } @@ -288,7 +288,7 @@ log_server_accept(const struct sudoers_context *ctx, struct eventlog *evlog) goto done; /* Open connection to log server, send hello and accept messages. */ - client_closure = log_server_open(&audit_details, &now, false, + client_closure = log_server_open(&audit_details, &start_time, false, SEND_ACCEPT, NULL); if (client_closure != NULL) ret = true; diff --git a/plugins/sudoers/iolog.c b/plugins/sudoers/iolog.c index 51afd3434..08c6e3175 100644 --- a/plugins/sudoers/iolog.c +++ b/plugins/sudoers/iolog.c @@ -57,7 +57,7 @@ static struct iolog_file iolog_files[] = { }; static struct sudoers_io_operations { - int (*open)(struct timespec *now); + int (*open)(struct timespec *start_time); void (*close)(int exit_status, int error, const char **errstr); int (*log)(int event, const char *buf, unsigned int len, struct timespec *delay, const char **errstr); @@ -685,7 +685,7 @@ oom: } static int -sudoers_io_open_local(struct timespec *now) +sudoers_io_open_local(struct timespec *start_time) { const struct sudoers_context *ctx = sudoers_get_context(); struct eventlog *evlog = iolog_details.evlog; @@ -756,13 +756,13 @@ done: #ifdef SUDOERS_LOG_CLIENT static int -sudoers_io_open_remote(struct timespec *now) +sudoers_io_open_remote(struct timespec *start_time) { debug_decl(sudoers_io_open_remote, SUDOERS_DEBUG_PLUGIN); /* Open connection to log server, send hello and accept messages. */ - client_closure = log_server_open(&iolog_details, now, true, SEND_ACCEPT, - NULL); + client_closure = log_server_open(&iolog_details, start_time, true, + SEND_ACCEPT, NULL); if (client_closure != NULL) debug_return_int(1); diff --git a/plugins/sudoers/log_client.c b/plugins/sudoers/log_client.c index 238e9d511..eabd880c2 100644 --- a/plugins/sudoers/log_client.c +++ b/plugins/sudoers/log_client.c @@ -1962,7 +1962,7 @@ bad: * Allocate and initialize a new client closure */ static struct client_closure * -client_closure_alloc(struct log_details *details, struct timespec *now, +client_closure_alloc(struct log_details *details, struct timespec *start_time, bool log_io, enum client_state initial_state, const char *reason) { struct client_closure *closure; @@ -1983,9 +1983,9 @@ client_closure_alloc(struct log_details *details, struct timespec *now, closure->state = RECV_HELLO; closure->initial_state = initial_state; - if (now != NULL) { - closure->start_time.tv_sec = now->tv_sec; - closure->start_time.tv_nsec = now->tv_nsec; + if (start_time != NULL) { + closure->start_time.tv_sec = start_time->tv_sec; + closure->start_time.tv_nsec = start_time->tv_nsec; } TAILQ_INIT(&closure->write_bufs); @@ -2012,14 +2012,14 @@ oom: } struct client_closure * -log_server_open(struct log_details *details, struct timespec *now, +log_server_open(struct log_details *details, struct timespec *start_time, bool log_io, enum client_state initial_state, const char *reason) { struct client_closure *closure; static bool warned = false; debug_decl(log_server_open, SUDOERS_DEBUG_UTIL); - closure = client_closure_alloc(details, now, log_io, initial_state, + closure = client_closure_alloc(details, start_time, log_io, initial_state, reason); if (closure == NULL) goto bad; diff --git a/plugins/sudoers/log_client.h b/plugins/sudoers/log_client.h index 8190becdc..226521310 100644 --- a/plugins/sudoers/log_client.h +++ b/plugins/sudoers/log_client.h @@ -107,7 +107,7 @@ struct client_closure { }; /* iolog_client.c */ -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 client_closure *log_server_open(struct log_details *details, struct timespec *start_time, bool log_io, enum client_state initial_state, const char *reason); 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); diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 7add7441e..776fd94d5 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -157,8 +157,8 @@ log_server_reject(const struct sudoers_context *ctx, struct eventlog *evlog, debug_return_bool(false); /* Open connection to log server, send hello and reject messages. */ - client_closure = log_server_open(&details, &evlog->submit_time, - false, SEND_REJECT, message); + client_closure = log_server_open(&details, NULL, false, + SEND_REJECT, message); if (client_closure != NULL) { client_closure_free(client_closure); client_closure = NULL;