]> git.ipfire.org Git - thirdparty/libvirt.git/commit
security driver: ignore EINVAL when chowning an image file
authorLaine Stump <laine@laine.org>
Fri, 3 Jun 2011 15:59:09 +0000 (11:59 -0400)
committerLaine Stump <laine@laine.org>
Fri, 3 Jun 2011 16:27:05 +0000 (12:27 -0400)
commit62ed801c13787cc844e75db7cd2d4c8a42454fcc
treed5c86bc8ef038cb3f94a1804575ebad6b17207c2
parent6b5c589d84565890403028a6df95c985994f2ec6
security driver: ignore EINVAL when chowning an image file

This fixes:

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

Both of these complain of a failure to use an image file that resides
on a read-only NFS volume. The function in the DAC security driver
that chowns image files to the qemu user:group before using them
already has special cases to ignore failure of chown on read-only file
systems, and in a few other cases, but it hadn't been checking for
EINVAL, which is what is returned if the qemu user doesn't even exist
on the NFS server.

Since the explanation of EINVAL in the chown man page almost exactly
matches the log message already present for the case of EOPNOTSUPP,
I've just added EINVAL to that same conditional.
src/security/security_dac.c