Cygwin: path_conv: add PATH_RESOLVE_PROCFD path_types flag

path_conv now sets the PATH_RESOLVE_PROCFD flag in path_flags if
the PC_SYM_NOFOLLOW_PROCFD pathconv_arg flag has been set on input
*and* the file is actually a proc fd symlink.

Add matching path_conv::follow_fd_symlink method for checking and
use it in open(2).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-01-06 20:13:52 +01:00
parent c1023ee353
commit ba12614f79
3 changed files with 10 additions and 5 deletions

View File

@@ -69,6 +69,7 @@ enum path_types
PATH_REP = _BIT ( 3),
PATH_SYMLINK = _BIT ( 4),
PATH_SOCKET = _BIT ( 5),
PATH_RESOLVE_PROCFD = _BIT ( 6),
PATH_DONT_USE = _BIT (31) /* conversion to signed happens. */
};
@@ -192,6 +193,7 @@ class path_conv
int iscygexec () const {return mount_flags & MOUNT_CYGWIN_EXEC;}
int isopen () const {return path_flags & PATH_OPEN;}
int isctty_capable () const {return path_flags & PATH_CTTY;}
int follow_fd_symlink () const {return path_flags & PATH_RESOLVE_PROCFD;}
void set_cygexec (bool isset)
{
if (isset)