[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] 9pfs: local: Do not follow symlink in _nofollow
From: |
Akihiko Odaki |
Subject: |
[PATCH] 9pfs: local: Do not follow symlink in _nofollow |
Date: |
Wed, 27 Apr 2022 11:45:45 +0900 |
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.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 d42ce6d8b82..def8afdb4d6 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -365,7 +365,7 @@ static int fchmodat_nofollow(int dirfd, const char *name,
mode_t mode)
if (fd == -1) {
/* In case the file is writable-only and isn't a directory. */
if (errno == EACCES) {
- fd = openat_file(dirfd, name, O_WRONLY, 0);
+ fd = openat_file(dirfd, name, O_WRONLY | O_NOFOLLOW, 0);
}
if (fd == -1 && errno == EISDIR) {
errno = EACCES;
--
2.32.0 (Apple Git-132)
- [PATCH] 9pfs: local: Do not follow symlink in _nofollow,
Akihiko Odaki <=