Corinna Vinschen wrote:
> Btw., there's still a small bug in test-file-has-acl.sh.  It tries to
> create an entry with gid 0:
> 
>   setfacl -m group:0:1 tmpfile0
> 
> But that's not possible, because there's no Windows group mapped to
> uid or gid 0, unless you create your own /etc/passwd and /etc/group
> files.
> 
> There's deliberately no default mapping from any Windows SID to user or
> group 0, i.e., root, because there's no equivalent Windows account.
> Administrator, Administrators, SYSTEM, Domain Admins, Backup Operators,
> etc, etc... there's just no direct match possible, but the uid/gid must
> map to a valid Windows SID.
> 
> What you can do is use group 1.  This group always exists, because
> it maps to the group NT AUTHORITY\DIALUP, SID S-1-5-1.

Thanks for reporting this! Fixed like you suggest:


2025-03-31  Bruno Haible  <br...@clisp.org>

        acl, file-has-acl tests: Strengthen tests on Cygwin.
        Suggested by Corinna Vinschen in
        <https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00126.html>.
        * tests/test-set-mode-acl.sh: On Cygwin, use group 1 instead of the
        non-existent group 0.
        * tests/test-copy-acl.sh: Likewise.
        * tests/test-file-has-acl.sh: Likewise.

diff --git a/tests/test-copy-acl.sh b/tests/test-copy-acl.sh
index 8efe202afb..061755f124 100755
--- a/tests/test-copy-acl.sh
+++ b/tests/test-copy-acl.sh
@@ -310,7 +310,9 @@ cd "$builddir" ||
       cygwin)
 
         # Set an ACL for a group.
-        setfacl -m group:0:1 tmpfile0
+        # Group 1 in Cygwin corresponds to the DIALUP users (cf.
+        # 
<https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids>).
+        setfacl -m group:1:1 tmpfile0
 
         func_test_copy tmpfile0 tmpfile2
 
@@ -320,7 +322,7 @@ cd "$builddir" ||
         func_test_copy tmpfile0 tmpfile4
 
         # Remove the ACL for the group.
-        setfacl -d group:0 tmpfile0
+        setfacl -d group:1 tmpfile0
 
         func_test_copy tmpfile0 tmpfile5
 
diff --git a/tests/test-file-has-acl.sh b/tests/test-file-has-acl.sh
index 1e791f3ae8..1ce388bbc0 100755
--- a/tests/test-file-has-acl.sh
+++ b/tests/test-file-has-acl.sh
@@ -255,12 +255,14 @@ cd "$builddir" ||
       cygwin)
 
         # Set an ACL for a group.
-        if setfacl -m group:0:1 tmpfile0; then
+        # Group 1 in Cygwin corresponds to the DIALUP users (cf.
+        # 
<https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids>).
+        if setfacl -m group:1:1 tmpfile0; then
 
           func_test_has_acl tmpfile0 yes
 
           # Remove the ACL for the group.
-          setfacl -d group:0 tmpfile0
+          setfacl -d group:1 tmpfile0
 
           func_test_has_acl tmpfile0 no
 
diff --git a/tests/test-set-mode-acl.sh b/tests/test-set-mode-acl.sh
index fa9771e034..18eb72acf8 100755
--- a/tests/test-set-mode-acl.sh
+++ b/tests/test-set-mode-acl.sh
@@ -183,7 +183,9 @@ cd "$builddir" ||
             setfacl -m user:$auid:1 tmpfile0
             ;;
           cygwin)
-            setfacl -m group:0:1 tmpfile0
+            # Group 1 in Cygwin corresponds to the DIALUP users (cf.
+            # 
<https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids>).
+            setfacl -m group:1:1 tmpfile0
             ;;
           hpux)
             orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`




Reply via email to