summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-08-15 16:09:20 +0200
committerAndreas K. Huettel <dilfridge@gentoo.org>2020-03-09 11:45:11 +0100
commitc0cdd3dcdb83a0fb5460e23434e37504c4843039 (patch)
treeb51f345d24502d6cdb93d839d247e55ba0fc3e8e
parentlogin: Disarm timer after utmp lock acquisition [BZ #24879] (diff)
downloadglibc-c0cdd3dcdb83a0fb5460e23434e37504c4843039.tar.gz
glibc-c0cdd3dcdb83a0fb5460e23434e37504c4843039.tar.bz2
glibc-c0cdd3dcdb83a0fb5460e23434e37504c4843039.zip
login: Use struct flock64 in utmp [BZ #24880]
Commit 06ab719d30b01da401150068054d3b8ea93dd12f ("Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251)") introduced the use of fcntl64 into the utmp implementation. However, the lock file structure was not updated to struct flock64 at that point. (cherry picked from commit 0d5b2917530ccaf8ad312dfbb7bce69d569c23ad) (cherry picked from commit dbbd748c5f69a2fb4d5d305df2ce15b9e69a46ef)
-rw-r--r--ChangeLog6
-rw-r--r--NEWS1
-rw-r--r--login/utmp_file.c4
3 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a89e56249..85d3e195a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2019-08-15 Florian Weimer <fweimer@redhat.com>
+ [BZ #24880]
+ * login/utmp_file.c (file_locking_failed): Use struct flock64.
+ (file_locking_unlock): Likewise.
+
+2019-08-15 Florian Weimer <fweimer@redhat.com>
+
[BZ #24879]
login: Disarm timer after utmp lock acquisition.
* login/utmp_file.c (struct file_locking): Remove.
diff --git a/NEWS b/NEWS
index 96458cf0b9..8952a8a77d 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ The following bugs are resolved with this release:
7408-2005
[24867] malloc: Remove unwanted leading whitespace in malloc_info
[24879] login: Disarm timer after utmp lock acquisition
+ [24880] login: Use struct flock64 in utmp
[24986] alpha: new getegid, geteuid and getppid syscalls used
unconditionally
[25189] Don't use a custom wrapper macro around __has_include
diff --git a/login/utmp_file.c b/login/utmp_file.c
index f3c528384f..94753e0404 100644
--- a/login/utmp_file.c
+++ b/login/utmp_file.c
@@ -76,7 +76,7 @@ try_file_lock (int fd, int type)
alarm (TIMEOUT);
/* Try to get the lock. */
- struct flock fl =
+ struct flock64 fl =
{
.l_type = type,
fl.l_whence = SEEK_SET,
@@ -103,7 +103,7 @@ try_file_lock (int fd, int type)
static void
file_unlock (int fd)
{
- struct flock fl =
+ struct flock64 fl =
{
.l_type = F_UNLCK,
};