This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Group Permissions on root folders problem (Windows 10 TP build 10061)
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Eric Blake <eblake at redhat dot com>, cygwin at cygwin dot com
- Date: Fri, 11 Sep 2015 03:39:36 +0300
- Subject: Re: Group Permissions on root folders problem (Windows 10 TP build 10061)
- Authentication-results: sourceware.org; auth=none
- References: <CAMH9mcFEL3mao+m-DEYM84kC1HOPeSBpZXD+mDf0USobF9oY7g at mail dot gmail dot com> <CAMH9mcFOKjvjiFvvk1ju0ZxBDK28MaktdnYwj5_CjvbgnpVO4A at mail dot gmail dot com> <20150616155843 dot GE31537 at calimero dot vinschen dot de> <20150905155916 dot 8403bea8d4f631c1f7a314e3 at nifty dot ne dot jp> <20150906114444 dot GA27066 at calimero dot vinschen dot de> <20150910200439 dot bf06449af4f1e6efcb76676e at nifty dot ne dot jp> <20150910172348 dot GB26699 at calimero dot vinschen dot de> <55F1BD86 dot 1090001 at redhat dot com> <20150910173128 dot GD26699 at calimero dot vinschen dot de> <55F1BF8A dot 2050907 at redhat dot com>
- Reply-to: cygwin at cygwin dot com
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