msys2-runtime: Update to Cygwin's 3.0.6 release

This commit is contained in:
Alexey Pavlov
2019-04-15 10:53:36 +03:00
parent bf04269542
commit d9310fcb58
24 changed files with 576 additions and 830 deletions

View File

@@ -1,7 +1,8 @@
From c6e852c312b4055dda07543ebc12b6f3ea00769f Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Tue, 5 Apr 2016 10:15:20 +0300
Subject: [PATCH 02/23] Rename DLL from cygwin to msys
From ac95174200f8ea719c2fc022993d42216ef013c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:09:17 +0300
Subject: [PATCH 02/15] Rename dll from cygwin to msys
---
winsup/Makefile.in | 4 +--
@@ -21,6 +22,7 @@ Subject: [PATCH 02/23] Rename DLL from cygwin to msys
winsup/cygwin/dll_init.cc | 8 +++++
winsup/cygwin/dtable.cc | 6 ++++
winsup/cygwin/exceptions.cc | 4 +--
winsup/cygwin/fhandler_pipe.cc | 4 +++
winsup/cygwin/fhandler_tty.cc | 12 +++++++
winsup/cygwin/fork.cc | 2 +-
winsup/cygwin/hookapi.cc | 4 +++
@@ -32,11 +34,10 @@ Subject: [PATCH 02/23] Rename DLL from cygwin to msys
winsup/cygwin/lib/cygwin_attach_dll.c | 8 +++++
winsup/cygwin/lib/cygwin_crt0.c | 8 +++++
winsup/cygwin/mkvers.sh | 6 ++--
winsup/cygwin/pinfo.cc | 4 +--
winsup/cygwin/pipe.cc | 4 +++
winsup/cygwin/pinfo.cc | 2 +-
winsup/cygwin/pseudo-reloc.cc | 2 +-
winsup/cygwin/sec_auth.cc | 10 +++---
winsup/cygwin/syscalls.cc | 4 +--
winsup/cygwin/sec_auth.cc | 16 ++++-----
winsup/cygwin/syscalls.cc | 2 +-
winsup/cygwin/syslog.cc | 4 +++
winsup/cygwin/winsup.h | 4 +++
winsup/cygwin/winver.rc | 2 +-
@@ -56,7 +57,7 @@ Subject: [PATCH 02/23] Rename DLL from cygwin to msys
winsup/utils/path.cc | 12 +++----
winsup/utils/ssp.c | 8 ++---
winsup/utils/strace.cc | 11 +++---
52 files changed, 248 insertions(+), 136 deletions(-)
52 files changed, 249 insertions(+), 137 deletions(-)
diff --git a/winsup/Makefile.in b/winsup/Makefile.in
index 148d98531..81ce93c70 100644
@@ -115,7 +116,7 @@ index e101623d2..66272bc86 100644
/* Named pipes based transport, for security on NT */
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index 966460da8..beedc7c5e 100644
index b687d922d..a3a4ee4fd 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -106,17 +106,17 @@ RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
@@ -151,7 +152,7 @@ index 966460da8..beedc7c5e 100644
--exclude='(?i:dll)' \
--exclude='reloc' \
--exclude='^main$$' \
@@ -543,7 +544,7 @@ endif
@@ -550,7 +551,7 @@ endif
API_VER:=$(srcdir)/include/cygwin/version.h
@@ -160,7 +161,7 @@ index 966460da8..beedc7c5e 100644
SUBLIBS:=libpthread.a libutil.a ${CURDIR}/libm.a ${CURDIR}/libc.a libdl.a libresolv.a librt.a libacl.a libssp.a
EXTRALIBS:=libautomode.a libbinmode.a libtextmode.a libtextreadmode.a
INSTOBJS:=automode.o binmode.o textmode.o textreadmode.o
@@ -593,7 +594,8 @@ install-libs: $(TARGET_LIBS)
@@ -600,7 +601,8 @@ install-libs: $(TARGET_LIBS)
for i in $^; do \
$(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/lib/`basename $$i` ; \
done
@@ -170,7 +171,7 @@ index 966460da8..beedc7c5e 100644
install-headers:
cd $(srcdir); \
@@ -658,7 +660,7 @@ uninstall-man:
@@ -665,7 +667,7 @@ uninstall-man:
done
clean distclean realclean:
@@ -179,7 +180,7 @@ index 966460da8..beedc7c5e 100644
-@$(MAKE) -C ${cygserver_blddir} libclean
maintainer-clean: clean
@@ -671,29 +673,29 @@ maintainer-clean: clean
@@ -678,29 +680,29 @@ maintainer-clean: clean
$(LDSCRIPT): $(LDSCRIPT).in
$(CC) -E - -P < $^ -o $@
@@ -218,7 +219,7 @@ index 966460da8..beedc7c5e 100644
$(LIBSERVER): ${cygserver_blddir}/Makefile
$(MAKE) -C ${cygserver_blddir} libcygserver.a
diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index d1d955542..0e003dfa8 100644
index 68b95d470..fb3cb8f29 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -382,8 +382,8 @@ cygwin_attach_handle_to_fd SIGFE
@@ -335,10 +336,10 @@ index fc1576b05..b2975111c 100644
#ifndef __INSIDE_CYGWIN__
class transport_layer_base;
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index 4404e4a19..db5858646 100644
index 66a317934..11c21d8ba 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -168,7 +168,7 @@ new (size_t)
@@ -170,7 +170,7 @@ new (size_t)
}
#ifdef DEBUGGING
@@ -392,7 +393,7 @@ index 134ae3f76..d390a51ec 100644
BYTE(0) /* d */
BYTE(0) /* b */
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index af5eaaca7..7a23e0320 100644
index fb726a739..9d9bf2b27 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -377,21 +377,21 @@ check_sanity_and_sync (per_process *p)
@@ -436,7 +437,7 @@ index af5eaaca7..7a23e0320 100644
{
char buf1[PATH_MAX];
GetModuleFileName (NULL, buf1, PATH_MAX);
@@ -1101,7 +1101,11 @@ dll_crt0 (per_process *uptr)
@@ -1111,7 +1111,11 @@ dll_crt0 (per_process *uptr)
See winsup/testsuite/cygload for an example of how to use cygwin1.dll
from MSVC and non-cygwin MinGW applications. */
extern "C" void
@@ -448,7 +449,7 @@ index af5eaaca7..7a23e0320 100644
{
#ifdef __i386__
static char **envp;
@@ -1314,7 +1318,7 @@ multiple_cygwin_problem (const char *what, uintptr_t magic_version, uintptr_t ve
@@ -1324,7 +1328,7 @@ multiple_cygwin_problem (const char *what, uintptr_t magic_version, uintptr_t ve
return;
}
@@ -457,7 +458,7 @@ index af5eaaca7..7a23e0320 100644
return;
if (CYGWIN_VERSION_MAGIC_VERSION (magic_version) == version)
@@ -1334,7 +1338,7 @@ are unable to find another cygwin DLL.",
@@ -1344,7 +1348,7 @@ are unable to find another cygwin DLL.",
void __reg1
cygbench (const char *s)
{
@@ -467,7 +468,7 @@ index af5eaaca7..7a23e0320 100644
}
#endif
diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc
index 7ef7dfd32..eeec7fbe7 100644
index c675a5785..ae393b8ad 100644
--- a/winsup/cygwin/dlfcn.cc
+++ b/winsup/cygwin/dlfcn.cc
@@ -148,8 +148,13 @@ collect_basenames (pathfinder::basenamelist & basenames,
@@ -485,10 +486,10 @@ index 7ef7dfd32..eeec7fbe7 100644
/* ... using original basename with new suffix. */
basenames.appendv (basename, baselen, ext, extlen, NULL);
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 549e5cccd..cbb79576a 100644
index 4baa48dc1..1db89b70a 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -730,14 +730,22 @@ dll_dllcrt0_1 (VOID *x)
@@ -888,14 +888,22 @@ dll_dllcrt0_1 (VOID *x)
future. Cygwin can now handle being loaded from a noncygwin app
using the same entry point. */
extern "C" int
@@ -512,10 +513,10 @@ index 549e5cccd..cbb79576a 100644
HANDLE retaddr;
if (_my_tls.isinitialized ())
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 0ebeef058..3d6ebc06f 100644
index 636221a77..7c7337804 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -965,9 +965,15 @@ handle_to_fn (HANDLE h, char *posix_fn)
@@ -974,9 +974,15 @@ handle_to_fn (HANDLE h, char *posix_fn)
if (wcsncasecmp (w32, DEV_NAMED_PIPE, DEV_NAMED_PIPE_LEN) == 0)
{
w32 += DEV_NAMED_PIPE_LEN;
@@ -532,10 +533,10 @@ index 0ebeef058..3d6ebc06f 100644
w32len = cygheap->installation_key.Length / sizeof (WCHAR);
if (w32len
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 419b0976f..2cdfed770 100644
index 1765f43b5..ea1550bc2 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -500,14 +500,14 @@ try_to_debug (bool waitloop)
@@ -501,14 +501,14 @@ try_to_debug (bool waitloop)
PWCHAR rawenv = GetEnvironmentStringsW () ;
for (PWCHAR p = rawenv; *p != L'\0'; p = wcschr (p, L'\0') + 1)
{
@@ -552,8 +553,24 @@ index 419b0976f..2cdfed770 100644
}
break;
}
diff --git a/winsup/cygwin/fhandler_pipe.cc b/winsup/cygwin/fhandler_pipe.cc
index edbaded68..fea4bb7b0 100644
--- a/winsup/cygwin/fhandler_pipe.cc
+++ b/winsup/cygwin/fhandler_pipe.cc
@@ -201,7 +201,11 @@ fhandler_pipe::dup (fhandler_base *child, int flags)
return res;
}
+#ifdef __MSYS__
+#define PIPE_INTRO "\\\\.\\pipe\\msys-"
+#else
#define PIPE_INTRO "\\\\.\\pipe\\cygwin-"
+#endif
/* Create a pipe, and return handles to the read and write ends,
just like CreatePipe, but ensure that the write end permits
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 7fe46ebef..81618b15b 100644
index 312c2d083..6875f97a5 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -464,7 +464,11 @@ fhandler_pty_slave::open (int flags, mode_t)
@@ -593,10 +610,10 @@ index 7fe46ebef..81618b15b 100644
master_ctl = CreateNamedPipe (buf, PIPE_ACCESS_DUPLEX
| FILE_FLAG_FIRST_PIPE_INSTANCE,
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index c6fef6755..fbac1f904 100644
index 7e1c08990..e51b5c666 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -160,7 +160,7 @@ frok::child (volatile char * volatile here)
@@ -158,7 +158,7 @@ frok::child (volatile char * volatile here)
char buf[80];
/* This is useful for debugging fork problems. Use gdb to attach to
the pid reported here. */
@@ -622,7 +639,7 @@ index 4078e65bd..3c992bb6b 100644
if (!fn)
{
diff --git a/winsup/cygwin/i686.din b/winsup/cygwin/i686.din
index 934243bbc..515e8e63f 100644
index 174e73dd0..b514a41c2 100644
--- a/winsup/cygwin/i686.din
+++ b/winsup/cygwin/i686.din
@@ -1,4 +1,4 @@
@@ -631,7 +648,7 @@ index 934243bbc..515e8e63f 100644
EXPORTS
#Exported variables
@@ -596,7 +596,7 @@ cygwin32_conv_to_full_posix_path = cygwin_conv_to_full_posix_path SIGFE
@@ -595,7 +595,7 @@ cygwin32_conv_to_full_posix_path = cygwin_conv_to_full_posix_path SIGFE
cygwin32_conv_to_full_win32_path = cygwin_conv_to_full_win32_path SIGFE
cygwin32_conv_to_posix_path = cygwin_conv_to_posix_path SIGFE
cygwin32_conv_to_win32_path = cygwin_conv_to_win32_path SIGFE
@@ -640,7 +657,7 @@ index 934243bbc..515e8e63f 100644
cygwin32_internal = cygwin_internal SIGFE
cygwin32_posix_path_list_p = cygwin_posix_path_list_p NOSIGFE
cygwin32_posix_to_win32_path_list = cygwin_posix_to_win32_path_list SIGFE
@@ -614,7 +614,7 @@ cygwin_posix_to_win32_path_list_buf_size SIGFE
@@ -613,7 +613,7 @@ cygwin_posix_to_win32_path_list_buf_size SIGFE
cygwin_win32_to_posix_path_list SIGFE
cygwin_win32_to_posix_path_list_buf_size SIGFE
dll_entry@12 NOSIGFE
@@ -704,10 +721,10 @@ index 56b4363ce..6bc948a08 100644
#endif /* __CYGWIN_CYGWIN_DLL_H__ */
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 5a53a1d86..82a80fc12 100644
index bb4ffe771..b5e841f51 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -516,7 +516,11 @@ details. */
@@ -526,7 +526,11 @@ details. */
names include the CYGWIN_VERSION_SHARED_DATA version as well as this
identifier. */
@@ -719,7 +736,7 @@ index 5a53a1d86..82a80fc12 100644
/* The Cygwin mount table interface in the Win32 registry also has a version
number associated with it in case that is changed in a non-backwards
@@ -532,7 +536,11 @@ details. */
@@ -542,7 +546,11 @@ details. */
/* Identifiers used in the Win32 registry. */
@@ -808,7 +825,7 @@ index 776e7e8de..3e1eda1bd 100644
_dll_crt0 (); /* Jump into the dll, never to return */
}
diff --git a/winsup/cygwin/mkvers.sh b/winsup/cygwin/mkvers.sh
index 5aecb141b..15eddda81 100755
index b2db73cc7..ee99dd0c9 100755
--- a/winsup/cygwin/mkvers.sh
+++ b/winsup/cygwin/mkvers.sh
@@ -133,7 +133,7 @@ fi
@@ -820,7 +837,7 @@ index 5aecb141b..15eddda81 100755
EOF
done | tee /tmp/mkvers.$$ 1>&9
@@ -151,9 +151,9 @@ fi
@@ -152,9 +152,9 @@ fi
#
cat <<EOF 1>&9
#ifdef DEBUGGING
@@ -833,7 +850,7 @@ index 5aecb141b..15eddda81 100755
"END_CYGWIN_VERSION_INFO\n\0";
cygwin_version_info cygwin_version =
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 6b6986c9e..f4ca03299 100644
index d002268ed..1b8c84254 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -188,7 +188,7 @@ pinfo::maybe_set_exit_code_from_windows ()
@@ -845,31 +862,6 @@ index 6b6986c9e..f4ca03299 100644
self->pid, oexitcode, x, self->exitcode);
}
@@ -357,7 +357,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
if (procinfo->process_state & PID_EXECED)
{
pid_t realpid = procinfo->pid;
- debug_printf ("execed process windows pid %u, cygwin pid %d", n, realpid);
+ debug_printf ("execed process windows pid %u, MSYS pid %d", n, realpid);
if (realpid == n)
api_fatal ("retrieval of execed process info for pid %d failed due to recursion.", n);
diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc
index f1eace6a6..071e09221 100644
--- a/winsup/cygwin/pipe.cc
+++ b/winsup/cygwin/pipe.cc
@@ -197,7 +197,11 @@ fhandler_pipe::dup (fhandler_base *child, int flags)
return res;
}
+#ifdef __MSYS__
+#define PIPE_INTRO "\\\\.\\pipe\\msys-"
+#else
#define PIPE_INTRO "\\\\.\\pipe\\cygwin-"
+#endif
/* Create a pipe, and return handles to the read and write ends,
just like CreatePipe, but ensure that the write end permits
diff --git a/winsup/cygwin/pseudo-reloc.cc b/winsup/cygwin/pseudo-reloc.cc
index c250fdc01..a230b35e6 100644
--- a/winsup/cygwin/pseudo-reloc.cc
@@ -884,10 +876,10 @@ index c250fdc01..a230b35e6 100644
va_list args;
diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc
index d4c2701da..600129928 100644
index 83fb39bc5..c93e82293 100644
--- a/winsup/cygwin/sec_auth.cc
+++ b/winsup/cygwin/sec_auth.cc
@@ -764,7 +764,7 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern)
@@ -848,7 +848,7 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern)
if (!NT_SUCCESS (status))
debug_printf ("NtQueryInformationToken(), %y", status);
else
@@ -896,7 +888,7 @@ index d4c2701da..600129928 100644
}
/* Verify usersid */
cygsid tok_usersid (NO_SID);
@@ -882,7 +882,7 @@ create_token (cygsid &usersid, user_groups &new_groups)
@@ -992,7 +992,7 @@ create_token (cygsid &usersid, user_groups &new_groups)
TOKEN_DEFAULT_DACL dacl = {};
TOKEN_SOURCE source;
TOKEN_STATISTICS stats;
@@ -905,16 +897,16 @@ index d4c2701da..600129928 100644
source.SourceIdentifier.HighPart = 0;
source.SourceIdentifier.LowPart = 0x0101;
@@ -1036,7 +1036,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups)
@@ -1151,7 +1151,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups)
push_self_privilege (SE_TCB_PRIVILEGE, true);
/* Register as logon process. */
- RtlInitAnsiString (&name, "Cygwin");
+ RtlInitAnsiString (&name, "MSYS");
SetLastError (0);
status = LsaRegisterLogonProcess (&name, &lsa_hdl, &sec_mode);
if (status != STATUS_SUCCESS)
@@ -1065,10 +1065,10 @@ lsaauth (cygsid &usersid, user_groups &new_groups)
{
@@ -1174,10 +1174,10 @@ lsaauth (cygsid &usersid, user_groups &new_groups)
goto out;
/* Create origin. */
@@ -927,28 +919,42 @@ index d4c2701da..600129928 100644
ts.SourceIdentifier.HighPart = 0;
ts.SourceIdentifier.LowPart = 0x0103;
@@ -1526,7 +1526,7 @@ s4uauth (bool logon, PCWSTR domain, PCWSTR user, NTSTATUS &ret_status)
{
/* Register as logon process. */
debug_printf ("Impersonation requested");
- RtlInitAnsiString (&name, "Cygwin");
+ RtlInitAnsiString (&name, "MSYS");
status = LsaRegisterLogonProcess (&name, &lsa_hdl, &sec_mode);
}
else
@@ -1565,11 +1565,11 @@ s4uauth (bool logon, PCWSTR domain, PCWSTR user, NTSTATUS &ret_status)
}
/* Create origin. */
- stpcpy (origin.buf, "Cygwin");
+ stpcpy (origin.buf, "MSYS");
RtlInitAnsiString (&origin.str, origin.buf);
/* Create token source. */
- memcpy (ts.SourceName, "Cygwin.1", 8);
+ memcpy (ts.SourceName, "MSYS.1", 8);
ts.SourceIdentifier.HighPart = 0;
ts.SourceIdentifier.LowPart = kerberos_auth ? 0x0105 : 0x0106;
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 6d1085539..a81ce6ebd 100644
index a914ae8a9..beeba6ea2 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -331,7 +331,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access, ULONG flags)
/* Create hopefully unique filename.
Since we have to stick to the current directory on remote shares, make
the new filename at least very unlikely to match by accident. It starts
- with ".cyg", with "cyg" transposed into the Unicode low surrogate area
+ with ".msys", with "msys" transposed into the Unicode low surrogate area
starting at U+dc00. Use plain ASCII chars on filesystems not supporting
Unicode. The rest of the filename is the inode number in hex encoding
and a hash of the full NT path in hex. The combination allows to remove
@@ -340,7 +340,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access, ULONG flags)
RtlAppendUnicodeToString (&recycler,
(pc.fs_flags () & FILE_UNICODE_ON_DISK
&& !pc.fs_is_samba ())
- ? L".\xdc63\xdc79\xdc67" : L".cyg");
+ ? L".\xdc73\xdc6d\xdc79\xdc6d" : L".msys");
pfii = (PFILE_INTERNAL_INFORMATION) infobuf;
/* Note: Modern Samba versions apparently don't like buffer sizes of more
than 65535 in some NtQueryInformationFile/NtSetInformationFile calls.
@@ -335,7 +335,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access, ULONG flags)
RtlAppendUnicodeToString (&recycler,
(pc.fs_flags () & FILE_UNICODE_ON_DISK
&& !pc.fs_is_samba ())
- ? L".\xdc63\xdc79\xdc67" : L".cyg");
+ ? L".\xdc73\xdc6d\xdc79\xdc6d" : L".msys");
pfii = (PFILE_INTERNAL_INFORMATION) infobuf;
status = NtQueryInformationFile (fh, &io, pfii, sizeof *pfii,
FileInternalInformation);
diff --git a/winsup/cygwin/syslog.cc b/winsup/cygwin/syslog.cc
index 6a295501f..431f9d239 100644
--- a/winsup/cygwin/syslog.cc
@@ -966,7 +972,7 @@ index 6a295501f..431f9d239 100644
static struct
{
diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h
index d5babd6cd..ff4d778e5 100644
index 95ab41e6b..084255f81 100644
--- a/winsup/cygwin/winsup.h
+++ b/winsup/cygwin/winsup.h
@@ -162,7 +162,11 @@ extern "C" void _pei386_runtime_relocator (per_process *);
@@ -1164,7 +1170,7 @@ index 639096267..769b7c0c6 100644
verbose -log "$rv"
fail "$testcase (compile)"
diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in
index be525d07f..b9cc98511 100644
index b64f457e7..49bb7ddb6 100644
--- a/winsup/utils/Makefile.in
+++ b/winsup/utils/Makefile.in
@@ -48,7 +48,7 @@ EXEEXT_FOR_BUILD:=@EXEEXT_FOR_BUILD@
@@ -1402,7 +1408,7 @@ index c83b76478..42ffbfdc0 100644
wcscpy (dllpath, sysdir);
wcscpy (dllpath + sysdir_len, dll);
diff --git a/winsup/utils/path.cc b/winsup/utils/path.cc
index 17ea3524d..d0d4cab83 100644
index d8c208123..2877d8de7 100644
--- a/winsup/utils/path.cc
+++ b/winsup/utils/path.cc
@@ -598,14 +598,14 @@ read_mounts ()
@@ -1467,7 +1473,7 @@ index 548b89ac8..09ee26d01 100644
"The \"-b\" means 'skip the help pages'. You can omit this until you're\n"
"familiar with the report layout. The gprof documentation explains\n"
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index 21c0835d4..bf507981a 100644
index c8b2e2cf5..5e6eebd63 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -283,7 +283,7 @@ load_cygwin ()
@@ -1500,7 +1506,7 @@ index 21c0835d4..bf507981a 100644
_putenv (newenv);
ret = CreateProcess (0, one_line.buf, /* command line */
NULL, /* Security */
@@ -794,7 +793,7 @@ dotoggle (pid_t pid)
@@ -817,7 +816,7 @@ dotoggle (pid_t pid)
child_pid = (DWORD) cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid);
if (!child_pid)
{
@@ -1510,5 +1516,5 @@ index 21c0835d4..bf507981a 100644
}
if (cygwin_internal (CW_STRACE_TOGGLE, child_pid))
--
2.18.0
2.21.0

View File

@@ -1,7 +1,8 @@
From a43140231840fceeb9d0263e808214f1f8d4edaf Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Thu, 12 Mar 2015 13:58:27 +0300
Subject: [PATCH 03/23] Add functionality for converting UNIX paths in
From 1de329f6bd4fd3c6d9921b11effd242af1622f51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:17:46 +0300
Subject: [PATCH 03/15] Add functionality for converting UNIX paths in
arguments and environment variables to Windows form for native Win32
applications.
@@ -11,20 +12,20 @@ Subject: [PATCH 03/23] Add functionality for converting UNIX paths in
winsup/cygwin/environ.h | 2 +-
winsup/cygwin/external.cc | 2 +-
winsup/cygwin/include/sys/cygwin.h | 6 +
winsup/cygwin/msys2_path_conv.cc | 619 +++++++++++++++++++++++++++++
winsup/cygwin/msys2_path_conv.h | 146 +++++++
winsup/cygwin/path.cc | 64 +++
winsup/cygwin/msys2_path_conv.cc | 630 +++++++++++++++++++++++++++++
winsup/cygwin/msys2_path_conv.h | 147 +++++++
winsup/cygwin/path.cc | 69 ++++
winsup/cygwin/spawn.cc | 48 ++-
winsup/cygwin/winf.h | 4 +
10 files changed, 899 insertions(+), 9 deletions(-)
10 files changed, 916 insertions(+), 9 deletions(-)
create mode 100644 winsup/cygwin/msys2_path_conv.cc
create mode 100644 winsup/cygwin/msys2_path_conv.h
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index beedc7c5e..b7ef34b3a 100644
index a3a4ee4fd..ada012adc 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -338,6 +338,7 @@ DLL_OFILES:= \
@@ -344,6 +344,7 @@ DLL_OFILES:= \
mmap.o \
msg.o \
msgcat.o \
@@ -33,10 +34,10 @@ index beedc7c5e..b7ef34b3a 100644
net.o \
netdb.o \
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 67ead1dde..851922d37 100644
index a47ed72e7..27acc8156 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -1043,7 +1043,7 @@ env_compare (const void *key, const void *memb)
@@ -1056,7 +1056,7 @@ env_compare (const void *key, const void *memb)
to the child. */
char ** __reg3
build_env (const char * const *envp, PWCHAR &envblock, int &envc,
@@ -45,7 +46,7 @@ index 67ead1dde..851922d37 100644
{
PWCHAR cwinenv = NULL;
size_t winnum = 0;
@@ -1136,6 +1136,11 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
@@ -1149,6 +1149,11 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
for (srcp = envp, dstp = newenv, pass_dstp = pass_env; *srcp; srcp++)
{
bool calc_tl = !no_envblock;
@@ -57,7 +58,7 @@ index 67ead1dde..851922d37 100644
/* Look for entries that require special attention */
for (unsigned i = 0; i < SPENVS_SIZE; i++)
if (!saw_spenv[i] && (*dstp = spenvs[i].retrieve (no_envblock, *srcp)))
@@ -1256,6 +1261,15 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
@@ -1269,6 +1274,15 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
saw_PATH = true;
}
}
@@ -87,10 +88,10 @@ index 269591a01..71c3f2208 100644
char ** __reg2 win32env_to_cygenv (PWCHAR rawenv, bool posify);
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index 3a9130efd..6592eb394 100644
index 94431bb52..ffeafcbf3 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -137,7 +137,7 @@ create_winenv (const char * const *env)
@@ -141,7 +141,7 @@ create_winenv (const char * const *env)
int unused_envc;
PWCHAR envblock = NULL;
char **envp = build_env (env ?: cur_environ (), envblock, unused_envc, false,
@@ -100,7 +101,7 @@ index 3a9130efd..6592eb394 100644
if (envp)
diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h
index c5da87c65..874447a0f 100644
index 805671ef9..b395e969d 100644
--- a/winsup/cygwin/include/sys/cygwin.h
+++ b/winsup/cygwin/include/sys/cygwin.h
@@ -83,6 +83,12 @@ extern ssize_t cygwin_conv_path_list (cygwin_conv_path_t what, const void *from,
@@ -118,10 +119,10 @@ index c5da87c65..874447a0f 100644
extern void cygwin_split_path (const char *, char *, char *);
diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc
new file mode 100644
index 000000000..74ebd2e0b
index 000000000..406b98ac8
--- /dev/null
+++ b/winsup/cygwin/msys2_path_conv.cc
@@ -0,0 +1,619 @@
@@ -0,0 +1,630 @@
+/*
+ The MSYS2 Path conversion source code is licensed under:
+
@@ -256,6 +257,7 @@ index 000000000..74ebd2e0b
+ Ely Arzhannikov <iarzhannikov@gmail.com>
+ Alexey Pavlov <alexpux@gmail.com>
+ Ray Donnelly <mingw.android@gmail.com>
+ Johannes Schindelin <johannes.schindelin@gmx.de>
+
+*/
+
@@ -406,6 +408,7 @@ index 000000000..74ebd2e0b
+ *dstit = '\0';
+ return dst;
+ }
+ *dstend = '\0';
+
+ const char* srcit = src;
+ const char* srcbeg = src;
@@ -533,6 +536,9 @@ index 000000000..74ebd2e0b
+ if (isalpha(*it)) {
+ it += 1;
+ starts_with_minus_alpha = 1;
+ if (memchr(it, ';', end - it)) {
+ return WINDOWS_PATH_LIST;
+ }
+ }
+ }
+
@@ -643,7 +649,7 @@ index 000000000..74ebd2e0b
+ posix_to_win32_path(it, real_to, dst, dstend);
+ }
+
+ if (real_to != to) {
+ if (*dst != dstend && real_to != to) {
+ **dst = *real_to;
+ *dst += 1;
+ }
@@ -675,6 +681,7 @@ index 000000000..74ebd2e0b
+}
+
+void ppl_convert(const char** from, const char* to, char** dst, const char* dstend) {
+ const char *orig_dst = *dst;
+ const char* it = *from;
+ const char* beg = it;
+ int prev_was_simc = 0;
@@ -692,6 +699,11 @@ index 000000000..74ebd2e0b
+ subp_convert(&beg, it, is_url, dst, dstend);
+ is_url = 0;
+
+ if (*dst == dstend) {
+ system_printf("Path cut off during conversion: %s\n", orig_dst);
+ break;
+ }
+
+ **dst = ';';
+ *dst += 1;
+ }
@@ -743,10 +755,10 @@ index 000000000..74ebd2e0b
+
diff --git a/winsup/cygwin/msys2_path_conv.h b/winsup/cygwin/msys2_path_conv.h
new file mode 100644
index 000000000..e1e5e8781
index 000000000..67d85ecb6
--- /dev/null
+++ b/winsup/cygwin/msys2_path_conv.h
@@ -0,0 +1,146 @@
@@ -0,0 +1,147 @@
+/*
+ The MSYS2 Path conversion source code is licensed under:
+
@@ -881,6 +893,7 @@ index 000000000..e1e5e8781
+ Ely Arzhannikov <iarzhannikov@gmail.com>
+ Alexey Pavlov <alexpux@gmail.com>
+ Ray Donnelly <mingw.android@gmail.com>
+ Johannes Schindelin <johannes.schindelin@gmx.de>
+
+*/
+
@@ -894,7 +907,7 @@ index 000000000..e1e5e8781
+#endif /* end of include guard: PATH_CONV_H_DB4IQBH3 */
+
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 6d8f76db5..cd544e0d8 100644
index 158f1e5fb..1fb65ca03 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -66,6 +66,7 @@
@@ -905,7 +918,7 @@ index 6d8f76db5..cd544e0d8 100644
#undef basename
suffix_info stat_suffixes[] =
@@ -3357,6 +3358,69 @@ fchdir (int fd)
@@ -3447,6 +3448,74 @@ fchdir (int fd)
return res;
}
@@ -933,28 +946,33 @@ index 6d8f76db5..cd544e0d8 100644
+ {
+ /* Since we've got regex linked we should maybe switch to that, but
+ running regexes for every argument could be too slow. */
+ if ( strcmp (exclusions, "*") == 0 || strstr (arg, exclusions) == arg )
+ if ( strcmp (exclusions, "*") == 0 || (strlen (exclusions) && strstr (arg, exclusions) == arg) )
+ return (char*)arg;
+ exclusions += strlen (exclusions) + 1;
+ }
+
+ size_t stack_len = arglen + MAX_PATH;
+ // Leave enough room for at least 16 path elements; we might be converting
+ // a path list.
+ size_t stack_len = arglen + 16 * MAX_PATH;
+ char * stack_path = (char *)malloc (stack_len);
+ memset (stack_path, 0, MAX_PATH);
+ if (!stack_len)
+ if (!stack_path)
+ {
+ debug_printf ("out of stack space?");
+ return (char *)arg;
+ }
+ memset (stack_path, 0, MAX_PATH);
+ convert (stack_path, stack_len - 1, arg);
+ debug_printf ("convert()'ed: %s (length %d)\n.....->: %s", arg, arglen, stack_path);
+ // Don't allocate memory if no conversion happened.
+ if (!strcmp (arg, stack_path))
+ {
+ if (arg != stack_path)
+ {
+ free (stack_path);
+ }
+ return ((char *)arg);
+ }
+ arg_result = (char *)malloc (strlen (stack_path)+1);
+ strcpy (arg_result, stack_path);
+ arg_result = (char *)realloc (stack_path, strlen (stack_path)+1);
+ // Windows doesn't like empty entries in PATH env. variables (;;)
+ char* semisemi = strstr(arg_result, ";;");
+ while (semisemi)
@@ -976,11 +994,11 @@ index 6d8f76db5..cd544e0d8 100644
/* Cover functions to the path conversion routines.
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 37db52608..d94167507 100644
index 579b3c9c3..e5c20fb53 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -261,6 +261,27 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
pid_t cygpid;
@@ -260,6 +260,27 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
bool rc;
int res = -1;
+ /* Environment variable MSYS2_ARG_CONV_EXCL contains a list
@@ -1007,7 +1025,7 @@ index 37db52608..d94167507 100644
/* Check if we have been called from exec{lv}p or spawn{lv}p and mask
mode to keep only the spawn mode. */
bool p_type_exec = !!(mode & _P_PATH_TYPE_EXEC);
@@ -370,12 +391,26 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
@@ -369,12 +390,26 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
moreinfo->argc = newargv.argc;
moreinfo->argv = newargv;
}
@@ -1039,7 +1057,7 @@ index 37db52608..d94167507 100644
}
@@ -507,7 +542,8 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
@@ -506,7 +541,8 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
moreinfo->envp = build_env (envp, envblock, moreinfo->envc,
real_path.iscygexec (),
switch_user ? ::cygheap->user.primary_token ()
@@ -1065,5 +1083,5 @@ index e3a65f8cc..1aeec8d9c 100644
{
for (int i = calloced; i < argc; i++)
--
2.18.0
2.21.0

View File

@@ -1,15 +1,16 @@
From 434bb6abf274521bfc5ff86d11f9c6d69efbc6a0 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Thu, 12 Mar 2015 13:58:27 +0300
Subject: [PATCH 04/23] Add functionality for changing OS name via MSYSTEM
From 2716565a74078428d4b924b8cc8f4fb7341fa1d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:29:01 +0300
Subject: [PATCH 04/15] Add functionality for changing OS name via MSYSTEM
environment variables.
---
winsup/cygserver/cygserver-config | 4 ++--
winsup/cygwin/environ.cc | 36 +++++++++++++++++++++++++----
winsup/cygwin/include/sys/utsname.h | 2 +-
winsup/cygwin/uname.cc | 6 +++++
4 files changed, 41 insertions(+), 7 deletions(-)
winsup/cygwin/uname.cc | 13 +++++++++--
4 files changed, 46 insertions(+), 9 deletions(-)
diff --git a/winsup/cygserver/cygserver-config b/winsup/cygserver/cygserver-config
index 373bfd24d..c902857ea 100755
@@ -34,7 +35,7 @@ index 373bfd24d..c902857ea 100755
echo
echo "Installation of cygserver as service failed. Please check the"
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 851922d37..06aff56dd 100644
index 27acc8156..b5081e7eb 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -189,7 +189,11 @@ parse_options (const char *inbuf)
@@ -49,7 +50,7 @@ index 851922d37..06aff56dd 100644
}
return;
}
@@ -643,7 +647,7 @@ _addenv (const char *name, const char *value, int overwrite)
@@ -653,7 +657,7 @@ _addenv (const char *name, const char *value, int overwrite)
win_env *spenv;
if ((spenv = getwinenv (envhere)))
spenv->add_cache (value);
@@ -58,7 +59,7 @@ index 851922d37..06aff56dd 100644
parse_options (value);
return 0;
@@ -747,6 +751,9 @@ static struct renv {
@@ -757,6 +761,9 @@ static struct renv {
} renv_arr[] = {
{ NL("COMMONPROGRAMFILES=") }, // 0
{ NL("COMSPEC=") },
@@ -68,12 +69,12 @@ index 851922d37..06aff56dd 100644
{ NL("PATH=") }, // 2
{ NL("PROGRAMFILES=") },
{ NL("SYSTEMDRIVE=") }, // 4
@@ -758,10 +765,21 @@ static struct renv {
@@ -768,10 +775,21 @@ static struct renv {
#define RENV_SIZE (sizeof (renv_arr) / sizeof (renv_arr[0]))
/* Set of first characters of the above list of variables. */
-static const char idx_arr[] = "CPSTW";
+static const char idx_arr[] =
+static const char idx_arr[] =
+#ifdef __MSYS__
+ "CMPSTW";
+#else
@@ -83,7 +84,7 @@ index 851922d37..06aff56dd 100644
starts. */
-static const int start_at[] = { 0, 2, 4, 6, 8 };
+static const int start_at[] = {
+#ifdef __MSYS__
+#ifdef __MSYS__
+ 0, 2, 3, 5, 7, 9
+#else
+ 0, 2, 4, 6, 8
@@ -92,7 +93,7 @@ index 851922d37..06aff56dd 100644
/* Turn environment variable part of a=b string into uppercase - for some
environment variables only. */
@@ -836,7 +854,11 @@ environ_init (char **envp, int envc)
@@ -846,7 +864,11 @@ environ_init (char **envp, int envc)
update_envptrs ();
if (envp_passed_in)
{
@@ -104,7 +105,7 @@ index 851922d37..06aff56dd 100644
if (p)
parse_options (p);
}
@@ -882,8 +904,13 @@ win32env_to_cygenv (PWCHAR rawenv, bool posify)
@@ -893,8 +915,13 @@ win32env_to_cygenv (PWCHAR rawenv, bool posify)
ucenv (newp, eq); /* uppercase env vars which need it */
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
sawTERM = 1;
@@ -118,7 +119,7 @@ index 851922d37..06aff56dd 100644
if (*eq && posify)
posify_maybe (envp + i, *++eq ? eq : --eq, tmpbuf);
debug_printf ("%p: %s", envp[i], envp[i]);
@@ -950,12 +977,13 @@ struct spenv
@@ -963,12 +990,13 @@ struct spenv
static NO_COPY spenv spenvs[] =
{
#ifdef DEBUGGING
@@ -134,23 +135,44 @@ index 851922d37..06aff56dd 100644
{NL ("SYSTEMROOT="), true, true, &cygheap_user::env_systemroot},
{NL ("USERDOMAIN="), false, false, &cygheap_user::env_domain},
diff --git a/winsup/cygwin/include/sys/utsname.h b/winsup/cygwin/include/sys/utsname.h
index e9dd019df..670cd2ead 100644
index d6b3be96f..730cb731a 100644
--- a/winsup/cygwin/include/sys/utsname.h
+++ b/winsup/cygwin/include/sys/utsname.h
@@ -15,7 +15,7 @@ extern "C" {
@@ -17,7 +17,7 @@ extern "C" {
struct utsname
{
- char sysname[_UTSNAME_LENGTH];
+ char sysname[_UTSNAME_LENGTH + 1];
char nodename[_UTSNAME_LENGTH];
char release[_UTSNAME_LENGTH];
char version[_UTSNAME_LENGTH];
diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc
index 306cdee4a..6d4d31f5e 100644
--- a/winsup/cygwin/uname.cc
+++ b/winsup/cygwin/uname.cc
@@ -30,7 +30,10 @@ uname_x (struct utsname *name)
memset (name, 0, sizeof (*name));
/* sysname */
- __small_sprintf (name->sysname, "CYGWIN_%s-%u%s",
+ char* msystem = getenv("MSYSTEM");
+ const char *msystem_msys = "MSYS";
+ __small_sprintf (name->sysname, "%s_%s-%u%s",
+ msystem ? msystem : msystem_msys,
wincap.osname (), wincap.build_number (),
wincap.is_wow64 () ? "-WOW64" : "");
/* nodename */
@@ -76,7 +79,7 @@ uname_x (struct utsname *name)
/* Old entrypoint for applications up to API 334 */
struct old_utsname
{
- char sysname[20];
+ char sysname[21];
char nodename[20];
char release[20];
char version[20];
diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc
index 778ca5738..cd5362b8a 100644
--- a/winsup/cygwin/uname.cc
+++ b/winsup/cygwin/uname.cc
@@ -24,7 +24,13 @@ uname (struct utsname *name)
@@ -92,7 +95,13 @@ uname (struct utsname *in_name)
char *snp = strstr (cygwin_version.dll_build_date, "SNP");
memset (name, 0, sizeof (*name));
@@ -165,5 +187,5 @@ index 778ca5738..cd5362b8a 100644
/* Add a hint to the sysname, that we're running under WOW64. This might
give an early clue if somebody encounters problems. */
--
2.18.0
2.21.0

View File

@@ -1,26 +1,27 @@
From ea182f0920703fe0e4dff365a34b5f24fa3aa665 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Thu, 12 Mar 2015 14:09:29 +0300
Subject: [PATCH 05/23] - Move root to /usr. - Change sorting mount points. -
From dca8dfe5ff9e5aab8143ea6a4081b41fbd67c237 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:45:06 +0300
Subject: [PATCH 05/15] - Move root to /usr. - Change sorting mount points. -
Do not show warnings for DOS paths. - By default mount without ACLs. - Can
read /etc/fstab with short mount point format.
---
winsup/cygwin/cygheap.cc | 12 ++-
winsup/cygwin/globals.cc | 2 +-
winsup/cygwin/mount.cc | 189 +++++++++++++++++++++++++++++++++------
winsup/cygwin/mount.cc | 185 +++++++++++++++++++++++++++++++++------
winsup/cygwin/mount.h | 3 +-
winsup/cygwin/uinfo.cc | 2 +-
5 files changed, 177 insertions(+), 31 deletions(-)
5 files changed, 175 insertions(+), 29 deletions(-)
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 87a5eb964..d6dc063e5 100644
index eb60cf279..3ec7fe9c2 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -178,14 +178,22 @@ init_cygheap::init_installation_root ()
@@ -179,6 +179,11 @@ init_cygheap::init_installation_root ()
/* Strip off last path component ("\\cygwin1.dll") */
PWCHAR w = wcsrchr (installation_root, L'\\');
PWCHAR w = wcsrchr (installation_root_buf, L'\\');
+#ifdef __MSYS__
+ /* Back two folders to get root as we have all stuff in usr subfolder */
+ for (int i=1; i >=0; --i)
@@ -29,7 +30,8 @@ index 87a5eb964..d6dc063e5 100644
if (w)
{
*w = L'\0';
w = wcsrchr (installation_root, L'\\');
@@ -185,8 +190,11 @@ init_cygheap::init_installation_root ()
w = wcsrchr (installation_root_buf, L'\\');
}
if (!w)
- api_fatal ("Can't initialize Cygwin installation root dir.\n"
@@ -41,16 +43,16 @@ index 87a5eb964..d6dc063e5 100644
/* Copy result into installation_dir before stripping off "bin" dir and
revert to Win32 path. This path is added to the Windows environment
@@ -208,6 +216,7 @@ init_cygheap::init_installation_root ()
if (w > p)
*w = L'\0';
@@ -211,6 +219,7 @@ init_cygheap::init_installation_root ()
RtlInitUnicodeString (&installation_root, installation_root_buf);
RtlInitUnicodeString (&installation_dir, installation_dir_buf);
+#ifndef __MSYS__
for (int i = 1; i >= 0; --i)
{
reg_key r (i, KEY_WRITE, _WIDE (CYGWIN_INFO_INSTALLATIONS_NAME),
@@ -216,6 +225,7 @@ init_cygheap::init_installation_root ()
installation_root)))
@@ -219,6 +228,7 @@ init_cygheap::init_installation_root ()
installation_root_buf)))
break;
}
+#endif
@@ -58,7 +60,7 @@ index 87a5eb964..d6dc063e5 100644
void __stdcall
diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc
index 7c84eb637..9841c0e46 100644
index ebe8b569f..05ff5f0cd 100644
--- a/winsup/cygwin/globals.cc
+++ b/winsup/cygwin/globals.cc
@@ -65,7 +65,7 @@ int NO_COPY dynamically_loaded;
@@ -71,7 +73,7 @@ index 7c84eb637..9841c0e46 100644
bool pipe_byte;
bool reset_com;
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index c11ae5ace..77ea6e8e2 100644
index e0349815d..7143d0cbd 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -39,7 +39,6 @@ details. */
@@ -90,28 +92,27 @@ index c11ae5ace..77ea6e8e2 100644
| FILE_FILE_COMPRESSION \
| FILE_VOLUME_QUOTAS \
| FILE_SUPPORTS_SPARSE_FILES \
@@ -468,13 +466,13 @@ mount_info::create_root_entry (const PWCHAR root)
@@ -473,13 +471,13 @@ mount_info::create_root_entry (const PWCHAR root)
sys_wcstombs (native_root, PATH_MAX, root);
assert (*native_root != '\0');
if (add_item (native_root, "/",
- MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_IMMUTABLE | MOUNT_AUTOMATIC)
+ MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_IMMUTABLE | MOUNT_AUTOMATIC | MOUNT_NOACL)
- MOUNT_SYSTEM | MOUNT_IMMUTABLE | MOUNT_AUTOMATIC)
+ MOUNT_SYSTEM | MOUNT_IMMUTABLE | MOUNT_AUTOMATIC | MOUNT_NOACL)
< 0)
api_fatal ("add_item (\"%s\", \"/\", ...) failed, errno %d", native_root, errno);
/* Create a default cygdrive entry. Note that this is a user entry.
This allows to override it with mount, unless the sysadmin created
a cygdrive entry in /etc/fstab. */
- cygdrive_flags = MOUNT_BINARY | MOUNT_NOPOSIX | MOUNT_CYGDRIVE;
+ cygdrive_flags = MOUNT_BINARY | MOUNT_NOPOSIX | MOUNT_CYGDRIVE | MOUNT_NOACL;
- cygdrive_flags = MOUNT_NOPOSIX | MOUNT_CYGDRIVE;
+ cygdrive_flags = MOUNT_NOPOSIX | MOUNT_CYGDRIVE | MOUNT_NOACL;
strcpy (cygdrive, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX "/");
cygdrive_len = strlen (cygdrive);
}
@@ -494,25 +492,17 @@ mount_info::init (bool user_init)
@@ -499,22 +497,14 @@ mount_info::init (bool user_init)
pathend = wcpcpy (pathend, L"\\etc\\fstab");
from_fstab (user_init, path, pathend);
- if (!user_init && (!got_usr_bin || !got_usr_lib))
+
+ if (!user_init && !got_usr_bin)
{
char native[PATH_MAX];
@@ -122,32 +123,27 @@ index c11ae5ace..77ea6e8e2 100644
- if (!got_usr_bin)
- {
- stpcpy (p, "\\bin");
- add_item (native, "/usr/bin",
- MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_AUTOMATIC);
- add_item (native, "/usr/bin", MOUNT_SYSTEM | MOUNT_AUTOMATIC);
- }
- if (!got_usr_lib)
- {
- stpcpy (p, "\\lib");
- add_item (native, "/usr/lib",
- MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_AUTOMATIC);
- add_item (native, "/usr/lib", MOUNT_SYSTEM | MOUNT_AUTOMATIC);
- }
- }
+ stpcpy (p, "\\usr\\bin");
+ add_item (native, "/bin",
+ MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_AUTOMATIC | MOUNT_NOACL);
+ }
+ stpcpy (p, "\\usr\\bin");
+ add_item (native, "/bin", MOUNT_SYSTEM | MOUNT_AUTOMATIC | MOUNT_NOACL);
}
}
static void
@@ -608,6 +598,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
@@ -595,6 +585,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
/* See if this is a cygwin "device" */
if (win32_device_name (src_path, dst, dev))
{
+ debug_printf ("win32_device_name (%s)", src_path);
*flags = MOUNT_BINARY; /* FIXME: Is this a sensible default for devices? */
*flags = 0;
rc = 0;
goto out_no_chroot_check;
@@ -638,6 +629,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
@@ -625,6 +616,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
}
if (isproc (src_path))
{
@@ -155,7 +151,7 @@ index c11ae5ace..77ea6e8e2 100644
dev = *proc_dev;
dev = fhandler_proc::get_proc_fhandler (src_path);
if (dev == FH_NADA)
@@ -659,6 +651,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
@@ -646,6 +638,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
off the prefix and transform it into an MS-DOS path. */
else if (iscygdrive (src_path))
{
@@ -163,23 +159,24 @@ index c11ae5ace..77ea6e8e2 100644
int n = mount_table->cygdrive_len - 1;
int unit;
@@ -670,11 +663,15 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
@@ -657,11 +650,15 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
}
else if (cygdrive_win32_path (src_path, dst, unit))
{
+ debug_printf ("cygdrive_win32_path (%s)", src_path);
set_flags (flags, (unsigned) cygdrive_flags);
+ debug_printf ("cygdrive_win32_path (%s)", src_path);
*flags = cygdrive_flags;
goto out;
}
else if (mount_table->cygdrive_len > 1)
- return ENOENT;
+ {
+ debug_printf ("mount_table->cygdrive_len > 1 (%s)", src_path);
return ENOENT;
+ debug_printf ("mount_table->cygdrive_len > 1 (%s)", src_path);
+ return ENOENT;
+ }
}
int chroot_pathlen;
@@ -685,7 +682,9 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
@@ -672,7 +669,9 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
const char *path;
int len;
@@ -190,7 +187,7 @@ index c11ae5ace..77ea6e8e2 100644
if (!cygheap->root.exists ()
|| (mi->posix_pathlen == 1 && mi->posix_path[0] == '/'))
{
@@ -916,7 +915,8 @@ mount_info::conv_to_posix_path (const char *src_path, char *posix_path,
@@ -903,7 +902,8 @@ mount_info::conv_to_posix_path (const char *src_path, char *posix_path,
int pathbuflen = tail - pathbuf;
for (int i = 0; i < nmounts; ++i)
{
@@ -200,7 +197,7 @@ index c11ae5ace..77ea6e8e2 100644
if (!path_prefix_p (mi.native_path, pathbuf, mi.native_pathlen,
mi.flags & MOUNT_NOPOSIX))
continue;
@@ -1144,8 +1144,17 @@ mount_info::from_fstab_line (char *line, bool user)
@@ -1116,8 +1116,17 @@ mount_info::from_fstab_line (char *line, bool user)
if (!*c)
return true;
cend = find_ws (c);
@@ -208,7 +205,7 @@ index c11ae5ace..77ea6e8e2 100644
posix_path = conv_fstab_spaces (c);
+ if (!*cend)
+ {
+ unsigned mount_flags = MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_NOPOSIX | MOUNT_NOACL;
+ unsigned mount_flags = MOUNT_SYSTEM | MOUNT_NOPOSIX | MOUNT_NOACL;
+
+ int res = mount_table->add_item (native_path, posix_path, mount_flags);
+ if (res && get_errno () == EMFILE)
@@ -219,7 +216,7 @@ index c11ae5ace..77ea6e8e2 100644
/* Third field: FS type. */
c = skip_ws (cend + 1);
if (!*c)
@@ -1374,16 +1383,145 @@ sort_by_native_name (const void *a, const void *b)
@@ -1346,16 +1355,145 @@ sort_by_native_name (const void *a, const void *b)
return res;
}
@@ -366,7 +363,7 @@ index c11ae5ace..77ea6e8e2 100644
}
/* Add an entry to the mount table.
@@ -1474,12 +1612,9 @@ mount_info::add_item (const char *native, const char *posix,
@@ -1446,12 +1584,9 @@ mount_info::add_item (const char *native, const char *posix,
if (i == nmounts)
nmounts++;
@@ -381,10 +378,10 @@ index c11ae5ace..77ea6e8e2 100644
root_idx = i;
diff --git a/winsup/cygwin/mount.h b/winsup/cygwin/mount.h
index 0b392ca85..e6ca7fd82 100644
index 122a679a8..c447381b9 100644
--- a/winsup/cygwin/mount.h
+++ b/winsup/cygwin/mount.h
@@ -169,7 +169,6 @@ class mount_info
@@ -171,7 +171,6 @@ class mount_info
mount_item mount[MAX_MOUNTS];
static bool got_usr_bin;
@@ -392,7 +389,7 @@ index 0b392ca85..e6ca7fd82 100644
static int root_idx;
/* cygdrive_prefix is used as the root of the path automatically
@@ -181,6 +180,8 @@ class mount_info
@@ -183,6 +182,8 @@ class mount_info
private:
int posix_sorted[MAX_MOUNTS];
int native_sorted[MAX_MOUNTS];
@@ -402,10 +399,10 @@ index 0b392ca85..e6ca7fd82 100644
public:
void init (bool);
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index c2f4803ce..0223265ed 100644
index bfcce00da..4da0570ec 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -2780,7 +2780,7 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
@@ -2791,7 +2791,7 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
dom, name,
sid.string ((char *) sidstr),
home ?: "/home/", home ? L"" : name,
@@ -415,5 +412,5 @@ index c2f4803ce..0223265ed 100644
free (gecos);
if (home)
--
2.18.0
2.21.0

View File

@@ -1,7 +1,8 @@
From 66d843342c067e61baedaff97bf7db0b0e78626f Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Thu, 12 Mar 2015 14:09:29 +0300
Subject: [PATCH 06/23] Do not create cygwin symlinks. Instead use deep copy of
From 6ed3f871a4493795ddcb6d9ccd2366a2eb2b8955 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:47:21 +0300
Subject: [PATCH 06/15] Do not create cygwin symlinks. Instead use deep copy of
files/folders.
---
@@ -9,10 +10,10 @@ Subject: [PATCH 06/23] Do not create cygwin symlinks. Instead use deep copy of
1 file changed, 147 insertions(+)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index cd544e0d8..b14a49ec4 100644
index 1fb65ca03..c3f011c2e 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1581,6 +1581,86 @@ conv_path_list (const char *src, char *dst, size_t size,
@@ -1667,6 +1667,86 @@ conv_path_list (const char *src, char *dst, size_t size,
/********************** Symbolic Link Support **************************/
@@ -99,7 +100,7 @@ index cd544e0d8..b14a49ec4 100644
/* Create a symlink from FROMPATH to TOPATH. */
extern "C" int
@@ -2009,6 +2089,73 @@ symlink_worker (const char *oldpath, const char *newpath, bool isdevice)
@@ -2095,6 +2175,73 @@ symlink_worker (const char *oldpath, const char *newpath, bool isdevice)
}
else
{
@@ -174,5 +175,5 @@ index cd544e0d8..b14a49ec4 100644
buf = tp.t_get ();
cp = stpcpy (buf, SYMLINK_COOKIE);
--
2.18.0
2.21.0

View File

@@ -1,23 +1,22 @@
From a8c3f3c5a6051ec98367fe3f1d7ca313734944d2 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 24 Mar 2015 14:09:29 +0300
Subject: [PATCH 07/23] Automatically rewrite TERM=msys to TERM=cygwin
From 73bc40b79bc0b3d86415636b09103580cbfbfe5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:48:54 +0300
Subject: [PATCH 07/15] Automatically rewrite TERM=msys to TERM=cygwin With
MSys1, it was necessary to set the TERM variable to "msys". To allow for a
smooth transition from MSys1 to MSys2, let's simply handle TERM=msys as if
the user had not specified TERM at all and wanted us to use our preferred
TERM value.
With MSys1, it was necessary to set the TERM variable to "msys". To
allow for a smooth transition from MSys1 to MSys2, let's simply handle
TERM=msys as if the user had not specified TERM at all and wanted us to
use our preferred TERM value.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/environ.cc | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 06aff56dd..dc93fd59b 100644
index b5081e7eb..ece670eda 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -903,7 +903,16 @@ win32env_to_cygenv (PWCHAR rawenv, bool posify)
@@ -914,7 +914,16 @@ win32env_to_cygenv (PWCHAR rawenv, bool posify)
char *eq = strchrnul (newp, '=');
ucenv (newp, eq); /* uppercase env vars which need it */
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
@@ -36,5 +35,5 @@ index 06aff56dd..dc93fd59b 100644
else if (*newp == 'M' && strncmp (newp, "MSYS=", 5) == 0)
parse_options (newp + 5);
--
2.18.0
2.21.0

View File

@@ -1,20 +1,19 @@
From 59144bd562e776de0dd9e4dc4516a5a40668598f Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Fri, 6 Mar 2015 14:09:29 +0300
Subject: [PATCH 08/23] Do not convert environment for strace
From e27ec240f339ccf3e5edd138216e1b5f369a02ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:50:55 +0300
Subject: [PATCH 08/15] Do not convert environment for strace
strace is a Windows program so MSYS2 will convert
all arguments and environment vars and that makes
debugging msys2 software with strace very tricky.
Strace is a Windows program so MSYS2 will convert all arguments and environment vars and that makes debugging msys2 software with strace very tricky.
---
winsup/cygwin/spawn.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index d94167507..07b9e87c0 100644
index e5c20fb53..2e9f20465 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -539,11 +539,13 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
@@ -538,11 +538,13 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
bool switch_user = ::cygheap->user.issetuid ()
&& (::cygheap->user.saved_uid
!= ::cygheap->user.real_uid);
@@ -30,5 +29,5 @@ index d94167507..07b9e87c0 100644
{
set_errno (E2BIG);
--
2.18.0
2.21.0

View File

@@ -1,7 +1,8 @@
From 9212a838f6a09f5a84b6609c7aac6bd8533621b0 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Tue, 1 Mar 2016 13:19:18 +0300
Subject: [PATCH 16/23] Special case for converting root directory to have
From ef8e3bb9d5e9d6cbc73354b607084c924ef33792 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 22:13:51 +0300
Subject: [PATCH 09/15] Special case for converting root directory to have
training slash
---
@@ -9,10 +10,10 @@ Subject: [PATCH 16/23] Special case for converting root directory to have
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 39b5593cd..5925e9693 100644
index c3f011c2e..8d9e6fe11 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -724,6 +724,12 @@ path_conv::check (const char *src, unsigned opt,
@@ -726,6 +726,12 @@ path_conv::check (const char *src, unsigned opt,
need_directory = 1;
*--tail = '\0';
}
@@ -25,7 +26,7 @@ index 39b5593cd..5925e9693 100644
path_end = tail;
/* Scan path_copy from right to left looking either for a symlink
@@ -1216,16 +1222,17 @@ path_conv::check (const char *src, unsigned opt,
@@ -1230,16 +1236,17 @@ path_conv::check (const char *src, unsigned opt,
cfree (wide_path);
wide_path = NULL;
}
@@ -53,5 +54,5 @@ index 39b5593cd..5925e9693 100644
}
--
2.18.0
2.21.0

View File

@@ -1,39 +0,0 @@
From a3b2abeb7ae47c5ab6a3226cfa7dfbcc45166a1a Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 2 Mar 2015 14:09:29 +0300
Subject: [PATCH 09/23] convert(): be more careful to stay within the buffer
We really must not run outside of the buffer. And the buffer needs to be
NUL-terminated, too...
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/msys2_path_conv.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc
index 74ebd2e0b..8a7b7e26d 100644
--- a/winsup/cygwin/msys2_path_conv.cc
+++ b/winsup/cygwin/msys2_path_conv.cc
@@ -519,7 +519,7 @@ void rp_convert(const char** from, const char* to, char** dst, const char* dsten
posix_to_win32_path(it, real_to, dst, dstend);
}
- if (real_to != to) {
+ if (*dst != dstend && real_to != to) {
**dst = *real_to;
*dst += 1;
}
@@ -568,6 +568,9 @@ void ppl_convert(const char** from, const char* to, char** dst, const char* dste
subp_convert(&beg, it, is_url, dst, dstend);
is_url = 0;
+ if (*dst == dstend)
+ break;
+
**dst = ';';
*dst += 1;
}
--
2.18.0

View File

@@ -1,33 +0,0 @@
From 38579dc718d7d20fcd7ab7a84ff12684acf18ef3 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 2 Mar 2015 14:09:29 +0300
Subject: [PATCH 10/23] convert(): check safely whether we could allocate the
buffer
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/path.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index b14a49ec4..c5b0547a9 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3536,12 +3536,12 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
size_t stack_len = arglen + MAX_PATH;
char * stack_path = (char *)malloc (stack_len);
- memset (stack_path, 0, MAX_PATH);
- if (!stack_len)
+ if (!stack_path)
{
debug_printf ("out of stack space?");
return (char *)arg;
}
+ memset (stack_path, 0, MAX_PATH);
convert (stack_path, stack_len - 1, arg);
debug_printf ("convert()'ed: %s (length %d)\n.....->: %s", arg, arglen, stack_path);
// Don't allocate memory if no conversion happened.
--
2.18.0

View File

@@ -1,7 +1,7 @@
From da01adf76dc43696569c4c04c679a54c2138793f Mon Sep 17 00:00:00 2001
From df76f0d3a0800d1c02d1d44f069428f483555cb3 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Fri, 21 Aug 2015 12:52:09 +0100
Subject: [PATCH 17/23] dcrt0.cc: Untangle allow_glob from winshell
Subject: [PATCH 10/15] dcrt0.cc: Untangle allow_glob from winshell
Otherwise if globbing is allowed and we get called from a
Windows program, build_argv thinks we've been called from
@@ -11,7 +11,7 @@ a Cygwin program.
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 7a23e0320..d70633a29 100644
index 9d9bf2b27..cb2282551 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -153,12 +153,12 @@ isquote (char c)
@@ -67,7 +67,7 @@ index 7a23e0320..d70633a29 100644
{
debug_printf ("argv[%d] = '%s'", argc, word);
argv[argc++] = word;
@@ -930,6 +930,7 @@ dll_crt0_1 (void *)
@@ -940,6 +940,7 @@ dll_crt0_1 (void *)
/* Scan the command line and build argv. Expand wildcards if not
called from another cygwin process. */
build_argv (line, __argv, __argc,
@@ -76,5 +76,5 @@ index 7a23e0320..d70633a29 100644
/* Convert argv[0] to posix rules if it's currently blatantly
--
2.18.0
2.21.0

View File

@@ -1,29 +0,0 @@
From ef05b0f5d322b09adfdb644be8b9b26fe9da7cbc Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 2 Mar 2015 14:09:29 +0300
Subject: [PATCH 11/23] convert(): use the elegant realloc() call
Instead of doing a poor man's realloc(), we can call the real thing ;-)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/path.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index c5b0547a9..1910011fb 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3549,8 +3549,7 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
{
return ((char *)arg);
}
- arg_result = (char *)malloc (strlen (stack_path)+1);
- strcpy (arg_result, stack_path);
+ arg_result = (char *)realloc (stack_path, strlen (stack_path)+1);
// Windows doesn't like empty entries in PATH env. variables (;;)
char* semisemi = strstr(arg_result, ";;");
while (semisemi)
--
2.18.0

View File

@@ -1,7 +1,7 @@
From ae16b19c9d2a03efd7bd4c036eb453cc9bb82801 Mon Sep 17 00:00:00 2001
From 65c3195aa5d72797dd3449b8f3a12b6edccd8503 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Mon, 24 Aug 2015 00:48:06 +0100
Subject: [PATCH 18/23] dcrt0.cc (globify): Don't quote literal strings
Subject: [PATCH 11/15] dcrt0.cc (globify): Don't quote literal strings
differently when dos_spec
Reverts 25ba8f306f3099caf8397859019e936b90510e8d. I can't figure out what
@@ -30,7 +30,7 @@ the expense of sensible forward-slash-containing input.
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index d70633a29..7f69b33d4 100644
index cb2282551..46200f17c 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -235,10 +235,20 @@ globify (char *word, char **&argv, int &argc, int &argvlen)
@@ -56,5 +56,5 @@ index d70633a29..7f69b33d4 100644
size_t cnt = isascii (*s) ? 1 : mbtowc (NULL, s, MB_CUR_MAX);
if (cnt <= 1 || cnt == (size_t)-1)
--
2.18.0
2.21.0

View File

@@ -1,31 +0,0 @@
From ec9cf3b9b520c14d026c6fd9f16199d387a44b01 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 2 Mar 2015 14:09:29 +0300
Subject: [PATCH 12/23] convert(): plug potential memory leak
When the result of conversion is identical to the original argument, we
should make sure that the temporary buffer was released.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/path.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 1910011fb..907afbedc 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3547,6 +3547,10 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
// Don't allocate memory if no conversion happened.
if (!strcmp (arg, stack_path))
{
+ if (arg != stack_path)
+ {
+ free (stack_path);
+ }
return ((char *)arg);
}
arg_result = (char *)realloc (stack_path, strlen (stack_path)+1);
--
2.18.0

View File

@@ -1,7 +1,7 @@
From 3450a059b3604454d4df360ecc7648374f9de4d5 Mon Sep 17 00:00:00 2001
From cafcbe9aff050573460022fa032b41b029cfe2c0 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Sun, 23 Aug 2015 20:47:30 +0100
Subject: [PATCH 19/23] strace.cc: Don't set MSYS=noglob
Subject: [PATCH 12/15] strace.cc: Don't set MSYS=noglob
Commit message for this code was:
@@ -26,7 +26,7 @@ See quoted () comment:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index bf507981a..638b66293 100644
index 5e6eebd63..35953b85a 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -353,10 +353,28 @@ create_child (char **argv)
@@ -68,5 +68,5 @@ index bf507981a..638b66293 100644
NULL, /* Security */
NULL, /* thread */
--
2.18.0
2.21.0

View File

@@ -1,14 +1,14 @@
From 0c08a7f8af0e4a700caf43251c9e76ff9d818486 Mon Sep 17 00:00:00 2001
From 488e69e40890cdbf162411e9560b38f01873adb3 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Fri, 21 Aug 2015 12:18:52 +0100
Subject: [PATCH 20/23] Add debugging for build_argv
Subject: [PATCH 13/15] Add debugging for build_argv
---
winsup/cygwin/dcrt0.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 7f69b33d4..705817679 100644
index 46200f17c..2dc4aae25 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -309,6 +309,8 @@ build_argv (char *cmd, char **&argv, int &argc, int winshell, int glob)
@@ -21,5 +21,5 @@ index 7f69b33d4..705817679 100644
while (*cmd)
{
--
2.18.0
2.21.0

View File

@@ -1,46 +0,0 @@
From 201bba2db77149fc8a92071cb649158ef9c60c8f Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 2 Mar 2015 14:09:29 +0300
Subject: [PATCH 13/23] convert(): warn when we cut off a path
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/msys2_path_conv.cc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc
index 8a7b7e26d..34c4d26c5 100644
--- a/winsup/cygwin/msys2_path_conv.cc
+++ b/winsup/cygwin/msys2_path_conv.cc
@@ -282,6 +282,7 @@ const char* convert(char *dst, size_t dstlen, const char *src) {
*dstit = '\0';
return dst;
}
+ *dstend = '\0';
const char* srcit = src;
const char* srcbeg = src;
@@ -551,6 +552,7 @@ void subp_convert(const char** from, const char* end, int is_url, char** dst, co
}
void ppl_convert(const char** from, const char* to, char** dst, const char* dstend) {
+ const char *orig_dst = *dst;
const char* it = *from;
const char* beg = it;
int prev_was_simc = 0;
@@ -568,8 +570,10 @@ void ppl_convert(const char** from, const char* to, char** dst, const char* dste
subp_convert(&beg, it, is_url, dst, dstend);
is_url = 0;
- if (*dst == dstend)
- break;
+ if (*dst == dstend) {
+ system_printf("Path cut off during conversion: %s\n", orig_dst);
+ break;
+ }
**dst = ';';
*dst += 1;
--
2.18.0

View File

@@ -1,14 +1,14 @@
From fb738ad5e0e3a95f14e5a3d47242ba13fe0dbdaf Mon Sep 17 00:00:00 2001
From ca6ce6de6beba21688ae06cc7c68847c5d82954d Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Fri, 21 Aug 2015 09:52:47 +0100
Subject: [PATCH 21/23] Add debugging for strace make_command_line
Subject: [PATCH 14/15] Add debugging for strace make_command_line
---
winsup/utils/strace.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index 638b66293..ca148c372 100644
index 35953b85a..6c94158f3 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -351,6 +351,7 @@ create_child (char **argv)
@@ -20,5 +20,5 @@ index 638b66293..ca148c372 100644
SetConsoleCtrlHandler (NULL, 0);
/* Commit message for this code was:
--
2.18.0
2.21.0

View File

@@ -1,44 +0,0 @@
From 67bc3f2cfc0eb47f8ceb5ec323407a9f7498d287 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 2 Mar 2015 14:09:29 +0300
Subject: [PATCH 14/23] arg_heuristic(): be better prepared to handle path
lists
If we were to handle only single paths, the buffer really would only
need to fit a single one, but arg_heuristic is also used to convert e.g.
INFO_PATH and MAN_PATH (which can contain multiple absolute POSIX-style
paths that need to be converted to Windows-style paths).
This is only really relevant if the POSIX root directory's path is
already pretty long. Such a beast has been spotted in the wild, in the
Git for Windows project:
https://github.com/git-for-windows/git/issues/303
Of course, this patch is only a work-around that helps in many, but not
all cases. Obviously this patch will wait patiently until a real fix
comes around the corner, and then readily retire.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/path.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 907afbedc..39b5593cd 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3534,7 +3534,9 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
exclusions += strlen (exclusions) + 1;
}
- size_t stack_len = arglen + MAX_PATH;
+ // Leave enough room for at least 16 path elements; we might be converting
+ // a path list.
+ size_t stack_len = arglen + 16 * MAX_PATH;
char * stack_path = (char *)malloc (stack_len);
if (!stack_path)
{
--
2.18.0

View File

@@ -1,27 +0,0 @@
From 4bbc1d4c4c5464469c2519c0ee3d915edb195da8 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Fri, 20 Mar 2015 14:09:29 +0300
Subject: [PATCH 15/23] Fix converting argument looks like
-DVAR=str1;c:/path1;str2;c:/path2
---
winsup/cygwin/msys2_path_conv.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc
index 34c4d26c5..c347bd4cb 100644
--- a/winsup/cygwin/msys2_path_conv.cc
+++ b/winsup/cygwin/msys2_path_conv.cc
@@ -410,6 +410,9 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
if (isalpha(*it)) {
it += 1;
starts_with_minus_alpha = 1;
+ if (memchr(it, ';', end - it)) {
+ return WINDOWS_PATH_LIST;
+ }
}
}
--
2.18.0

View File

@@ -1,7 +1,7 @@
From 83e3b116b22f16ab1e0aa212cc9b2a515d62865a Mon Sep 17 00:00:00 2001
From e5e3c6f0366fe50dd0325aed9488c0958e6dbdf7 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Sun, 10 Apr 2016 21:47:41 +0100
Subject: [PATCH 22/23] environ.cc: New facility/environment variable
Subject: [PATCH 15/15] environ.cc: New facility/environment variable
MSYS2_ENV_CONV_EXCL
Works very much like MSYS2_ARG_CONV_EXCL. In fact it uses the same
@@ -25,10 +25,10 @@ it to another absolute path, R_HOME, forming an invalid path.
5 files changed, 43 insertions(+), 15 deletions(-)
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index dc93fd59b..22c7e3663 100644
index ece670eda..dcbae12cf 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -1166,6 +1166,10 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
@@ -1179,6 +1179,10 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
int tl = 0;
char **pass_dstp;
@@ -39,7 +39,7 @@ index dc93fd59b..22c7e3663 100644
char **pass_env = (char **) alloca (sizeof (char *)
* (n + winnum + SPENVS_SIZE + 1));
/* Iterate over input list, generating a new environment list and refreshing
@@ -1174,9 +1178,18 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
@@ -1187,9 +1191,18 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
{
bool calc_tl = !no_envblock;
#ifdef __MSYS__
@@ -61,7 +61,7 @@ index dc93fd59b..22c7e3663 100644
#endif
/* Look for entries that require special attention */
for (unsigned i = 0; i < SPENVS_SIZE; i++)
@@ -1300,7 +1313,8 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
@@ -1313,7 +1326,8 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
}
#ifdef __MSYS__
else if (!keep_posix) {
@@ -117,10 +117,10 @@ index b983e6d81..928de89bf 100644
extern inline void
transform_chars (PUNICODE_STRING upath, USHORT start_idx)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 5925e9693..f5c1902e8 100644
index 8d9e6fe11..ad152e461 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3531,7 +3531,6 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
@@ -3621,7 +3621,6 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
return arg_result;
}
@@ -129,10 +129,10 @@ index 5925e9693..f5c1902e8 100644
{
/* Since we've got regex linked we should maybe switch to that, but
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 07b9e87c0..264249072 100644
index 2e9f20465..de847549d 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -262,8 +262,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
@@ -261,8 +261,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
int res = -1;
/* Environment variable MSYS2_ARG_CONV_EXCL contains a list
@@ -142,7 +142,7 @@ index 07b9e87c0..264249072 100644
A value of * means don't convert any arguments. */
char* msys2_arg_conv_excl_env = getenv("MSYS2_ARG_CONV_EXCL");
char* msys2_arg_conv_excl = NULL;
@@ -272,14 +271,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
@@ -271,14 +270,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
{
msys2_arg_conv_excl = (char*)alloca (strlen(msys2_arg_conv_excl_env)+1);
strcpy (msys2_arg_conv_excl, msys2_arg_conv_excl_env);
@@ -159,5 +159,5 @@ index 07b9e87c0..264249072 100644
/* Check if we have been called from exec{lv}p or spawn{lv}p and mask
--
2.18.0
2.21.0

View File

@@ -1,25 +0,0 @@
From 8f80b47213877a8789577f17606ed9610db64919 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Sun, 15 May 2016 09:31:51 +0100
Subject: [PATCH 23/23] path.cc: Ignore zero-length exclusions
---
winsup/cygwin/path.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index f5c1902e8..da3fbe28a 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3535,7 +3535,7 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions,
{
/* Since we've got regex linked we should maybe switch to that, but
running regexes for every argument could be too slow. */
- if ( strcmp (exclusions, "*") == 0 || strstr (arg, exclusions) == arg )
+ if ( strcmp (exclusions, "*") == 0 || (strlen (exclusions) && strstr (arg, exclusions) == arg) )
return (char*)arg;
exclusions += strlen (exclusions) + 1;
}
--
2.18.0

View File

@@ -3,7 +3,7 @@
pkgbase=msys2-runtime
pkgname=('msys2-runtime' 'msys2-runtime-devel')
pkgver=2.11.2
pkgver=3.0.6
pkgrel=1
pkgdesc="Cygwin POSIX emulation engine"
arch=('i686' 'x86_64')
@@ -24,55 +24,39 @@ makedepends=('cocom'
'diffutils')
# options=('debug' '!strip')
source=('msys2-runtime'::git://sourceware.org/git/newlib-cygwin.git#tag=cygwin-${pkgver//./_}-release
0001-Add-MSYS-triplets.patch
0002-Rename-DLL-from-cygwin-to-msys.patch
0001-Add-MSYS2-triplet.patch
0002-Rename-dll-from-cygwin-to-msys.patch
0003-Add-functionality-for-converting-UNIX-paths-in-argum.patch
0004-Add-functionality-for-changing-OS-name-via-MSYSTEM-e.patch
0005-Move-root-to-usr.-Change-sorting-mount-points.-Do-no.patch
0006-Do-not-create-cygwin-symlinks.-Instead-use-deep-copy.patch
0007-Automatically-rewrite-TERM-msys-to-TERM-cygwin.patch
0007-Automatically-rewrite-TERM-msys-to-TERM-cygwin-With-.patch
0008-Do-not-convert-environment-for-strace.patch
0009-convert-be-more-careful-to-stay-within-the-buffer.patch
0010-convert-check-safely-whether-we-could-allocate-the-b.patch
0011-convert-use-the-elegant-realloc-call.patch
0012-convert-plug-potential-memory-leak.patch
0013-convert-warn-when-we-cut-off-a-path.patch
0014-arg_heuristic-be-better-prepared-to-handle-path-list.patch
0015-Fix-converting-argument-looks-like-DVAR-str1-c-path1.patch
0016-Special-case-for-converting-root-directory-to-have-t.patch
0017-dcrt0.cc-Untangle-allow_glob-from-winshell.patch
0018-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch
0019-strace.cc-Don-t-set-MSYS-noglob.patch
0020-Add-debugging-for-build_argv.patch
0021-Add-debugging-for-strace-make_command_line.patch
0022-environ.cc-New-facility-environment-variable-MSYS2_E.patch
0023-path.cc-Ignore-zero-length-exclusions.patch
0009-Special-case-for-converting-root-directory-to-have-t.patch
0010-dcrt0.cc-Untangle-allow_glob-from-winshell.patch
0011-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch
0012-strace.cc-Don-t-set-MSYS-noglob.patch
0013-Add-debugging-for-build_argv.patch
0014-Add-debugging-for-strace-make_command_line.patch
0015-environ.cc-New-facility-environment-variable-MSYS2_E.patch
0024-Fix-native-symbolic-link-spawn-passing-wrong-arg0.patch
)
sha256sums=('SKIP'
'3b16cf413fe49254902d18faf96787f206c1dbc992ffff9c4e4d4230485c1bf9'
'45484264acedba213c14a230137a10a937d4476e1930f66a6531c8fec9f2be37'
'57cfab9f43b12a7dc0fe120032d9c811ee0db6efdc6c88dc08c72d5f278a1d09'
'a35b0bd423a516a915651ec6474565eb70c8f52c04f6bbcfe63ad6f2e68a52d4'
'aeb7f3185277c81d8b0a7481588a531dcf3b04ae4336855fb7c692ca4b657d70'
'c05bf13f03f88c1bbaa25451319c7e81a74fb4f487deac337af6e12febc9d91d'
'd98ac11f1e483d2ed9adc30e6e9f4f70f2d8544f24ec79da0e15cb6a9fff272c'
'6c736e1efe35423bc6449374e2d33fac666ffa43ea2c8f5920c34e6fd74595a9'
'ac92806d9e413ad1bbcedbb2eb701067765413cd528107e90d070ed640af0a7e'
'e78cdb2410ed5c04c51fb28b4a0760ffb840f0ddf60b933de91d1da7dd5514e7'
'85e6eaf55fe052960913293e4a901812b9dddece2a398e97dcc4e2e64ea5be4b'
'80e4240155b5b93ffa87edde9eaffa2a47e6c0021d03858f99206aaa43403de0'
'b975234d6aedb25f61f7a27c4953b96fd12412e1b4e8c4bd5c6a9aaf1c24ae29'
'6a35ee32f7dd30553f735606d8efc9080a6d89f5972534545dd3e7097163f6b2'
'22a6b289fe7b2cc79254c08eb6a436e402ae67d7c0561ee790b73634ea22a8bb'
'a75f07bb64328a2ae814b17d3dbc894f164a9169d70a402aaf6499604bc5b466'
'2672c1abe34f43523d609cffce8db09c3e57dce15379acee70368421cc386f14'
'def566a9cf65b77cd017603aaa1f20e0969ee0cbdcfd5908bcbb44b4cd5d2474'
'bab265d3a67d38cac15b9cb260dfaf48778388a879cba21744de7900b406151e'
'4edfc95f0a8b2be0981cfbfea6be662312331915899734a19de96703f4c2b4c7'
'65cc92f23946f76552be855f60b00cc518f5abc387cb71bd180a6a1e96719fbd'
'16a87c39f043da71b5f7095eaa697a3631782957ccb034cbf1d1d6d53a6ec9b2'
'a3dfc8f8320bcd224072ec2901cc8eaaff2b756ef9d038d387ec1316bc77832e'
'df193299ab04aca8a049b2b98d025452caad95f27fba5a1f1b350f74a82c24f1'
'dd6c9856d6134cd992eee7ef4bdd64d5c57cd2faba9eae12d9be98c182b74734'
'e5d92649f29de5e13a5c214c73b307c74ed58fe0806c35b422c50f96088f01fd'
'bd67641a856d38c957b0b30bbc4fd58d9ca8829ae84c11acd13211c9dee1aab4'
'400d5377d986e53d3af50e730c536e71c9dfebb77a0efa71c14302fd8e201c59'
'2122b881be02cad4b2203a848f2a49794157ef091ed01f4c4e8d17c0b5e5b111'
'd001b32e07899a7a0cb44baaba7f5bc1cff57130a29ab72e3413a9698e0c3e0f'
'3e0c58abe0c81b7c08fdd0affd5d96a82f61f890b90fcee692584fe5b364962e'
'ead507d1fe2bc796937f93913da5196c33120a15860b5b87f7903e7015172dcd'
'f6471c9349bd89582cb6f5c5e32a427867d941b534267f86b1cee4367f8c8ab1'
'f429aaacd345e59f393b6b681c938a0d38017538e8bc40b27c8ade594d4f175d'
'774fda3da42da082578152c22d64b87f4bc63ad0412edb680f229b2ab5a1714e'
'8fa80ce0e14f078cf6a7096d0587c27add38d647191d5c836a70761b4214ffb4'
'05cca683b21ba0c8d22135f1f1f01da134be175de49fe7076200d7fe3efa4dce'
'0284f51a2b2be39e74592ef03fa24f6af4665c27d84b421f266ae503013eb104'
'50d8a52cc33501898e7a01b00e8e5965c1ef7f37f26039a4380788ce7639a04c')
# Helper macros to help make tasks easier #
@@ -106,29 +90,21 @@ prepare() {
cd "${srcdir}"/msys2-runtime
del_file_exists winsup/cygwin/msys2_path_conv.cc \
winsup/cygwin/msys2_path_conv.h
apply_git_am_with_msg 0001-Add-MSYS-triplets.patch \
0002-Rename-DLL-from-cygwin-to-msys.patch \
apply_git_am_with_msg 0001-Add-MSYS2-triplet.patch \
0002-Rename-dll-from-cygwin-to-msys.patch \
0003-Add-functionality-for-converting-UNIX-paths-in-argum.patch \
0004-Add-functionality-for-changing-OS-name-via-MSYSTEM-e.patch \
0005-Move-root-to-usr.-Change-sorting-mount-points.-Do-no.patch \
0006-Do-not-create-cygwin-symlinks.-Instead-use-deep-copy.patch \
0007-Automatically-rewrite-TERM-msys-to-TERM-cygwin.patch \
0007-Automatically-rewrite-TERM-msys-to-TERM-cygwin-With-.patch \
0008-Do-not-convert-environment-for-strace.patch \
0009-convert-be-more-careful-to-stay-within-the-buffer.patch \
0010-convert-check-safely-whether-we-could-allocate-the-b.patch \
0011-convert-use-the-elegant-realloc-call.patch \
0012-convert-plug-potential-memory-leak.patch \
0013-convert-warn-when-we-cut-off-a-path.patch \
0014-arg_heuristic-be-better-prepared-to-handle-path-list.patch \
0015-Fix-converting-argument-looks-like-DVAR-str1-c-path1.patch \
0016-Special-case-for-converting-root-directory-to-have-t.patch \
0017-dcrt0.cc-Untangle-allow_glob-from-winshell.patch \
0018-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch \
0019-strace.cc-Don-t-set-MSYS-noglob.patch \
0020-Add-debugging-for-build_argv.patch \
0021-Add-debugging-for-strace-make_command_line.patch \
0022-environ.cc-New-facility-environment-variable-MSYS2_E.patch \
0023-path.cc-Ignore-zero-length-exclusions.patch \
0009-Special-case-for-converting-root-directory-to-have-t.patch \
0010-dcrt0.cc-Untangle-allow_glob-from-winshell.patch \
0011-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch \
0012-strace.cc-Don-t-set-MSYS-noglob.patch \
0013-Add-debugging-for-build_argv.patch \
0014-Add-debugging-for-strace-make_command_line.patch \
0015-environ.cc-New-facility-environment-variable-MSYS2_E.patch \
0024-Fix-native-symbolic-link-spawn-passing-wrong-arg0.patch
}