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)

On 09/10/2015 11:31 AM, Corinna Vinschen wrote:

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

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

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