selinux/libsemanage
Petr Lautrbach 267d4f9bf5 libsemanage: open lock_file with O_RDWR
man 2 flock:
    Since Linux 2.6.12, NFS clients support flock() locks by emulating
    them as fcntl(2) byte-range locks on the entire file.  This means
    that fcntl(2) and  flock()  locks  do  interact with one another
    over NFS.  It also means that in order to place an exclusive lock,
    the file must be opened for writing.

Fixes:
    # semanage fcontext -d -e /home /tmp/testdir
    libsemanage.semanage_get_lock: Error obtaining direct transaction lock at /var/lib/selinux/targeted/semanage.trans.LOCK. (Bad file descriptor).
    OSError: Bad file descriptor

Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
Acked-by: James Carter <jwcart2@gmail.com>
2024-11-15 13:59:07 -05:00
..
example
include
man libsemanage: Optionally allow duplicate declarations 2024-11-15 13:26:44 -05:00
src libsemanage: open lock_file with O_RDWR 2024-11-15 13:59:07 -05:00
tests
utils
.gitignore
LICENSE
Makefile
VERSION