diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-11-23 01:09:23 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-11-23 01:09:23 +0100 |
commit | 6d4c0cc98179b3030ddd67050fb65cdfe816f511 (patch) | |
tree | 58251c93b4188bc1c7fc295e983564bc514336cc | |
parent | c4deaafeef8eea8faaffbf20acc8f302df1c456d (diff) | |
parent | 8ee41e99502f3983fcfb75d9a88cd3dbcc4de78d (diff) |
Merge branch 't/NOFOLLOW-DIRECTORY' into refs/top-bases/tschwinge/Roger_Whittaker
-rw-r--r-- | hurd/hurdlookup.c | 2 | ||||
-rw-r--r-- | hurd/lookup-retry.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/hurd/hurdlookup.c b/hurd/hurdlookup.c index dbff009539..bd720c27ec 100644 --- a/hurd/hurdlookup.c +++ b/hurd/hurdlookup.c @@ -72,7 +72,7 @@ __hurd_file_name_lookup (error_t (*use_init_port) if (flags & O_NOFOLLOW) /* See lookup-retry.c about O_NOFOLLOW. */ flags |= O_NOTRANS; - if (flags & O_DIRECTORY) + if (flags & O_DIRECTORY && !(flags & O_NOFOLLOW)) { /* The caller wants to require that the file we look up is a directory. We can do this without an extra RPC by appending a trailing slash diff --git a/hurd/lookup-retry.c b/hurd/lookup-retry.c index b7a6a2b2a5..d37295972b 100644 --- a/hurd/lookup-retry.c +++ b/hurd/lookup-retry.c @@ -147,6 +147,8 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port) err = __io_stat (*result, &st); if (!err) { + if (flags & O_DIRECTORY && !S_ISDIR(st.st_mode)) + err = ENOTDIR; if (S_ISLNK(st.st_mode)) err = ELOOP; else if (st.st_mode & (S_IPTRANS|S_IATRANS)) |