From 8b5b59c704e9edbb0784697ada1df9112fc3e18b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 2 Sep 2023 14:53:59 +0200 Subject: S_dir_lookup: Handle O_DIRECTORY When e.g. looking up a socket with O_DIRECTORY, we should return ENOTDIR rather than EACCESS. --- libdiskfs/dir-lookup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdiskfs/dir-lookup.c') diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c index 8df81cfa..30e2a2e3 100644 --- a/libdiskfs/dir-lookup.c +++ b/libdiskfs/dir-lookup.c @@ -51,7 +51,7 @@ diskfs_S_dir_lookup (struct protid *dircred, int lastcomp = 0; int newnode = 0; struct dirstat *ds = 0; - int mustbedir = 0; + int mustbedir = (flags & O_DIRECTORY) != 0; mach_msg_type_name_t amt; int type; struct protid *newpi = 0; -- cgit v1.2.3