Skip to contentSkip to conversation

9pfs: local: remove: use correct path component

PATCH Applied Bruce Rogers 2 participants 2 messages Jun 19, 2017 – Jun 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 hw/9pfs/9p-local.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/9pfs/9p-local.c +1 -1
index 1e78b7c9e9..83952eff0a 100644
@@ -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;
     }
 
Signature · 1 line
2.12.2
Applied
#1 lore raw
Quoted 4 lines · On Mon, 19 Jun 2017 14:59:52 -0600 Bruce Rogers <[email protected]> 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

Quoted 18 lines
---
 hw/9pfs/9p-local.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/9pfs/9p-local.c +1 -1
index 1e78b7c9e9..83952eff0a 100644
@@ -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;
     }