summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/utmp.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/utmp.c b/src/utmp.c
index 952bf3043..397f329ea 100644
--- a/src/utmp.c
+++ b/src/utmp.c
@@ -158,15 +158,10 @@ utmp_fill(const char *line, const char *user, sudo_utmp_t *ut_old,
if (ut_old == NULL) {
memset(ut_new, 0, sizeof(*ut_new));
- if (user == NULL) {
- strncpy(ut_new->ut_user, user_details.username,
- sizeof(ut_new->ut_user));
- }
} else if (ut_old != ut_new) {
memcpy(ut_new, ut_old, sizeof(*ut_new));
}
- if (user != NULL)
- strncpy(ut_new->ut_user, user, sizeof(ut_new->ut_user));
+ strncpy(ut_new->ut_user, user, sizeof(ut_new->ut_user));
strncpy(ut_new->ut_line, line, sizeof(ut_new->ut_line));
#if defined(HAVE_STRUCT_UTMP_UT_ID)
utmp_setid(ut_old, ut_new);