X-Recipient: archive-cygwin AT delorie DOT 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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=VDIdJmu9xP3O+hkYANIDRaL5vBCMSa4BRdOPObEIImK AMktXwdpB36ayvBZIYd0zkF4euuaHo1jxHo7eW7U0MrO1mwp8+83HSriZ5+j0saw GEG8Re/hEvALb5WkS8qCgD6ZtoiJAqr24kVcWv7ps/7NsRoFzY2wUQ2cemvlb3u0 = 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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=fCOOgwbBDWeQEpWEkj4DXYgx7mo=; b=wslaV7WCcKs9YsuIP TNUjPWoH2oRDdPg3HiH/z91CIACBpbHaGp6Y94p1scSeOXP/AGtQSE6npYmUOC6g pIOivhF05ZD2s0hyI0PIcCQqMlCA0eFlZWtIYyROt5zAuZ011bWxEBti1rvl0PhV mBRkrnWBLV6E7S8L4yNjW4WqHQ= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail2.intersystems.com X-InterSystems: Sent from InterSystems X-InterSystems: Sent from InterSystems Message-ID: <54EB79D4.3030607@intersystems.com> Date: Mon, 23 Feb 2015 14:04:52 -0500 From: Len Giambrone User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Subject: Re: bug in csih? References: <54E7C402 DOT 80306 AT intersystems DOT com> <20150223120522 DOT GI437 AT calimero DOT vinschen DOT de> <20150223144715 DOT GS437 AT calimero DOT vinschen DOT de> <54EB5208 DOT 8050009 AT intersystems DOT com> <54EB59E5 DOT 7050304 AT intersystems DOT com> <20150223173428 DOT GA26549 AT calimero DOT vinschen DOT de> <54EB698A DOT 7080700 AT intersystems DOT com> <54EB7372 DOT 1010104 AT intersystems DOT com> In-Reply-To: <54EB7372.1010104@intersystems.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Perhaps you want: grep -Eq "^{file}:" /etc/nsswitch.conf && { grep -Eq "^${file}:[^#]*\" /etc/nsswitch.conf || use_file=0 } Or even more simply (since the first clause is really subsumed by the second): grep -Eq "^${file}:[^#]*\" /etc/nsswitch.conf || use_file=0 On 02/23/2015 01:37 PM, Len Giambrone wrote: > My bad, csih_old_cygwin works as documented. > But there is a bug in csih_use_file_etc: > > $ cat /etc/nsswitch.conf > # /etc/nsswitch.conf > # > # This file is read once by the first process in a Cygwin process > tree. > # To pick up changes, restart all Cygwin processes. For a description > # see > https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch > # > # Defaults: > # passwd: files db > # group: files db > # db_home: cygwin desc > # db_shell: cygwin desc > # db_gecos: cygwin desc > > This is not working correctly: > > if [ ${use_file} -ne 0 -a -f /etc/nsswitch.conf ] > then > grep -Eq "^${file}:" /etc/nsswitch.conf && > grep -Eq "^${file}:[^#]*\" /etc/nsswitch.conf || > use_file=0 > fi > > $ grep -Eq "^${file}:" /etc/nsswitch.conf && grep -Eq > "^${file}:[^#]*\" /etc/nsswitch.conf || echo foo > foo > > I don't think that's what you want. Both of the greps are false > (returning 1) and use_file is being set to 0. > > > > On 02/23/2015 12:55 PM, Len Giambrone wrote: >> If that is the case, then there is a bug in csih_old_cygwin: >> >> build AT wx64lg /usr/share/csih >> $ uname -a >> CYGWIN_NT-6.1 wx64lg 1.7.34(0.285/5/3) 2015-02-04 12:14 x86_64 Cygwin >> >> build AT wx64lg /usr/share/csih >> $ less cygwin-service-installation-helper.sh >> >> build AT wx64lg /usr/share/csih >> $ . cygwin-service-installation-helper.sh >> >> build AT wx64lg /usr/share/csih >> $ csih_old_cygwin >> >> build AT wx64lg /usr/share/csih >> $ echo $? >> 1 >> >> My nsswitch.conf is the default: >> >> $ cat /etc/nsswitch.conf >> # /etc/nsswitch.conf >> # >> # This file is read once by the first process in a Cygwin process >> tree. >> # To pick up changes, restart all Cygwin processes. For a >> description >> # see >> https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch >> # >> # Defaults: >> # passwd: files db >> # group: files db >> # db_home: cygwin desc >> # db_shell: cygwin desc >> # db_gecos: cygwin desc >> >> >> On 02/23/2015 12:34 PM, Corinna Vinschen wrote: >>> On Feb 23 11:48, Len Giambrone wrote: >>>> csih_use_file_etc returns 0 on my system (as it should with no >>>> passwd file, >>>> right?) >>> Uhm, no. It should return 0 if you *use* the files (0 == true in the >>> shell), That should be only the case if you're running Cygwin 1.7.33 >>> or if your nsswitch.conf file says so. What's the content of your >>> /etc/nsswitch.conf? >>> >>> >>> Corinna >>> >> > -- -Len -- 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