Cygwin: respect PC_SYM_FOLLOW and PC_SYM_NOFOLLOW_REP with inner links.

The new GetFinalPathNameW handling for native symlinks in inner path
components is disabled if caller doesn't want to follow symlinks, or
doesn't want to follow reparse points.
This commit is contained in:
Jeremy Drake 2021-05-29 11:48:11 -07:00 committed by Corinna Vinschen
parent d0e42141b8
commit 4fca7b0da6
1 changed files with 41 additions and 39 deletions

View File

@ -722,9 +722,10 @@ path_conv::check (const char *src, unsigned opt,
int symlen = 0;
/* Make sure to check certain flags on last component only. */
for (unsigned pc_flags = opt & (PC_NO_ACCESS_CHECK | PC_KEEP_HANDLE);
for (unsigned pc_flags = opt & (PC_NO_ACCESS_CHECK | PC_KEEP_HANDLE
| PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP);
;
pc_flags = 0)
pc_flags = opt & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP))
{
const suffix_info *suff;
char *full_path;
@ -3480,6 +3481,7 @@ restart:
goto file_not_symlink;
}
#endif /* __i386__ */
if ((pc_flags & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP)) == PC_SYM_FOLLOW)
{
PWCHAR fpbuf = tp.w_get ();
DWORD ret;