]> Git Repo - qemu.git/blobdiff - hw/9pfs/9p-util.h
9pfs: local: fix unlink of alien files in mapped-file mode
[qemu.git] / hw / 9pfs / 9p-util.h
index 091f3ce88e15edb9c323fa903ba0ff54c7d6b70f..517027c5203250950dd9a7fdeb3f1e0720d97a0d 100644 (file)
@@ -22,7 +22,13 @@ static inline void close_preserve_errno(int fd)
 
 static inline int openat_dir(int dirfd, const char *name)
 {
-    return openat(dirfd, name, O_DIRECTORY | O_RDONLY | O_PATH);
+#ifdef O_PATH
+#define OPENAT_DIR_O_PATH O_PATH
+#else
+#define OPENAT_DIR_O_PATH 0
+#endif
+    return openat(dirfd, name,
+                  O_DIRECTORY | O_RDONLY | O_NOFOLLOW | OPENAT_DIR_O_PATH);
 }
 
 static inline int openat_file(int dirfd, const char *name, int flags,
This page took 0.024128 seconds and 4 git commands to generate.