Skip to content

Commit 420c773

Browse files
committed
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 ff9481f commit 420c773

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
@@ -3850,8 +3850,9 @@ symlink_info::check (char *path, const suffix_info *suffixes, fs_info &fs,
38503850
differ, return the final path as symlink content and set symlen
38513851
to a negative value. This forces path_conv::check to restart
38523852
symlink evaluation with the new path. */
3853-
if ((pc_flags () & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP))
3854-
== PC_SYM_FOLLOW)
3853+
if (nativeinnerlinks
3854+
&& (pc_flags () & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP))
3855+
== PC_SYM_FOLLOW)
38553856
{
38563857
PWCHAR fpbuf = tp.w_get ();
38573858
DWORD ret;

0 commit comments

Comments
 (0)