be5bab
diff -up util-linux-2.36/login-utils/login.c.kzak util-linux-2.36/login-utils/login.c
be5bab
--- util-linux-2.36/login-utils/login.c.kzak	2020-07-23 14:13:26.777030764 +0200
be5bab
+++ util-linux-2.36/login-utils/login.c	2020-07-23 14:11:22.793686983 +0200
be5bab
@@ -585,7 +585,7 @@ static void log_lastlog(struct login_con
be5bab
 	sa.sa_handler = SIG_IGN;
be5bab
 	sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
be5bab
 
be5bab
-	fd = open(_PATH_LASTLOG, O_RDWR, 0);
be5bab
+	fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
be5bab
 	if (fd < 0)
be5bab
 		goto done;
be5bab
 	offset = cxt->pwd->pw_uid * sizeof(ll);