delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/08/04/11:53:16

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63AA13857726
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1691164394;
bh=CE/p0a1KOnZ40458+BJIr1s9s+QQD2cTYMsGfClJnq4=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=YZuWHEdlAGgGC+1lZBwvD+s1ipMGH4R1Anxn25vjU/JtV5DdeGhAWaVo1ahXcnYbr
yVp+jfJdQhetFBNQtvA3/HoeSII0UZaYHDifyjmL/SE2qDSZBwEVBQO5K8ofproe8v
iCvXRWrAvRD6bXpxPm8zZZSJFkTm6lahMrQoHkPw=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 916AD3858C62
X-Authority-Analysis: v=2.4 cv=J8G5USrS c=1 sm=1 tr=0 ts=64cd1ed9
a=DxHlV3/gbUaP7LOF0QAmaA==:117 a=DxHlV3/gbUaP7LOF0QAmaA==:17
a=IkcTkHD0fZMA:10 a=VEM4DMpWAAAA:8 a=w_pzkKWiAAAA:8 a=H7lvQPj3Q7OJN0ZuDLMA:9
a=QEXdDO2ut3YA:10 a=OO2XiV6ZNdAA:10 a=sRI3_1zDfAgwuvI8zelB:22
Message-ID: <dd5459e8-9eff-02d1-e1d9-644239a713ec@Shaw.ca>
Date: Fri, 4 Aug 2023 09:52:57 -0600
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Subject: Re: ms-nfs41 mount: Where does Unix_User+0 and Unix_Group+0 come from?
To: cygwin AT cygwin DOT com
References: <CANH4o6NGYsDPgnW7F6qdMWcEnET2yNKFwS-E=DUQtR9t8Q2Njg AT mail DOT gmail DOT com>
<CANH4o6OPQX9im5Ms_LxNgRxw8CEHMSNdwsKrfaYoRzQHS01TDw AT mail DOT gmail DOT com>
<CANH4o6M9c2PsezGYSpFvKc0HUS2=9vCpTgZ3JXYqRjFeH65mdA AT mail DOT gmail DOT com>
Organization: Inglis
In-Reply-To: <CANH4o6M9c2PsezGYSpFvKc0HUS2=9vCpTgZ3JXYqRjFeH65mdA@mail.gmail.com>
X-CMAE-Envelope: MS4xfErMkfY0T+AbV2upvmdnsDbaeVnGaWYaFDv+p2tavrEz4647H9v/7CvFP1iJ9FkxKSQ8rUx//l5OcQbeDrWF6jLOS5YHKecra9gGggwTJSUiMvYmC6G/
qo+XYYNGFhGovjAfsfXfG5ajZQJL5rS1FW4Zph7KOo+hhoppBL66tYtWQ1Dy+xDIixbwH6Uuwjr8d3xSHXO0g+9VKDvtYTZjF7XoN3enVBc8ynJ1Aoaolj1A
X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW,
SPF_HELO_NONE, SPF_PASS, TXREP,
URI_DOTEDU autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Brian Inglis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Brian Inglis <Brian DOT Inglis AT Shaw DOT ca>, Martin Wege <martin DOT l DOT wege AT gmail DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 374FrGmm004054

On 2023-08-03 17:38, Martin Wege via Cygwin wrote:
> On Fri, Aug 4, 2023 at 1:07 AM Martin Wege wrote:
>> On Thu, Aug 3, 2023 at 8:46 PM Martin Wege wrote:
>>> We are working to deploy the ms-nfs41-nfs-filesystem on our Windows
>>> machines, and encounter some issues with Cygwin (latest stable).
>>>
>>> For example, if we go to the ms-nfs41-nfs-filesystem (not the NFS
>>> version 3 client from Windows!!!) with cd X: ; cd tmp/data9/, and do a
>>> ls -l we get 'Unix_User+0' and 'Unix_Group+0' for user and group
>>> names.
>>> The question is: Where do these names come from - Windows,
>>> ms-nfs41-nfs-filesystem or Cygwin?
>>> getent passwd and getent group do not list this on Cygwin.
>>> NFS version 4 server "lordbatman" has user mlw=uid(3620) and group mlw=gid(3620)
>>>
>>> Steps to reproduce:
>>> 1. Download and install cygwin.
>>> 2. Download http://www.citi.umich.edu/projects/nfsv4/windows/120612/
>>> and install it.
>>> 3. Start NFS version 4 client daemon:
>>> ms-nfs41-client-x64/nfsd_debug.exe -d 3 --noldap --gid 3620 --uid 3620
>>> 4. Mount NFS version 4 directory:
>>> ms-nfs41-client-x64/ms-nfs41-client-x64/nfs_mount.exe -p -o sec=sys X
>>> 'lordbatman.bias.dfn.de:/export/home/mlw'
>>>
>>> Expectation:
>>> Cygwin ls -l should list file user/group as mlw/mlw
>>>
>>> Actual results:
>>> Cygwin ls -l lists file user/group as Unix_User+0/Unix_Group+0
>>
>> Did a cygwin source clone, and found this:
>> cygwin$ grep -r -E  'Unix_(User|Group)' .
>> ./newlib-cygwin/winsup/utils/mkgroup.c:             "Unix_Group",
>> ./newlib-cygwin/winsup/utils/mkgroup.c:                 "Unix_Group",
>> ./newlib-cygwin/winsup/utils/mkpasswd.c:                    "Unix_User",
>> ./newlib-cygwin/winsup/utils/mkpasswd.c:
>>
>> But I do not understand this code. In which cases are Unix_User+0 and
>> Unix_Group+0 used?
> 
> It just got more mysterious. I tried a ls -nl (uid, gid as numbers,
> not names from /etc/passwd and /etc/group), and got this:
> ls -nl
> total 78474
> -rwxr-xr-x 1 4278190080 4278190080    33063 Aug  3 12:02 CMakeCache.txt
> drwxr-xr-x 1 4278190080 4278190080      374 Aug  3 12:51 CMakeFiles
> -rwxr-xr-x 1 4278190080 4278190080     4790 Aug  3 12:02 CPackConfig.cmake
> -rwxr-xr-x 1 4278190080 4278190080     5276 Aug  3 12:02 CPackSourceConfig.cmake
> -rwxr-xr-x 1 4278190080 4278190080      440 Aug  3 12:03 CTestTestfile.cmake
> -rwxr-xr-x 1 4278190080 4278190080    77004 Aug  3 12:03 Makefile
> 
> So where does the "4278190080" come from, for uid and gid? Hexadecimal
> its 0xff000000, which might be related to this:
> ./newlib-cygwin/winsup/cygwin/local_includes/security.h
> /* For UNIX accounts not mapped to Windows accounts via winbind, Samba returns
>    SIDs of the form S-1-22-x-y, with x == 1 for users and x == 2 for groups,
>    and y == UNIX uid/gid.  NFS returns no SIDs at all, but the plain UNIX
>    uid/gid values.
> 
>    UNIX uid/gid values are mapped to Cygwin uid/gid values 0xff000000 +
>    unix uid/gid.  This *might* collide with a posix_offset of some trusted
>    domain, but it's *very* unlikely.  Define the mapping as macro. */
> #define UNIX_POSIX_OFFSET               (0xff000000)
> #define UNIX_POSIX_MASK                 (0x00ffffff)
> #define MAP_UNIX_TO_CYGWIN_ID(id)       (UNIX_POSIX_OFFSET \
>                                          | ((id) & UNIX_POSIX_MASK))
> 
> But why is it then Unix_User+0 and not Unix_User+3620 on Windows NFS?
> Same for Unix_Group+0 vs Unix_Group+3620?

So you want help relating to an unmaintained 15 year old student project, with 
no responses on their SF mailing list in the last few years (dropped from CC)?

Have you tried rebuilding the project with current tools on current Windows to 
identify potential problems?

Have you read the project (then) known issues i.e. limitations and failures?

Have you enabled test-signed drivers, installed the driver test cert, disabled 
DFS, and configured your driver to map that server's ids and permissions to 
Windows, and have these been implemented successfully i.e. can you test they 
work under Windows?

Sounds like your driver may be returning uid and gid 0 or nothing at all?

How does the driver filesystem appear on Windows?
What does icacls show for the file and directory permissions?

Can you or how are you mounting the driver filesystem on Cygwin?

Have you read the Cygwin background:

	https://cygwin.com/cygwin-ug-net/ntsec.html

Please attach as text the output from running cygcheck -hrsv on your test system 
as requested in the Cygwin ML sig!

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019