[PATCH 1/3 v2] Cygwin: accounts: Unify nsswitch.conf db_* defaults

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Apr 21 09:12:03 GMT 2020


Hi David,

source patch is ok, just the docs...

On Apr 20 19:20, David Macek via Cygwin-patches wrote:
> diff --git a/winsup/doc/ntsec.xml b/winsup/doc/ntsec.xml
> index 5287845686..032bebe4dc 100644
> --- a/winsup/doc/ntsec.xml
> +++ b/winsup/doc/ntsec.xml
> @@ -874,9 +874,6 @@ set up to all default values:
>    db_prefix:    auto
>    db_separator: + -->
>    db_enum:  cache builtin
> -  db_home:  /home/%U
> -  db_shell: /bin/bash
> -  db_gecos: <empty>
>  </screen>

I'm not exactly happy with removing these lines.  While your patch is
*technically* correct in terms of schemata, these *are* the default
values.  The target audience are users.  A simple overview like the
above is helpful to just look up the defaults, while the technical
description below is for the more in-depth view.

So from my POV this hunk should be remove from your patch.

>  <sect4 id="ntsec-mapping-nsswitch-syntax"><title id="ntsec-mapping-nsswitch-syntax.title">The <filename>/etc/nsswitch.conf</filename> syntax</title>
> @@ -1508,15 +1505,8 @@ of each schema when used with <literal>db_home:</literal>
>  
>  <para>
>  As has been briefly mentioned before, the default setting for
> -<literal>db_home:</literal> is
> -</para>
> -
> -<screen>
> -  db_home: /home/%U
> -</screen>
> -
> -<para>
> -So by default, Cygwin just sets the home dir to
> +<literal>db_home:</literal> defines no schemata, which means only the fallback
> +option is used, so by default, Cygwin just sets the home dir to

Just adding text on top and trying to keep the former wording intact
doesn't do justice to the actual change here.  I'd like to suggest a
stronger rephrasing, along the lines of

  <literal>db_home:</literal> defines no default schemata.  If this
  setting is not present in <filename>/etc/nsswitch.conf</filename>,
  the fallback is to set the home directory to 
  <filename>/home/$USERNAME</filename>.  This is equivalent to
  a <filename>/etc/nsswitch.conf</filename> settting of

  <screen>
    db_home: /home/%U
  </screen>

Same or similar in the db_shell case.  db_gecos is fine as is.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


More information about the Cygwin-patches mailing list