Skip to content

Commit 05eafb9

Browse files
authored
Merge pull request #235 from git-for-windows/msys2-runtime-ceeecb01e13d0965a8993f04cf756096ba91dc35
msys2-runtime: update to 3.6.2-2
2 parents 9f2928e + 17182a1 commit 05eafb9

File tree

3 files changed

+82
-6
lines changed

3 files changed

+82
-6
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
From 1a222c8a01c2981a9343611c0d3a6afdff55d87b Mon Sep 17 00:00:00 2001
2+
From: Johannes Schindelin <[email protected]>
3+
Date: Tue, 3 Jun 2025 08:53:57 +0200
4+
Subject: [PATCH 48/N] Cygwin: do retrieve AzureAD users' information again
5+
6+
In 48e7d63268 (Cygwin: fetch_account_from_windows: skip LookupAccountSid
7+
for SIDs known to fail, 2025-04-10), several SIDs acquired a shortcut
8+
where a potentially expensive `LookupAccountSid()` call is avoided for
9+
SIDs that "cannot be resolved".
10+
11+
However, as reported by Robert Fensterman (and independently discovered
12+
by myself), some of the SIDs that received this special shortcut _do_
13+
get resolved by `LookupAccountSid()` calls: AzureAD users' SIDs.
14+
15+
With those SIDs, that newly-introduced shortcut actually does more harm
16+
than good because there is no other way to retrieve the desired
17+
information, resulting in permission problems.
18+
19+
One symptom of this is that `mintty` can no longer access `/dev/ptmx`
20+
and simply errors out with "Error: Could not fork child process: There
21+
are no available terminals (-1)".
22+
23+
Another symptom is that `tmux` is no longer able to create new sessions.
24+
Yet another symptom is new files are unintentionally written with
25+
restricted permissions (copying an `.exe` file, for example, disallows
26+
the copied version to be executed).
27+
28+
The most likely reason why AzureAD SIDs were included in above-mentioned
29+
commit is that special AzureAD _group_ SIDs are not recognized by
30+
`LookupAccountSid()`, as per the code comment for the `azure_grp_sid`
31+
variable. It is plausible that this fact was mistaken to extend to all
32+
AzureAD SIDs, a notion disproved by the counter example of my personal
33+
experience with my own AzureAD user account. Unfortunately, the only way
34+
to find out whether `LookupAccountSid()` works with a given AzureAD SID
35+
or not is to call that function.
36+
37+
To make regular AzureAD user accounts work again, let's just drop the
38+
AzureAD part from that special shortcut.
39+
40+
My understanding of the other SIDs handled by that shortcut (Capability
41+
SIDs, IIS APPPOOL and Samba user/group SIDs) is insufficient to
42+
determine whether they, too, can be resolved by `LookupAccountSid()` in
43+
some cases (and would therefore equally need to be excluded from that
44+
shortcut). At least as far as the Capability SIDs go, I am rather
45+
confident from reading the context (the commit's message, as well as the
46+
report that led to that commit) that the shortcut is safe, and I could
47+
imagine that the same is true for IIS APPPOOL and Samba SIDs. Absent any
48+
further insight, I therefore decided to leave the rest of 48e7d63268
49+
(Cygwin: fetch_account_from_windows: skip LookupAccountSid for SIDs
50+
known to fail, 2025-04-10) intact.
51+
52+
Reported-by: Robert Fensterman <[email protected]>
53+
Fixes: 48e7d63268 (Cygwin: fetch_account_from_windows: skip LookupAccountSid for SIDs known to fail, 2025-04-10)
54+
Signed-off-by: Johannes Schindelin <[email protected]>
55+
---
56+
winsup/cygwin/uinfo.cc | 4 ----
57+
1 file changed, 4 deletions(-)
58+
59+
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
60+
index 7c2581d..4323cb1 100644
61+
--- a/winsup/cygwin/uinfo.cc
62+
+++ b/winsup/cygwin/uinfo.cc
63+
@@ -1996,10 +1996,6 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
64+
if (sid_id_auth (sid) == 5 /* SECURITY_NT_AUTHORITY */
65+
&& sid_sub_auth (sid, 0) == SECURITY_APPPOOL_ID_BASE_RID)
66+
break;
67+
- /* AzureAD SIDs */
68+
- if (sid_id_auth (sid) == 12 /* AzureAD ID */
69+
- && sid_sub_auth (sid, 0) == 1 /* Azure ID base RID */)
70+
- break;
71+
/* Samba user/group SIDs */
72+
if (sid_id_auth (sid) == 22)
73+
break;

msys2-runtime/PKGBUILD

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
pkgbase=msys2-runtime
55
pkgname=('msys2-runtime' 'msys2-runtime-devel')
66
pkgver=3.6.2
7-
pkgrel=1
7+
pkgrel=2
88
pkgdesc="Cygwin POSIX emulation engine"
99
arch=('x86_64')
1010
url="https://www.cygwin.com/"
@@ -73,9 +73,10 @@ source=('msys2-runtime'::git+https://github.com/cygwin/cygwin#tag=cygwin-${pkgve
7373
0044-Make-paths-WCS-MBS-conversion-explicit.patch
7474
0045-Use-MB_CUR_MAX-6-by-default.patch
7575
0046-Change-the-default-base-address-for-x86_64.patch
76-
0047-msys2-runtime-restore-fast-path-for-current-user-pri.patch)
76+
0047-msys2-runtime-restore-fast-path-for-current-user-pri.patch
77+
0048-Cygwin-do-retrieve-AzureAD-users-information-again.patch)
7778
sha256sums=('9fb4bbcbd498a207e07a0d05161f86efbc60466f10b96c33d0b76194bd40a806'
78-
'6a03e8f8c5e6f008b9e0cb66de35de68634aa7fbb41b5c09e80b84db87d57dca'
79+
'e94bccf1cafe0717d0a19df35f69bdfe122bcdfcffac47a107c18fb50b4a5911'
7980
'e4082aff332507d6d5fefa5b7da2fcbbaa8b593ca158dbb1fe026a26b0e09d91'
8081
'1cd177791994917d0c4df391fdc96993c3275eddd2b5f475532c0f478b2be8eb'
8182
'81d0f97d558b413c1b6fc592c7c0c7cac0b8f1c650e6fb13c01f4ee25b049fce'
@@ -122,7 +123,8 @@ sha256sums=('9fb4bbcbd498a207e07a0d05161f86efbc60466f10b96c33d0b76194bd40a806'
122123
'18ee1eaa6ee1877536672fb02fc1a102b9cbbb65f5238b532c18ad4ea9b8910b'
123124
'8507ce68f7c29cacf89994e08eb89e66d2907a65ce7793cd8019e01a2705e425'
124125
'bbdd536345d096ee80191d936c1638baa9bb2d76f6118d0cf34e63cee8eb5dde'
125-
'da5ae57f1603ae3e08f27cc68da690f68dbb44f2f84f9bbc7e4a6d2456832348')
126+
'da5ae57f1603ae3e08f27cc68da690f68dbb44f2f84f9bbc7e4a6d2456832348'
127+
'53d30f6e2a3fabfaf6dd928c5e1d4c37311410fce33146969365f9c36b0e1bad')
126128

127129
# Helper macros to help make tasks easier #
128130
apply_patch_with_msg() {
@@ -223,7 +225,8 @@ prepare() {
223225
0044-Make-paths-WCS-MBS-conversion-explicit.patch \
224226
0045-Use-MB_CUR_MAX-6-by-default.patch \
225227
0046-Change-the-default-base-address-for-x86_64.patch \
226-
0047-msys2-runtime-restore-fast-path-for-current-user-pri.patch
228+
0047-msys2-runtime-restore-fast-path-for-current-user-pri.patch \
229+
0048-Cygwin-do-retrieve-AzureAD-users-information-again.patch
227230
}
228231

229232
build() {

msys2-runtime/msys2-runtime.commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0b9a01b6b59f03187dcf1b184addc93e8555415c
1+
ceeecb01e13d0965a8993f04cf756096ba91dc35

0 commit comments

Comments
 (0)