Skip to content

Commit 5733e91

Browse files
jeremyd2019dscho
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 e30cdeb commit 5733e91

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3845,8 +3845,9 @@ symlink_info::check (char *path, const suffix_info *suffixes, fs_info &fs,
38453845
differ, return the final path as symlink content and set symlen
38463846
to a negative value. This forces path_conv::check to restart
38473847
symlink evaluation with the new path. */
3848-
if ((pc_flags () & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP))
3849-
== PC_SYM_FOLLOW)
3848+
if (nativeinnerlinks
3849+
&& (pc_flags () & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP))
3850+
== PC_SYM_FOLLOW)
38503851
{
38513852
PWCHAR fpbuf = tp.w_get ();
38523853
DWORD ret;

0 commit comments

Comments
 (0)