From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 025663858D39; Mon, 3 Apr 2023 18:36:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 025663858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680546971; bh=jrzaEwQstWh5JbINEi3aZCUSvghahCyj4XdqyKOn9CQ=; h=From:To:Subject:Date:From; b=WZTeBWA9Zno+gNF9sdLojxCeSV5Kvkn8mSSz04fKmCZAiAMz5p1o+SWmEPVb+RPhY 5y+YvibdO/K4OwRKmwLMMqWw69GxMTZwEo+SthNAWFAe+iZnW/cRt9V67AZI1Je4aI +NaSD91bFrPtN3Q8VoR7vAQVIZZYeDyR1JLCkidY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Respect `db_home` setting even for SYSTEM/Microsoft accounts X-Act-Checkin: newlib-cygwin X-Git-Author: Johannes Schindelin X-Git-Refname: refs/heads/main X-Git-Oldrev: 544aa97f860ed97f609cccefee7bdef87bca3f68 X-Git-Newrev: cc8404039f50c36100fbad85a3af22d579d3576a Message-Id: <20230403183611.025663858D39@sourceware.org> Date: Mon, 3 Apr 2023 18:36:10 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dcc8404039f5= 0c36100fbad85a3af22d579d3576a commit cc8404039f50c36100fbad85a3af22d579d3576a Author: Johannes Schindelin AuthorDate: Mon Apr 3 16:45:03 2023 +0200 Commit: Corinna Vinschen CommitDate: Mon Apr 3 18:17:43 2023 +0200 Respect `db_home` setting even for SYSTEM/Microsoft accounts =20 We should not blindly set the home directory of the SYSTEM account (or of Microsoft accounts) to `/home/`, especially `/etc/nsswitch.conf` defines `db_home: env`, in which case we want to respect the `HOME` variable. =20 Signed-off-by: Johannes Schindelin Diff: --- winsup/cygwin/uinfo.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index baa670478dfe..d493d29b3bd3 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -2234,7 +2234,11 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t= &arg, cyg_ldap *pldap) it to a well-known group here. */ if (acc_type =3D=3D SidTypeUser && (sid_sub_auth_count (sid) <=3D 3 || sid_id_auth (sid) =3D=3D 11)) - acc_type =3D SidTypeWellKnownGroup; + { + acc_type =3D SidTypeWellKnownGroup; + home =3D cygheap->pg.get_home ((PUSER_INFO_3) NULL, sid, dom, name, + fully_qualified_name); + } switch ((int) acc_type) { case SidTypeUser: