bug in csih?
Len Giambrone
Leonard.Giambrone@intersystems.com
Mon Feb 23 20:11:00 GMT 2015
Perhaps you want:
grep -Eq "^{file}:" /etc/nsswitch.conf && { grep -Eq
"^${file}:[^#]*\<db\>" /etc/nsswitch.conf || use_file=0 }
Or even more simply (since the first clause is really subsumed by the
second):
grep -Eq "^${file}:[^#]*\<db\>" /etc/nsswitch.conf || use_file=0
On 02/23/2015 01:37 PM, Len Giambrone wrote:
> My bad, csih_old_cygwin works as documented.
> But there is a bug in csih_use_file_etc:
>
> $ cat /etc/nsswitch.conf
> # /etc/nsswitch.conf
> #
> # This file is read once by the first process in a Cygwin process
> tree.
> # To pick up changes, restart all Cygwin processes. For a description
> # see
> https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
> #
> # Defaults:
> # passwd: files db
> # group: files db
> # db_home: cygwin desc
> # db_shell: cygwin desc
> # db_gecos: cygwin desc
>
> This is not working correctly:
>
> if [ ${use_file} -ne 0 -a -f /etc/nsswitch.conf ]
> then
> grep -Eq "^${file}:" /etc/nsswitch.conf &&
> grep -Eq "^${file}:[^#]*\<db\>" /etc/nsswitch.conf ||
> use_file=0
> fi
>
> $ grep -Eq "^${file}:" /etc/nsswitch.conf && grep -Eq
> "^${file}:[^#]*\<db\>" /etc/nsswitch.conf || echo foo
> foo
>
> I don't think that's what you want. Both of the greps are false
> (returning 1) and use_file is being set to 0.
>
>
>
> On 02/23/2015 12:55 PM, Len Giambrone wrote:
>> If that is the case, then there is a bug in csih_old_cygwin:
>>
>> build@wx64lg /usr/share/csih
>> $ uname -a
>> CYGWIN_NT-6.1 wx64lg 1.7.34(0.285/5/3) 2015-02-04 12:14 x86_64 Cygwin
>>
>> build@wx64lg /usr/share/csih
>> $ less cygwin-service-installation-helper.sh
>>
>> build@wx64lg /usr/share/csih
>> $ . cygwin-service-installation-helper.sh
>>
>> build@wx64lg /usr/share/csih
>> $ csih_old_cygwin
>>
>> build@wx64lg /usr/share/csih
>> $ echo $?
>> 1
>>
>> My nsswitch.conf is the default:
>>
>> $ cat /etc/nsswitch.conf
>> # /etc/nsswitch.conf
>> #
>> # This file is read once by the first process in a Cygwin process
>> tree.
>> # To pick up changes, restart all Cygwin processes. For a
>> description
>> # see
>> https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
>> #
>> # Defaults:
>> # passwd: files db
>> # group: files db
>> # db_home: cygwin desc
>> # db_shell: cygwin desc
>> # db_gecos: cygwin desc
>>
>>
>> On 02/23/2015 12:34 PM, Corinna Vinschen wrote:
>>> On Feb 23 11:48, Len Giambrone wrote:
>>>> csih_use_file_etc returns 0 on my system (as it should with no
>>>> passwd file,
>>>> right?)
>>> Uhm, no. It should return 0 if you *use* the files (0 == true in the
>>> shell), That should be only the case if you're running Cygwin 1.7.33
>>> or if your nsswitch.conf file says so. What's the content of your
>>> /etc/nsswitch.conf?
>>>
>>>
>>> Corinna
>>>
>>
>
--
-Len
--
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
More information about the Cygwin
mailing list