Skip to content

Commit

Permalink
Cygwin: make option for native inner link handling.
Browse files Browse the repository at this point in the history
This code has been causing issues with SUBST and mapped network drives,
so add an option (defaulted to on) which can be used to disable it where
needed.  MSYS=nonativeinnerlinks
  • Loading branch information
jeremyd2019 authored and dscho committed Aug 27, 2024
1 parent b9d1fad commit 715f6ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions winsup/cygwin/environ.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static struct parse_thing
{"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
{"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
{"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
{"nativeinnerlinks", {&nativeinnerlinks}, setbool, NULL, {{false}, {true}}},
{"pipe_byte", {&pipe_byte}, setbool, NULL, {{false}, {true}}},
{"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}},
{"reset_com", {&reset_com}, setbool, NULL, {{false}, {true}}},
Expand Down
1 change: 1 addition & 0 deletions winsup/cygwin/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ bool wincmdln = true;
winsym_t allow_winsymlinks = WSYM_deepcopy;
bool disable_pcon;
bool winjitdebug = false;
bool nativeinnerlinks = true;

/* Taken from BSD libc:
This variable is zero until a process has created a pthread. It is used
Expand Down
3 changes: 2 additions & 1 deletion winsup/cygwin/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3722,7 +3722,8 @@ symlink_info::check (char *path, const suffix_info *suffixes, fs_info &fs,
differ, return the final path as symlink content and set symlen
to a negative value. This forces path_conv::check to restart
symlink evaluation with the new path. */
if ((pc_flags & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP)) == PC_SYM_FOLLOW)
if (nativeinnerlinks
&& (pc_flags & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP)) == PC_SYM_FOLLOW)
{
PWCHAR fpbuf = tp.w_get ();
DWORD ret;
Expand Down

0 comments on commit 715f6ce

Please sign in to comment.