diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-09-02 14:53:59 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-09-02 14:53:59 +0200 |
commit | 8b5b59c704e9edbb0784697ada1df9112fc3e18b (patch) | |
tree | 48696d14cdb3e326d4964748de80a6de47331936 /libnetfs/dir-lookup.c | |
parent | e132a443e5373cc9e404c37b89e2ccc4cb845e8e (diff) | |
download | hurd-8b5b59c704e9edbb0784697ada1df9112fc3e18b.tar.gz hurd-8b5b59c704e9edbb0784697ada1df9112fc3e18b.tar.bz2 hurd-8b5b59c704e9edbb0784697ada1df9112fc3e18b.zip |
S_dir_lookup: Handle O_DIRECTORY
When e.g. looking up a socket with O_DIRECTORY, we should return ENOTDIR
rather than EACCESS.
Diffstat (limited to 'libnetfs/dir-lookup.c')
-rw-r--r-- | libnetfs/dir-lookup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c index d77feac8..dfcb7819 100644 --- a/libnetfs/dir-lookup.c +++ b/libnetfs/dir-lookup.c @@ -39,7 +39,7 @@ netfs_S_dir_lookup (struct protid *dircred, { int create; /* true if O_CREAT flag set */ int excl; /* true if O_EXCL flag set */ - int mustbedir = 0; /* true if the result must be S_IFDIR */ + int mustbedir = (flags & O_DIRECTORY) != 0; /* true if the result must be S_IFDIR */ int lastcomp = 0; /* true if we are at the last component */ int newnode = 0; /* true if this node is newly created */ int nsymlinks = 0; |