Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msys2-runtime: update to 1b8d886206ddb2f516f2448edac43f03054aca6c #179

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
From 66bb413b20c3ae24439b6ccbdb846fa80c46de8c Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Wed, 29 Nov 2023 23:49:00 +0100
Subject: [PATCH 68/N] fixup! Allow overriding the home directory via the HOME
variable

In preparation for integrating the patches that made it upstream via
https://inbox.sourceware.org/cygwin-patches/[email protected]/,
let's revert the original patches from Git for Windows' branch thicket.

This reverts commit 81a0e5d4a9566ebc22b857de5c61f0e12fa32192.

Signed-off-by: Johannes Schindelin <[email protected]>
---
winsup/cygwin/local_includes/cygheap.h | 3 +-
winsup/cygwin/uinfo.cc | 49 --------------------------
2 files changed, 1 insertion(+), 51 deletions(-)

diff --git a/winsup/cygwin/local_includes/cygheap.h b/winsup/cygwin/local_includes/cygheap.h
index c33f378..4828e57 100644
--- a/winsup/cygwin/local_includes/cygheap.h
+++ b/winsup/cygwin/local_includes/cygheap.h
@@ -406,8 +406,7 @@ public:
NSS_SCHEME_UNIX,
NSS_SCHEME_DESC,
NSS_SCHEME_PATH,
- NSS_SCHEME_FREEATTR,
- NSS_SCHEME_ENV
+ NSS_SCHEME_FREEATTR
};
struct nss_scheme_t {
nss_scheme_method method;
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index fefd984..b910878 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -738,8 +738,6 @@ cygheap_pwdgrp::nss_init_line (const char *line)
scheme[idx].method = NSS_SCHEME_UNIX;
else if (NSS_CMP ("desc"))
scheme[idx].method = NSS_SCHEME_DESC;
- else if (NSS_CMP ("env"))
- scheme[idx].method = NSS_SCHEME_ENV;
else if (NSS_NCMP ("/"))
{
const char *e = c + strcspn (c, " \t");
@@ -928,40 +926,6 @@ fetch_from_path (cyg_ldap *pldap, PUSER_INFO_3 ui, cygpsid &sid, PCWSTR str,
return ret;
}

-static size_t
-fetch_env(LPCWSTR key, char *buf, size_t size)
-{
- WCHAR wbuf[32767];
- DWORD max = sizeof wbuf / sizeof *wbuf;
- DWORD len = GetEnvironmentVariableW (key, wbuf, max);
-
- if (!len || len >= max)
- return 0;
-
- len = sys_wcstombs (buf, size, wbuf, len);
- return len && len < size ? len : 0;
-}
-
-static char *
-fetch_home_env (void)
-{
- char home[32767];
- size_t max = sizeof home / sizeof *home, len;
-
- if (fetch_env (L"HOME", home, max)
- || ((len = fetch_env (L"HOMEDRIVE", home, max))
- && fetch_env (L"HOMEPATH", home + len, max - len))
- || fetch_env (L"USERPROFILE", home, max))
- {
- tmp_pathbuf tp;
- cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE,
- home, tp.c_get(), NT_MAX_PATH);
- return strdup(tp.c_get());
- }
-
- return NULL;
-}
-
char *
cygheap_pwdgrp::get_home (cyg_ldap *pldap, cygpsid &sid, PCWSTR dom,
PCWSTR dnsdomain, PCWSTR name, bool full_qualified)
@@ -1021,10 +985,6 @@ cygheap_pwdgrp::get_home (cyg_ldap *pldap, cygpsid &sid, PCWSTR dom,
}
}
break;
- case NSS_SCHEME_ENV:
- if (RtlEqualSid (sid, cygheap->user.sid ()))
- home = fetch_home_env ();
- break;
}
}
return home;
@@ -1059,10 +1019,6 @@ cygheap_pwdgrp::get_home (PUSER_INFO_3 ui, cygpsid &sid, PCWSTR dom,
home = fetch_from_path (NULL, ui, sid, home_scheme[idx].attrib,
dom, NULL, name, full_qualified);
break;
- case NSS_SCHEME_ENV:
- if (RtlEqualSid (sid, cygheap->user.sid ()))
- home = fetch_home_env ();
- break;
}
}
return home;
@@ -1082,7 +1038,6 @@ cygheap_pwdgrp::get_shell (cyg_ldap *pldap, cygpsid &sid, PCWSTR dom,
case NSS_SCHEME_FALLBACK:
return NULL;
case NSS_SCHEME_WINDOWS:
- case NSS_SCHEME_ENV:
break;
case NSS_SCHEME_CYGWIN:
if (pldap->fetch_ad_account (sid, false, dnsdomain))
@@ -1147,7 +1102,6 @@ cygheap_pwdgrp::get_shell (PUSER_INFO_3 ui, cygpsid &sid, PCWSTR dom,
case NSS_SCHEME_CYGWIN:
case NSS_SCHEME_UNIX:
case NSS_SCHEME_FREEATTR:
- case NSS_SCHEME_ENV:
break;
case NSS_SCHEME_DESC:
if (ui)
@@ -1229,8 +1183,6 @@ cygheap_pwdgrp::get_gecos (cyg_ldap *pldap, cygpsid &sid, PCWSTR dom,
sys_wcstombs_alloc (&gecos, HEAP_NOTHEAP, val);
}
break;
- case NSS_SCHEME_ENV:
- break;
}
}
if (gecos)
@@ -1257,7 +1209,6 @@ cygheap_pwdgrp::get_gecos (PUSER_INFO_3 ui, cygpsid &sid, PCWSTR dom,
case NSS_SCHEME_CYGWIN:
case NSS_SCHEME_UNIX:
case NSS_SCHEME_FREEATTR:
- case NSS_SCHEME_ENV:
break;
case NSS_SCHEME_DESC:
if (ui)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 94c27b7454b479c335fd83685b1e973ab6fdae2d Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Wed, 29 Nov 2023 23:50:00 +0100
Subject: [PATCH 69/N] fixup! Respect `db_home` setting even for the SYSTEM
account

In preparation for integrating the patches that made it upstream via
https://inbox.sourceware.org/cygwin-patches/[email protected]/,
let's revert the original patches from Git for Windows' branch thicket.

This reverts commit 22854f66a429d9bd583621f5b6e365fe9b88cd9d.

Signed-off-by: Johannes Schindelin <[email protected]>
---
winsup/cygwin/uinfo.cc | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index b910878..1dbd826 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -2194,11 +2194,7 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
it to a well-known group here. */
if (acc_type == SidTypeUser
&& (sid_sub_auth_count (sid) <= 3 || sid_id_auth (sid) == 11))
- {
- acc_type = SidTypeWellKnownGroup;
- home = cygheap->pg.get_home (pldap, sid, dom, domain, name,
- fully_qualified_name);
- }
+ acc_type = SidTypeWellKnownGroup;
switch ((int) acc_type)
{
case SidTypeUser:
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
From 8f9fcab47a1ac1457ac08d24b2e146f37082ea29 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <[email protected]>
Date: Wed, 29 Nov 2023 23:50:05 +0100
Subject: [PATCH 70/N] fixup! Respect the `db_home: env` setting under more
circumstances

In preparation for integrating the patches that made it upstream via
https://inbox.sourceware.org/cygwin-patches/[email protected]/,
let's revert the original patches from Git for Windows' branch thicket.

This reverts commit f0d56412872d931e55fde9406d390e2070f2befb.

Signed-off-by: Johannes Schindelin <[email protected]>
---
winsup/cygwin/uinfo.cc | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 1dbd826..00a447d 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -998,8 +998,6 @@ cygheap_pwdgrp::get_home (PUSER_INFO_3 ui, cygpsid &sid, PCWSTR dom,

for (uint16_t idx = 0; !home && idx < NSS_SCHEME_MAX; ++idx)
{
- if (!ui && home_scheme[idx].method != NSS_SCHEME_ENV)
- continue;
switch (home_scheme[idx].method)
{
case NSS_SCHEME_FALLBACK:
@@ -2138,9 +2136,6 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
{
/* Just some fake. */
sid = csid.create (99, 1, 0);
- if (arg.id == cygheap->user.real_uid)
- home = cygheap->pg.get_home(NULL, cygheap->user.sid(),
- NULL, NULL, false);
break;
}
else if (arg.id >= UNIX_POSIX_OFFSET)
@@ -2690,11 +2685,10 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
logon. Unless it's the SYSTEM account. This conveniently allows to
logon interactively as SYSTEM for debugging purposes. */
else if (acc_type != SidTypeUser && sid != well_known_system_sid)
- __small_sprintf (linebuf, "%W:*:%u:%u:U-%W\\%W,%s:%s:/sbin/nologin",
+ __small_sprintf (linebuf, "%W:*:%u:%u:U-%W\\%W,%s:/:/sbin/nologin",
posix_name, uid, gid,
dom, name,
- sid.string ((char *) sidstr),
- home ? home : "/");
+ sid.string ((char *) sidstr));
else
__small_sprintf (linebuf, "%W:*:%u:%u:%s%sU-%W\\%W,%s:%s%W:%s",
posix_name, uid, gid,
Loading