Skip to content

Commit c6208de

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 4148d00 commit c6208de

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
@@ -3834,8 +3834,9 @@ symlink_info::check (char *path, const suffix_info *suffixes, fs_info &fs,
38343834
differ, return the final path as symlink content and set symlen
38353835
to a negative value. This forces path_conv::check to restart
38363836
symlink evaluation with the new path. */
3837-
if ((pc_flags () & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP))
3838-
== PC_SYM_FOLLOW)
3837+
if (nativeinnerlinks
3838+
&& (pc_flags () & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP))
3839+
== PC_SYM_FOLLOW)
38393840
{
38403841
PWCHAR fpbuf = tp.w_get ();
38413842
DWORD ret;

0 commit comments

Comments
 (0)