This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Group Permissions on root folders problem (Windows 10 TP build 10061)

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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]