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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=Jt+ENnlOJUWmiDQG
	oNQzFP4mn89WTkEVKHqpRY+oIaRMAXrH/2HK01Q+fsy4mi/xQaJB8PteN8VtaTza
	5zH/2EGaSC/20opMZ1dN+8Ifqj/nKZuljtL0UW+y7eTvfY14WVK9KVkE3NoZQgDj
	sWmh62dWgQ/c7VoEf6GizSxXSJI=
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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=K6zVAy1CA1xeL38e8ge1dB
	QmxKU=; b=m9D7fF8jdFB74oTz0B998jJzhruweSbdv0f/eAZY0jaw86Rcy11/Xj
	rQ9r7FaW9hswLPbkHz2dn4fpoAnPgiWkvm86dkrIKb2XFkn8qqFzqCDXUpGZzVkf
	1gisJuXqypEd8HNdtsOtdwj7bHDtbn/ive90KLCWLRPu1qErnJK9c=
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=4.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2
X-HELO: smtp.ht-systems.ru
Date: Fri, 11 Sep 2015 05:00:28 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <1868430.20150911050028@yandex.ru>
To: Eric Blake <eblake@redhat.com>, cygwin@cygwin.com
Subject: Re: Group Permissions on root folders problem (Windows 10 TP build 10061)
In-Reply-To: <55F22D2E.3070801@redhat.com>
References: <CAMH9mcFEL3mao+m-DEYM84kC1HOPeSBpZXD+mDf0USobF9oY7g@mail.gmail.com>   <CAMH9mcFOKjvjiFvvk1ju0ZxBDK28MaktdnYwj5_CjvbgnpVO4A@mail.gmail.com>  <20150616155843.GE31537@calimero.vinschen.de>  <20150905155916.8403bea8d4f631c1f7a314e3@nifty.ne.jp>  <20150906114444.GA27066@calimero.vinschen.de>  <20150910200439.bf06449af4f1e6efcb76676e@nifty.ne.jp>  <20150910172348.GB26699@calimero.vinschen.de> <55F1BD86.1090001@redhat.com>  <20150910173128.GD26699@calimero.vinschen.de> <55F1BF8A.2050907@redhat.com>  <719333680.20150911033936@yandex.ru> <55F22D2E.3070801@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Eric Blake!

>>>>> [ ... -a ... ] is not portable; there are some inherently ambiguous
>>>>> situations that it cannot handle. POSIX recommends that you spell it [
>>>>> ... ] && [ ... ] instead.
>>>>

>> 
>> If a script author did not quote the indirect references, it is their fault,

> No, even with proper quoting, the use of -a and -o creates ambiguous
> situations.  For example, a naive read would claim that

> test "$var1" -a "$var2"

> sets $? to 0 only if both "$var1" and "$var2" are non-empty.  But
> according to the POSIX rules, if $var1 is '!' and $var2 is '', then this
> MUST be treated as the negation of the unary operator '-a "$var2"', if
> the shell has a unary -a (bash does, dash does not).  And in bash's
> case, '-a ""' is false (the empty string never exists as a file), so the
> negation is true, and you have a case where the -a version returned 0 in
> spite of one of the inputs being empty.

That's... great.
At the very least, we have a standard we can rely... refer... to... >.< sigh.

Thanks for your thorough explanation, much appreciated!

(And I have a set of scripts to rewrite...)


-- 
With best regards,
Andrey Repin
Friday, September 11, 2015 04:58:51

Sorry for my terrible english...


--
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

