[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 4/6] 9pfs: don't use AT_EMPTY_PATH in local_set_cred_
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PULL 4/6] 9pfs: don't use AT_EMPTY_PATH in local_set_cred_passthrough() |
Date: |
Mon, 6 Mar 2017 18:54:08 +0100 |
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 <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Tested-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
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 6d16c4a06587..0ca4c94ee4a8 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
--
2.7.4
- [Qemu-devel] [PULL 0/6] 9pfs fixes for 2.9 2017-03-06, Greg Kurz, 2017/03/06
- [Qemu-devel] [PULL 1/6] 9pfs: fix bogus fd check in local_remove(), Greg Kurz, 2017/03/06
- [Qemu-devel] [PULL 2/6] 9pfs: fix fd leak in local_opendir(), Greg Kurz, 2017/03/06
- [Qemu-devel] [PULL 3/6] 9pfs: fail local_statfs() earlier, Greg Kurz, 2017/03/06
- [Qemu-devel] [PULL 5/6] 9pfs: fix O_PATH build break with older glibc versions, Greg Kurz, 2017/03/06
- [Qemu-devel] [PULL 4/6] 9pfs: don't use AT_EMPTY_PATH in local_set_cred_passthrough(),
Greg Kurz <=
- [Qemu-devel] [PULL 6/6] 9pfs: fix vulnerability in openat_dir() and local_unlinkat_common(), Greg Kurz, 2017/03/06
- Re: [Qemu-devel] [PULL 0/6] 9pfs fixes for 2.9 2017-03-06, Mark Cave-Ayland, 2017/03/06
- Re: [Qemu-devel] [PULL 0/6] 9pfs fixes for 2.9 2017-03-06, Peter Maydell, 2017/03/07