From: Bruce Rogers Date: Thu, 29 Jun 2017 13:11:50 +0000 (+0200) Subject: 9pfs: local: remove: use correct path component X-Git-Tag: v2.9.1~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0398ccdf42e5a54c62ae617d374b5df9684ac0d;p=thirdparty%2Fqemu.git 9pfs: local: remove: use correct path component Commit a0e640a8 introduced a path processing error. Pass fstatat the dirpath based path component instead of the entire path. Signed-off-by: Bruce Rogers Signed-off-by: Greg Kurz (cherry picked from commit 790db7efdbe1536acf1c4f4f95a0316dbda59433) Signed-off-by: Michael Roth --- diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 7a0c383e7e8..b13ff2120e7 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1009,7 +1009,7 @@ static int local_remove(FsContext *ctx, const char *path) goto out; } - if (fstatat(dirfd, path, &stbuf, AT_SYMLINK_NOFOLLOW) < 0) { + if (fstatat(dirfd, name, &stbuf, AT_SYMLINK_NOFOLLOW) < 0) { goto err_out; }