Cygwin 3.5 mapping uid/gid on NFSv4 filesystem to unexpected IDs ...

Roland Mainz roland.mainz@nrubsig.org
Mon Nov 13 20:41:21 GMT 2023


On Mon, Nov 13, 2023 at 8:39 PM Corinna Vinschen
<corinna-cygwin@cygwin.com> wrote:
>
> On Nov 10 13:22, Roland Mainz wrote:
> > On Tue, Oct 31, 2023 at 5:20 PM Roland Mainz <roland.mainz@nrubsig.org> wrote:
> > >
> > > Is the Cygwin behaviour (i.e. mapping of NFS3Attr uid/gid to different
> > > uid/gid in Cygwin $ ls -n #) intended ?
> >
> > In the meantime I tried this:
> > ---- snip ----
> > # Map NFSv4 uid/gid 1:1 to Cygwin uid/gid - does not work
> > regtool -i set '/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/NTDS/trustPosixOffset'
> > 0x0
> > regtool -i set '/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Netlogon/Parameters/trustPosixOffset'
> > 0x0
> > ---- snip ----
>
> This can't work.  trustPosixOffset is not a value in the registry. It's
> stored in AD only and fetched from the domain's system container via
> LDAP.
>
> uid/gid mapping between NFS server and Cygwin works by utilizing the NFS
> client's identity mapping as described in
> https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nfs

OK...
... note that this is our new NFSv4.1 driver for Windows, not the
Microsoft NFSv3 driver which comes with Windows (10) itself.

> If this doesn't fit your needs, you have to overload what's given to you
> by maintaining this info via /etc/passwd and /etc/group entries.

OK, I'll try to do some digging from there...

Another question:
In the original email I send this output:
---- snip ----
$ ls -la
total 1386
drwxr-xr-x  5 Unix_User+197608 Unix_Group+197121     120 Oct 31 11:53 .
drwxrwxrwt  3 Unix_User+0      Unix_Group+0           60 Oct 27 17:36 ..
drwxr-xr-x 14 Unix_User+197608 Unix_Group+197121    3660 Oct 31 05:16 bash
drwxr-xr-x  2 Unix_User+197608 Unix_Group+197121      60 Oct 30 12:46
junctiontest1
drwxr-xr-x  3 Unix_User+197608 Unix_Group+197121      80 Oct 31 11:54 ksh
-rwxr-xr-x  1 Unix_User+197608 Unix_Group+197121 1411059 Oct 30 13:05 xxx

$ ls -lan
total 1386
drwxr-xr-x  5 4278387688 4278387201     120 Oct 31 11:53 .
drwxrwxrwt  3 4278190080 4278190080      60 Oct 27 17:36 ..
drwxr-xr-x 14 4278387688 4278387201    3660 Oct 31 05:16 bash
drwxr-xr-x  2 4278387688 4278387201      60 Oct 30 12:46 junctiontest1
drwxr-xr-x  3 4278387688 4278387201      80 Oct 31 11:54 ksh
-rwxr-xr-x  1 4278387688 4278387201 1411059 Oct 30 13:05 xxx
---- snip ----

username "Unix_User+197608" in this case gets the numeric Cygwin
uid=='4278387688', while the expected uid would be '197608' (what the
NFSv4.1 driver sets in the Nfsv3Attr API).
Little bit playing around inthe Cygwin shell gives me $ bash -c 'echo
$((4278387688 - 0xFF000000))' # which prints the expected "197608" ...
... where in the Cygwin codebase is 0xFF000000 applied to the uid from
the NFSv4.1 driver - and WHY ?

----

Bye,
Roland
-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)


More information about the Cygwin-developers mailing list