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