File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,22 @@ check_container_engine() {
5656 fi
5757
5858 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 " \
6062 --rm $2 \
61- stat --format " %u" /test/permission_check 2>&1 ) "
63+ stat --format " %u" /test/permission_check > /dev/null 2>&1 ) "
6264 rm permission_check
6365
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+
6475 if [[ $inner_uid == * " Permission denied" * ]]; then
6576 err " The container cannot access files. Are you using SELinux?"
6677 die " Please read README.md and check your $1 setup works."
You can’t perform that action at this time.
0 commit comments