summaryrefslogtreecommitdiff
path: root/hw/9pfs
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2017-03-06 17:34:01 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-03-16 12:08:50 -0500
commit7e9a1c49145d981e6da03d8e0ec16a329c79f2ca (patch)
treeae6c392727377256fd1f7babbcf5f0db360b721c /hw/9pfs
parent059f751ec27279775f54bac52a2eb35ece6d16cf (diff)
downloadqemu-7e9a1c49145d981e6da03d8e0ec16a329c79f2ca.tar.gz
9pfs: don't use AT_EMPTY_PATH in local_set_cred_passthrough()
The name argument can never be an empty string, and dirfd always point to the containing directory of the file name. AT_EMPTY_PATH is hence useless here. Also it breaks build with glibc version 2.13 and older. It is actually an oversight of a previous tentative patch to implement this function. We can safely drop it. Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Greg Kurz <groug@kaod.org> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Eric Blake <eblake@redhat.com> (cherry picked from commit b314f6a077a1dbc0463a5dc41162f64950048e72) Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs')
-rw-r--r--hw/9pfs/9p-local.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index 09b9b576c0..f282bb7d66 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -349,7 +349,7 @@ static int local_set_cred_passthrough(FsContext *fs_ctx, int dirfd,
const char *name, FsCred *credp)
{
if (fchownat(dirfd, name, credp->fc_uid, credp->fc_gid,
- AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH) < 0) {
+ AT_SYMLINK_NOFOLLOW) < 0) {
/*
* If we fail to change ownership and if we are
* using security model none. Ignore the error