]> git.ipfire.org Git - thirdparty/libvirt.git/commit
security: Don't fail if locking a file on NFS mount fails
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Feb 2020 14:38:43 +0000 (15:38 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 25 Feb 2020 10:09:18 +0000 (11:09 +0100)
commitf16663d58f7aab6bf800fcffd34f83f522927897
tree0893302e7a4b8cb246042a653236ce52a2792f52
parent5fddf61351f44e4186c0313d81907024c574201b
security: Don't fail if locking a file on NFS mount fails

The way that our file locking works is that we open() the file we
want to lock and then use fcntl(fd, F_SETLKW, ...) to lock it.
The problem is, we are doing all of these as root which doesn't
work if the file lives on root squashed NFS, because if it does
then the open() fails. The way to resolve this is to make this a
non fatal error and leave callers deal with this (i.e. disable
remembering) - implemented in the previous commit.

https://bugzilla.redhat.com/show_bug.cgi?id=1804672

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/security/security_manager.c