summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2025-01-26 04:24:51 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2025-01-26 04:24:51 (GMT)
commitb1129d299b48bb51e6d089b4b82e291013276dcd (patch)
treeebc349927be9902fed1c9e0e4b823875831e4309
parente0d39ceda995d082622e8593bf64d621deb90d6e (diff)
downloadtcl-b1129d299b48bb51e6d089b4b82e291013276dcd.zip
tcl-b1129d299b48bb51e6d089b4b82e291013276dcd.tar.gz
tcl-b1129d299b48bb51e6d089b4b82e291013276dcd.tar.bz2
Proposed fix [4f0b5767ac]. exec of App Execution Alias
-rw-r--r--win/tclWinPipe.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 7b083a5..6949877 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -1327,11 +1327,22 @@ ApplicationType(
hFile = CreateFileW(nativeFullPath,
GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL, NULL);
+ FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OPEN_REPARSE_POINT, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
continue;
}
+ if (attr & FILE_ATTRIBUTE_REPARSE_POINT) {
+ /*
+ * But [4f0b5767ac]. Likely a App Execution Alias. This can only
+ * be a Win32 APP. Attempt to ReadFile below will fail. We assume
+ * that if it is on the PATH, and it is a reparse point, it is an
+ * App Execution Alias.
+ */
+ applType = APPL_WIN32;
+ break;
+ }
+
header.e_magic = 0;
ReadFile(hFile, (void *)&header, sizeof(header), &read, NULL);
if (header.e_magic != IMAGE_DOS_SIGNATURE) {