Skip to content

Commit 05dc9c9

Browse files
jeremyd2019lazka
authored andcommitted
Cygwin: make option for native inner link handling.
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
1 parent 68991eb commit 05dc9c9

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

winsup/cygwin/environ.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ static struct parse_thing
123123
{"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
124124
{"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
125125
{"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
126+
{"nativeinnerlinks", {&nativeinnerlinks}, setbool, NULL, {{false}, {true}}},
126127
{"pipe_byte", {&pipe_byte}, setbool, NULL, {{false}, {true}}},
127128
{"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}},
128129
{"reset_com", {&reset_com}, setbool, NULL, {{false}, {true}}},

winsup/cygwin/globals.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ bool wincmdln = true;
7474
winsym_t allow_winsymlinks = WSYM_deepcopy;
7575
bool disable_pcon;
7676
bool winjitdebug = false;
77+
bool nativeinnerlinks = true;
7778

7879
/* Taken from BSD libc:
7980
This variable is zero until a process has created a pthread. It is used

winsup/cygwin/path.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3721,7 +3721,8 @@ symlink_info::check (char *path, const suffix_info *suffixes, fs_info &fs,
37213721
differ, return the final path as symlink content and set symlen
37223722
to a negative value. This forces path_conv::check to restart
37233723
symlink evaluation with the new path. */
3724-
if ((pc_flags & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP)) == PC_SYM_FOLLOW)
3724+
if (nativeinnerlinks
3725+
&& (pc_flags & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP)) == PC_SYM_FOLLOW)
37253726
{
37263727
PWCHAR fpbuf = tp.w_get ();
37273728
DWORD ret;

0 commit comments

Comments
 (0)