Skip to content

Commit 169b7dd

Browse files
grub2: fix cpio test with large uid (sonic-net#25400)
The cpio ustar tests have a maximum UID capability of 2097151. Skip these tests if we detect the user running the tests has a larger UID. This prevents failures like: ``` cpio: ./: value uid 1220800073 out of allowed range 0..2097151 cpio: hard: value uid 1220800073 out of allowed range 0..2097151 cpio: cAsE: value uid 1220800073 out of allowed range 0..2097151 cpio: qwertzuiopasdfghjklyxcvbnm1234567890qwertzuiopasdfghjklyxcvbnm1234567890oiewqfiewioqoiqoiurqruewqoi: value uid 1220800073 out of allowed range 0..2097151 cpio: .?*\!"#%@$%&'()+ ,-.:;<=>^{_}[]`|~.: value uid 1220800073 out of allowed range 0..2097151 cpio: éàèüöäëñкирилица莭莽茝Ελληνικά😁😜😒: value uid 1220800073 out of allowed range 0..2097151 ... ``` Signed-off-by: Brad House <bhouse@nexthop.ai>
1 parent 1880d60 commit 169b7dd

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/tests/cpio_test.in b/tests/cpio_test.in
2+
index 5742cf17b..add41ef22 100644
3+
--- a/tests/cpio_test.in
4+
+++ b/tests/cpio_test.in
5+
@@ -11,6 +11,10 @@ fi
6+
"@builddir@/grub-fs-tester" cpio_odc
7+
"@builddir@/grub-fs-tester" cpio_newc
8+
"@builddir@/grub-fs-tester" cpio_crc
9+
-"@builddir@/grub-fs-tester" cpio_ustar
10+
+# If the UID of the user running tests is > 2097151 skip testing ustar as the format does
11+
+# not support large uids.
12+
+if [ `id -u` -le "2097151" ] ; then
13+
+ "@builddir@/grub-fs-tester" cpio_ustar
14+
+fi
15+
"@builddir@/grub-fs-tester" cpio_hpbin
16+
"@builddir@/grub-fs-tester" cpio_hpodc

src/grub2/patch/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# This series applies on GIT commit f954d68d5e8dc7eb0081ad7bc1ced9ff5ca687a7
22
adjust-build-rules-for-debian.patch
3+
large-uid-skip-cpio-ustar.patch

0 commit comments

Comments
 (0)