From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout07.t-online.de (mailout07.t-online.de [194.25.134.83]) by sourceware.org (Postfix) with ESMTPS id B01FB3858D3C for ; Tue, 23 Aug 2022 17:27:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B01FB3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=t-online.de Received: from fwd73.dcpf.telekom.de (fwd73.aul.t-online.de [10.223.144.99]) by mailout07.t-online.de (Postfix) with SMTP id 7A2C47232; Tue, 23 Aug 2022 19:27:20 +0200 (CEST) Received: from [192.168.2.101] ([79.230.170.147]) by fwd73.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1oQXgO-0bn7js0; Tue, 23 Aug 2022 19:27:20 +0200 Subject: Re: [PATCH setup] Add new option --chown-admin To: Jon Turney , "cygwin-apps@cygwin.com" References: <3096f251-d7ca-073b-d7d7-751b7fe3e8c1@t-online.de> <405df5c6-ce47-0254-ae4d-4a23ff3533d5@dronecode.org.uk> <5b45ccdc-da32-ff11-037f-c00828f397c5@dronecode.org.uk> <32655945-5075-0823-2a1d-b72caa4b7791@t-online.de> From: Christian Franke Message-ID: <038c3558-b424-3e4b-9de6-bd3eb6147406@t-online.de> Date: Tue, 23 Aug 2022 19:27:18 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 SeaMonkey/2.53.12 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TOI-EXPURGATEID: 150726::1661275640-0144F70D-5190CFF9/0/0 CLEAN NORMAL X-TOI-MSGID: 3b6c8ebe-8cd9-4cd7-94e2-57be9dd1d2ba X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, BODY_8BITS, FREEMAIL_FROM, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2022 17:27:23 -0000 Jon Turney wrote: > On 12/07/2022 13:50, Jon Turney wrote: >> [Replying to the right list this time...] >> On 09/07/2022 13:21, Christian Franke wrote: > [...] >>> >>> The UserSettings ctor has a somewhat hidden side effect which sets >>> root_scope correctly: >>> >>>   UserSettings::UserSettings(...); >>>    open_settings("setup.rc", ...); >>>     io_stream::open("cygfile:///etc/setup/setup.rc", ...); >>> io_stream_cygfile::io_stream_cygfile("/etc/setup/setup.rc", ...); >>>       get_root_dir_now(); >>>        read_mounts(""); >>>         read_mounts_nt(""); >>>          root_scope = isuser ? IDC_ROOT_USER : IDC_ROOT_SYSTEM; >>> >>> Conclusion: Regression introduced Feb 24, 2012 (befc9dd). >>> >> >> Thanks for tracking this down. >> >> That just seems... fractally wrong. > > I kind of lost track of this.  Is there anything else needed to fix > the original problem here?  Or is it solved by the change to defer > setting the group until after root_scope is known? > > The group seems to be correctly set now. An old problem still remains: root_scope always ends up as IDC_ROOT_SYSTEM if setup is run elevated, regardless off GUI setting. Apply the temporary patch from here to see what happens: https://sourceware.org/pipermail/cygwin-apps/2022-July/042151.html Possibly difficult to fix, in particular in conjunction with later changes via [< Back] button. An easier approach: Remove the GUI setting and connect root_scope to -B option.