util-linux/util-linux-ng-2.13-login-lastlog.patch
Karel Zak fd7089e44b 2.19-0.1: initial import of util-linux
Note that the upstream package has been renamed from util-linux-ng
back to util-linux. The util-linux-ng is obsolete now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-19 09:56:35 +01:00

14 lines
558 B
Diff

Index: util-linux-ng-2.14.2-rc1/login-utils/login.c
===================================================================
--- util-linux-ng-2.14.2-rc1.orig/login-utils/login.c
+++ util-linux-ng-2.14.2-rc1/login-utils/login.c
@@ -1415,7 +1415,7 @@ dolastlog(int quiet) {
struct lastlog ll;
int fd;
- if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) {
+ if ((fd = open(_PATH_LASTLOG, O_RDWR|O_CREAT, 0)) >= 0) {
lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), SEEK_SET);
if (!quiet) {
if (read(fd, (char *)&ll, sizeof(ll)) == sizeof(ll) &&