diff --git a/data/containers/patches.yaml b/data/containers/patches.yaml index 1a08e246ea3b..d9948032e59c 100644 --- a/data/containers/patches.yaml +++ b/data/containers/patches.yaml @@ -161,6 +161,7 @@ podman: # https://github.com/containers/podman/pull/27230 is needed for 130-kill # https://github.com/containers/podman/pull/27233 is needed for 130-kill # https://github.com/containers/podman/pull/27463 - test/system: Update test to handle new error message from runc 1.3.3 + # https://github.com/containers/podman/pull/27813 - test: Fix --hostuser octal UID test flakiness opensuse-Tumbleweed: GITHUB_PATCHES: - 26017 @@ -170,6 +171,7 @@ podman: - 27230 - 27233 - 27463 + - 27813 sle-16.0: GITHUB_PATCHES: - 25858 diff --git a/data/containers/patches/podman/27813.patch b/data/containers/patches/podman/27813.patch new file mode 100644 index 000000000000..ecbdd2741c51 --- /dev/null +++ b/data/containers/patches/podman/27813.patch @@ -0,0 +1,44 @@ +From 0ed32ebd10bf571f556a952666ceb9a4f4de286a Mon Sep 17 00:00:00 2001 +From: Ricardo Branco +Date: Sat, 20 Dec 2025 23:20:08 +0100 +Subject: [PATCH] test: Fix --hostuser octal UID test flakiness + +The test for issue #19800 depended on finding a system user with an +octal UID. This approach was fragile because system users found on the +host may have a different UID in the testing image. + +Use the rootless user ID instead which is likely to be octal anyway as +new user IDs start with 1000. + +Signed-off-by: Ricardo Branco +--- + test/system/030-run.bats | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/test/system/030-run.bats b/test/system/030-run.bats +index 82d8eaa3f84..c94b8ab2597 100644 +--- a/test/system/030-run.bats ++++ b/test/system/030-run.bats +@@ -939,17 +939,15 @@ EOF + run_podman 1 run --rm $IMAGE grep $user /etc/passwd + run_podman run --hostuser=$user --rm $IMAGE grep $user /etc/passwd + +- # find a user with a uid > 100 that is a valid octal + # Issue #19800 +- octal_user=$(awk -F\: '$1!="nobody" && $3>100 && $3~/^[0-7]+$/ {print $1 " " $3; exit}' /etc/passwd) +- # test only if a valid user was found +- if test -n "$octal_user"; then +- read octal_username octal_userid <<< $octal_user +- run_podman run --user=$octal_username --hostuser=$octal_username --rm $IMAGE id -u ++ # test uid if octal ++ octal_userid=$(id -u) ++ if [[ $octal_userid =~ ^[0-7]+$ ]]; then ++ run_podman run --user=$user --hostuser=$user --rm $IMAGE id -u + is "$output" "$octal_userid" + fi + +- user=$(id -u) ++ user=$octal_userid + + userspec=$(id -un):$(id -g) + run_podman run --hostuser=$user --user $userspec --rm $IMAGE sh -c 'echo $(id -un):$(id -g)'