Skip to contentSkip to conversation

Use numeric user and group IDs in getfacl

PATCH In review Luis Henriques 3 participants 5 messages May 17, 2019 – May 18, 2019

lore
Share & tools
lore
#0 lore raw

cover Use numeric user and group IDs in getfacl

Hi,

I just saw generic/319 test failing in a system where /etc/group didn't had the 0 group ID defined. I guess that's not a common setup, but the test can easily fixed by having getfacl returning the numeric IDs instead.

Running 'git grep' showed that overlay/023 seems have a similar issue and, although I didn't tested it, I'm sending the fix for that test as well.

Luis Henriques (2):
generic/319: use number user and group IDs in getfacl overlay/023: use number user and group IDs in getfacl

 tests/generic/319     | 4 ++--
 tests/generic/319.out | 8 ++++----
 tests/overlay/023     | 2 +-
 tests/overlay/023.out | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)
#1 lore raw

PATCH 1/2 generic/319: use numeric user and group IDs in getfacl

This prevents test failures if cases where, e.g., /etc/group doesn't include the 'root' group ID.

---
 tests/generic/319     | 4 ++--
 tests/generic/319.out | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
tests/generic/319 +2 -2
index 02973d90cbe2..504cf627537b 100755
@@ -44,10 +44,10 @@ _scratch_mount
 
 mkdir $SCRATCH_MNT/testdir
 setfacl -d --set u::rwx,g::rwx,o::- $SCRATCH_MNT/testdir
-getfacl --absolute-names $SCRATCH_MNT/testdir | _filter_scratch
+getfacl -n --absolute-names $SCRATCH_MNT/testdir | _filter_scratch
 
 mkdir $SCRATCH_MNT/testdir/testsubdir
-getfacl --absolute-names $SCRATCH_MNT/testdir/testsubdir | _filter_scratch
+getfacl -n --absolute-names $SCRATCH_MNT/testdir/testsubdir | _filter_scratch
 
 # success, all done
 status=0
tests/generic/319.out +4 -4
index b090bfaf6a04..bf6b4bc80462 100644
@@ -1,7 +1,7 @@
 QA output created by 319
 # file: SCRATCH_MNT/testdir
-# owner: root
-# group: root
+# owner: 0
+# group: 0
 user::rwx
 group::r-x
 other::r-x
@@ -10,8 +10,8 @@ default:group::rwx
 default:other::---
 
 # file: SCRATCH_MNT/testdir/testsubdir
-# owner: root
-# group: root
+# owner: 0
+# group: 0
 user::rwx
 group::rwx
 other::---
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] generic/319: use numeric user and group IDs in getfacl

Quoted 6 lines · Luis Henriques

This prevents test failures if cases where, e.g., /etc/group doesn't include the 'root' group ID.

Looks good, thanks.

Quoted 47 lines
---
 tests/generic/319     | 4 ++--
 tests/generic/319.out | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
tests/generic/319 +2 -2
index 02973d90cbe2..504cf627537b 100755
@@ -44,10 +44,10 @@ _scratch_mount
 
 mkdir $SCRATCH_MNT/testdir
 setfacl -d --set u::rwx,g::rwx,o::- $SCRATCH_MNT/testdir
-getfacl --absolute-names $SCRATCH_MNT/testdir | _filter_scratch
+getfacl -n --absolute-names $SCRATCH_MNT/testdir | _filter_scratch
 
 mkdir $SCRATCH_MNT/testdir/testsubdir
-getfacl --absolute-names $SCRATCH_MNT/testdir/testsubdir | _filter_scratch
+getfacl -n --absolute-names $SCRATCH_MNT/testdir/testsubdir | _filter_scratch
 
 # success, all done
 status=0
tests/generic/319.out +4 -4
index b090bfaf6a04..bf6b4bc80462 100644
@@ -1,7 +1,7 @@
 QA output created by 319
 # file: SCRATCH_MNT/testdir
-# owner: root
-# group: root
+# owner: 0
+# group: 0
 user::rwx
 group::r-x
 other::r-x
@@ -10,8 +10,8 @@ default:group::rwx
 default:other::---
 
 # file: SCRATCH_MNT/testdir/testsubdir
-# owner: root
-# group: root
+# owner: 0
+# group: 0
 user::rwx
 group::rwx
 other::---
Signature · 3 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”
#3 lore raw

PATCH 2/2 overlay/023: use numeric user and group IDs in getfacl

In reply to Luis Henriques

This prevents test failures if cases where, e.g., /etc/group doesn't include the 'root' group ID.

---
 tests/overlay/023     | 2 +-
 tests/overlay/023.out | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
tests/overlay/023 +1 -1
index 7e48349d1a12..edd034c3a9e3 100755
@@ -55,7 +55,7 @@ setfacl -d -m o::rwx $wkdir
 _scratch_mount
 
 # getting acls, ACL set on workdir should be cleaned
-getfacl -p $wkdir/work 2>&1 | _filter_scratch | _filter_ovl_dirs
+getfacl -n -p $wkdir/work 2>&1 | _filter_scratch | _filter_ovl_dirs
 
 # success, all done
 status=0
tests/overlay/023.out +2 -2
index 4a243c5b44ce..911d272d2241 100644
@@ -1,7 +1,7 @@
 QA output created by 023
 # file: SCRATCH_DEV/OVL_WORK/work
-# owner: root
-# group: root
+# owner: 0
+# group: 0
 user::---
 group::---
 other::---
#4 lore raw

Re: [PATCH 2/2] overlay/023: use numeric user and group IDs in getfacl

Quoted 2 lines · Luis Henriques

This prevents test failures if cases where, e.g., /etc/group doesn't include the 'root' group ID.

Ack for this patch(I don't see that other 1/2 one). Thanks!

Xiong

Quoted 35 lines
---
 tests/overlay/023     | 2 +-
 tests/overlay/023.out | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
tests/overlay/023 +1 -1
index 7e48349d1a12..edd034c3a9e3 100755
@@ -55,7 +55,7 @@ setfacl -d -m o::rwx $wkdir
 _scratch_mount
 
 # getting acls, ACL set on workdir should be cleaned
-getfacl -p $wkdir/work 2>&1 | _filter_scratch | _filter_ovl_dirs
+getfacl -n -p $wkdir/work 2>&1 | _filter_scratch | _filter_ovl_dirs
 
 # success, all done
 status=0
tests/overlay/023.out +2 -2
index 4a243c5b44ce..911d272d2241 100644
@@ -1,7 +1,7 @@
 QA output created by 023
 # file: SCRATCH_DEV/OVL_WORK/work
-# owner: root
-# group: root
+# owner: 0
+# group: 0
 user::---
 group::---
 other::---