File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,22 @@ check_container_engine() {
56
56
fi
57
57
58
58
touch permission_check
59
- local inner_uid=" $( $1 run -v " $( pwd) :/test$CONTAINER_MOUNT_OPTS " \
59
+
60
+ # Capture both stdout and stderr
61
+ local output=" $( $1 run -v " $( pwd) :/test$CONTAINER_MOUNT_OPTS " \
60
62
--rm $2 \
61
63
stat --format " %u" /test/permission_check 2>&1 ) "
62
64
rm permission_check
63
65
66
+ # Filter output to get inner_uid or "Permission denied"
67
+ local inner_uid=$( echo " $output " | grep -E ' ^[0-9]+$|Permission denied' )
68
+
69
+ # Check if inner_uid is not captured or empty
70
+ if [ -z " $inner_uid " ]; then
71
+ err " Unable to determine UID - received output: $output "
72
+ die " Please check your $1 setup."
73
+ fi
74
+
64
75
if [[ $inner_uid == * " Permission denied" * ]]; then
65
76
err " The container cannot access files. Are you using SELinux?"
66
77
die " Please read README.md and check your $1 setup works."
You can’t perform that action at this time.
0 commit comments