Skip to content
Commit 72103e73 authored by Samuel Thibault's avatar Samuel Thibault
Browse files

hurd: Fix O_DIRECTORY | O_NOFOLLOW

Appending / to the path to be looked up would make us always follow a final
symlink, even with O_NOTRANS (since the final resolution is after the
'/').  In the O_DIRECTORY | O_NOFOLLOW case, we thus have to really open
the node and stat it, which we already do anyway, and check for
directory type.

	* hurd/hurdlookup.c (__hurd_file_name_lookup): Do not append '/' to
	path when flags contains O_NOFOLLOW.
	* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Return ENOTDIR
	if flags contains O_DIRECTORY and the result is a directory.
parent 489999cc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment