From ba9feb14c5f5780758b6d62ebb44cd90b99eccc4 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 2 Sep 2023 16:47:13 +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. --- libnetfs/dir-lookup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libnetfs') diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c index d77feac8..23cc1fe1 100644 --- a/libnetfs/dir-lookup.c +++ b/libnetfs/dir-lookup.c @@ -410,7 +410,7 @@ netfs_S_dir_lookup (struct protid *dircred, /* At this point, NP is the node to return. */ gotit: - if (mustbedir) + if (mustbedir || (flags & O_DIRECTORY)) { err = netfs_validate_stat (np, dircred->user); if (err) -- cgit v1.2.3