dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone
Karel Zak 3fbed7
From ef8c8e117234f135a22ba7180114f0153b2444d8 Mon Sep 17 00:00:00 2001
Karel Zak 991206
From: Karel Zak <kzak@redhat.com>
Karel Zak 991206
Date: Mon, 20 Jun 2016 11:09:02 +0200
Karel Zak 991206
Subject: login: create /var/log/lastlog
Karel Zak 991206
Karel Zak 991206
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=151635
Karel Zak 991206
---
Karel Zak 991206
 login-utils/login.c | 2 +-
Karel Zak 991206
 1 file changed, 1 insertion(+), 1 deletion(-)
Karel Zak 991206
Karel Zak 991206
diff --git a/login-utils/login.c b/login-utils/login.c
Karel Zak 991206
index c6cd340b6..3657f04cd 100644
Karel Zak 991206
--- a/login-utils/login.c
Karel Zak 991206
+++ b/login-utils/login.c
Karel Zak 991206
@@ -662,7 +662,7 @@ static void log_lastlog(struct login_context *cxt)
Karel Zak 991206
 	sa.sa_handler = SIG_IGN;
Karel Zak 991206
 	sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
Karel Zak 991206
 
Karel Zak 991206
-	fd = open(_PATH_LASTLOG, O_RDWR, 0);
Karel Zak 991206
+	fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
Karel Zak 991206
 	if (fd < 0)
Karel Zak 991206
 		goto done;
Karel Zak 991206
 	offset = cxt->pwd->pw_uid * sizeof(ll);
Karel Zak 991206
-- 
Karel Zak 991206
2.34.1
Karel Zak 991206