dcavalca / rpms / util-linux

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