cbc4cf
From 2d57cb2d64ba4757dcfd9d0e7ed4873cae8a6fcd Mon Sep 17 00:00:00 2001
cbc4cf
From: Karel Zak <kzak@redhat.com>
cbc4cf
Date: Mon, 20 Jun 2016 11:09:02 +0200
cbc4cf
Subject: [PATCH 0/6] login: create /var/log/lastlog
cbc4cf
cbc4cf
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=151635
cbc4cf
---
cbc4cf
 login-utils/login.c | 2 +-
cbc4cf
 1 file changed, 1 insertion(+), 1 deletion(-)
cbc4cf
cbc4cf
diff --git a/login-utils/login.c b/login-utils/login.c
cbc4cf
index 09ee8f8ea..8c9e43292 100644
cbc4cf
--- a/login-utils/login.c
cbc4cf
+++ b/login-utils/login.c
cbc4cf
@@ -506,7 +506,7 @@ static void log_lastlog(struct login_context *cxt)
cbc4cf
 	sa.sa_handler = SIG_IGN;
cbc4cf
 	sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
cbc4cf
 
cbc4cf
-	fd = open(_PATH_LASTLOG, O_RDWR, 0);
cbc4cf
+	fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
cbc4cf
 	if (fd < 0)
cbc4cf
 		goto done;
cbc4cf
 
cbc4cf
-- 
cbc4cf
2.14.4
cbc4cf