Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information