X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:content-type:mime-version:subject:from
	:in-reply-to:date:content-transfer-encoding:message-id
	:references:to; q=dns; s=default; b=rBLF8KPOArpvGu+gS/ByDj+RhDRo
	mh1giH5dkmHk634097GQG9DfvdyNlvO1UbYH38N9NhG27PnTcVRVjsZC/YxNt1/7
	BvduLFIJ6Ux66Qt3NEFIzzmn5o2HeCU5Wo71kXP8cuAP1H8+c/VnalEwzWp8dqKa
	HFq4V/kwKPxykhw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:content-type:mime-version:subject:from
	:in-reply-to:date:content-transfer-encoding:message-id
	:references:to; s=default; bh=dpqTY6vHkCt8NAGp6DHbgEVdeSU=; b=Rd
	VQzVm7a8AK8Zifj8Aq0N6xN/kVggilKX3ulCD2TPKYM4TnC06eta0fgnD7IcPKB4
	XMV2YafeFvJZPYrs1qGRjjylmlTyNBK/Nu360sel3SFRdaiMkh4TL+mD6RGyZ6dd
	RiSIeY1Bc8r3LkQa7BZZfH1MEyI5NLRL2vztvdSdk=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: tangentsoft.com
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\))
Subject: Re: Testers needed:  New passwd/group handling in Cygwin
From: Warren Young <warren@etr-usa.com>
In-Reply-To: <20140215125043.GK2246@calimero.vinschen.de>
Date: Sun, 16 Feb 2014 03:30:56 -0700
Message-Id: <7F9D4826-E8D5-41E7-A8B6-B41922FE6E1C@etr-usa.com>
References: <20140213143849.GH2246@calimero.vinschen.de> <52FD63BC.60800@etr-usa.com> <20140214104243.GY2246@calimero.vinschen.de> <52FE786F.9040203@etr-usa.com> <20140215125043.GK2246@calimero.vinschen.de>
To: cygwin@cygwin.com
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id s1GAVEFR010258

On Feb 15, 2014, at 5:50 AM, Corinna Vinschen wrote:

> I grabbed all of this including your followup
> change shamelessly and added it to the text.

Happy to provide it.

>> It seems to me that we really only need a single Boolean setting:
>> 
>>   ignore_db=true
> 
> No, that's not right.  We have two mechanisms implemented you can
> choose three out of four possible combinations:
> 
> files only
> db only
> files, then db

Yes, I realize that.

While composing the previous email, I considered a 2-Boolean design:

   ignore_db=false
   ignore_files=false

I rejected that design when I realized that ignore_files is redundant with respect to /etc/foo file existence.  If the files are present, use them.  If not, you have a DB-only configuration.

I consider it an advantage of this design that it is not possible for the files to be present but ignored.  It avoids confusion, both human and software.

A person modifying /etc/passwd expects the change to take immediate effect.  (Obviously SAM or AD could mask it, but…)

Software that scans /etc/passwd expects that the data found within have relevance to system operation.

The nonsense configuration — ignore files *and* ignore DB — is still possible to achieve with the 1-Boolean design.  Set ignore_db=true and remove the /etc files.  Cygwin should simply treat this as a “DB-only” configuration, since that’s the only place it *can* get answers.

> It drops any check for existence, too, which
> is one code point less which has to run for each getpwXXX/getgrXXX
> invocation.

Cygwin should check for file existence at the process tree start, where it reads /etc/nsswitch.conf.  If the files are missing at that time, set the “ignore_files” flag.

Cygwin should use that flag instead of explicit file existence tests for the same reason it doesn’t keep re-reading nsswitch.conf.  If the files are missing at process tree start, then later created, you have to create a new process tree for the new files to be used.

This is no sacrifice.  If you use a 2-Boolean design, you only end up in the code fork where file checking is done if ignore_files == false.  That means there is no point to checking for file existence explicitly. Just blindly try to read the files; if the file is missing, the open will fail, so your check is implicit in the attempt.
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


