[Qemu-devel] [PATCH] 9pfs: local: remove: use correct path component

Bruce Rogers posted 1 patch 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170619205952.8601-1-brogers@suse.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
hw/9pfs/9p-local.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] 9pfs: local: remove: use correct path component
Posted by Bruce Rogers 6 years, 9 months ago
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>
---
 hw/9pfs/9p-local.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index 1e78b7c9e9..83952eff0a 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -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;
     }
 
-- 
2.12.2


Re: [Qemu-devel] [PATCH] 9pfs: local: remove: use correct path component
Posted by Greg Kurz 6 years, 9 months ago
On Mon, 19 Jun 2017 14:59:52 -0600
Bruce Rogers <brogers@suse.com> wrote:

> Commit a0e640a8 introduced a path processing error.
> Pass fstatat the dirpath based path component instead
> of the entire path.
> 

Good catch. Thanks!

Pushed to https://github.com/gkurz/qemu/commits/9p-next

> Signed-off-by: Bruce Rogers <brogers@suse.com>
> ---
>  hw/9pfs/9p-local.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
> index 1e78b7c9e9..83952eff0a 100644
> --- a/hw/9pfs/9p-local.c
> +++ b/hw/9pfs/9p-local.c
> @@ -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;
>      }
>