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=hD5avdBA4XyPqulz
	sbwKYrmpyvcGXm6G5PgdmpS+NFd0h+CWy2GQe3jjm40/rYg8CHJlRo61llw7a8cE
	9AscqXL55rS8kq3++YEB97XKnxfBv1gEL71JDyJUpfevkzOfMyLY6d43Ddr3jPY1
	Osa+NtgVNLd8DixdDuqXYa/1Pwo=
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=R5P/3rwaN4k4fV/9Ja4Tzt
	jncxI=; b=Brl/ab1AgRe7CCDRj1uKHtnIL0iIhL3FGOOApO3jzY7WMxxA+2SRk8
	k54IDXm+9wDGlxbhF1nH30T1wPLvpaD76Foj+Jjn4TWwx7+IYp4jbA9PkEKIjn8n
	aSYM26jAAKB49ViUXX/LmMPW4AwsTNHnlhOw0pg12s8LMxqhOHvL4=
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 03:39:36 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <719333680.20150911033936@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: <55F1BF8A.2050907@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>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Eric Blake!

>>>>> -      if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" ]
>>>>> +      if [ "\\\\${COMPUTERNAME,,*}" != "${LOGONSERVER,,*}" \
>>>>> +     -a "${LOGONSERVER}" != "\\\\MicrosoftAccount" ]
>>>>>        then
>>>>>    # Lowercase of USERDOMAIN
>>>>>            csih_PRIVILEGED_USERNAME="${COMPUTERNAME,,*}+${username}"
>>>>
>>>> Thanks a lot, much appreciated.  Patch applied.
>>>
>>> [ ... -a ... ] is not portable; there are some inherently ambiguous
>>> situations that it cannot handle. POSIX recommends that you spell it [
>>> ... ] && [ ... ] instead.
>> 
>> Does this matter in this very situation?  This is always running under
>> bash, btw.  Bash's a requirement for the csih helper script.

> Because you are at least using bash, you will get consistent behavior;
> and because both ... are 3-argument tests, it is unlikely that one of
> the tests can be confused with other operators like '(' or ')'.  So, I
> guess it's okay to leave it alone here.  But even with bash, the use of
> -a can cause problems when testing user-supplied variables that might
> happen to expand to text that looks like potential operators.

If a script author did not quote the indirect references, it is their fault,
not an inherent "portability issue".
I don't see, how your statement could be valid.
The "[ ... ] && [ ... ]" doesn't mean the same as testing two conditions in
one statement.


-- 
With best regards,
Andrey Repin
Friday, September 11, 2015 02:57:58

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

