9pfs: local: remove: use correct path component
authorBruce Rogers <brogers@suse.com>
Thu, 29 Jun 2017 13:11:50 +0000 (15:11 +0200)
committerGreg Kurz <groug@kaod.org>
Thu, 29 Jun 2017 13:11:50 +0000 (15:11 +0200)
Commit a0e640a8 introduced a path processing error.
Pass fstatat the dirpath based path component instead
of the entire path.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
hw/9pfs/9p-local.c

index 1e78b7c9e961505f267f00efd7ff79af18f54c75..83952eff0a111c9d722ff52ad7f0eb5d521e658d 100644 (file)
@@ -1100,7 +1100,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;
     }