This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/24902] login: Repeating pututxline on EINTR/EAGAIN causes stale utmp entries


https://sourceware.org/bugzilla/show_bug.cgi?id=24902

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.30/master branch has been updated by Florian Weimer
<fw@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f0cd1cfbe37eed659df75cad3b5a58ad386d0fe6

commit f0cd1cfbe37eed659df75cad3b5a58ad386d0fe6
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Aug 28 11:59:45 2019 +0200

    login: pututxline could fail to overwrite existing entries [BZ #24902]

    The internal_getut_r function updates the file_offset variable and
    therefore must always update last_entry as well.

    Previously, if pututxline could not upgrade the read lock to a
    write lock, internal_getut_r would update file_offset only,
    without updating last_entry, and a subsequent call would not
    overwrite the existing utmpx entry at file_offset, instead
    creating a new entry.  This has been observed to cause unbounded
    file growth in high-load situations.

    This commit removes the buffer argument to internal_getut_r and
    updates the last_entry variable directly, along with file_offset.

    Initially reported and fixed by Ondřej Lysoněk.

    Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
    (cherry picked from commit 61d3db428176d9d0822e4e680305fe34285edff2)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]