From: Greg Kurz Date: Mon, 6 Mar 2017 16:34:01 +0000 (+0100) Subject: 9pfs: don't use AT_EMPTY_PATH in local_set_cred_passthrough() X-Git-Tag: v2.9.0-rc0~22^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b314f6a077a1dbc0463a5dc41162f64950048e72;p=thirdparty%2Fqemu.git 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 Signed-off-by: Greg Kurz Tested-by: Mark Cave-Ayland Reviewed-by: Eric Blake --- diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 6d16c4a0658..0ca4c94ee4a 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