Output from mkpasswd/mkgroup ... Again confused (2)

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Nov 27 20:33:00 GMT 2014

On Nov 27 18:41, Houder wrote:
> > On Nov 27 17:12, Houder wrote:
> >> Hi Corinna,
> >>
> >> For comparison: output of 'mkpasswd -l' with and without /etc/nsswitch.conf present. Without it, my machine
> >> is NOT a 'foreign machine'. When it is present, my machine is a 'foreign machine'. Strikes me as ...
> >>
> >> Until now, I believed that the output of mkpasswd/mkgroup had no dependency on /etc/nsswitch.conf.
> >
> > The most recent version has.  Here's what happens.  If you call mkpasswd
> > without parameter, it just calls Cygwin's internal enumeration functions.
> > If you call with -l, it checks if `passwd:' is set to "files" only in
> > /etc/nsswitch.conf.  If so, it uses the old enumeration functions inside
> > mkpasswd, which don't generate prefixed usernames for local accounts
> > even on AD machines.  However, the uids/gids differ when using this
> > method.  I could change the offset in this case to reduce the chance for
> > a difference, but hey, there's no good reason to use /etc/passwd at all
> > in your scenario :}
> ... ahem, you keep saying that (no need for /etc/passwd) to me :-)) However, my (personal) bin
> directory has a script called mkpasswd_r(edacted) ... that modifies the uid of some of my users
> (yes, me, and a few aliases for me).
> And I am sure, that I am not the only one with a script like that ...
> Above you are explaining _implementation_ ... not specification.

There is none.  It's a helper tool which is supposed to be run only on
demand, and the uids usually don't matter, as long as they are unique.

But, anyway, you asked for it, you got it.  I applied a patch to
mkpasswd/mkgroup to generate uids/gids for the local machine always
using the same offset as when Cygwin computes them.

Check out the latest snapshot from http://cygwin.com/snapshots/


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141127/a38f15db/attachment.sig>

More information about the Cygwin mailing list