From 8f25d87e0faaa28595a361e1699c850e42c8b1a7 Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Thu, 14 May 2020 16:08:13 +0300 Subject: ALT: Create /var/log/lastlog Signed-off-by: Alexey Gladkov --- util-linux/login-utils/login.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util-linux/login-utils/login.c b/util-linux/login-utils/login.c index c6cd340b..3657f04c 100644 --- a/util-linux/login-utils/login.c +++ b/util-linux/login-utils/login.c @@ -662,7 +662,7 @@ static void log_lastlog(struct login_context *cxt) sa.sa_handler = SIG_IGN; sigaction(SIGXFSZ, &sa, &oldsa_xfsz); - fd = open(_PATH_LASTLOG, O_RDWR, 0); + fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0); if (fd < 0) goto done; offset = cxt->pwd->pw_uid * sizeof(ll); -- 2.25.4