summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/container-shell30
1 files changed, 27 insertions, 3 deletions
diff --git a/bin/container-shell b/bin/container-shell
index 17c0849..c27a0e3 100755
--- a/bin/container-shell
+++ b/bin/container-shell
@@ -85,10 +85,34 @@ Shell ()
then
echo "'${COMMAND}': no such ${PROGRAM} command" >&2
return
- else
- echo
- sudo ${PROGRAM} ${COMMAND} ${OPTIONS} || true
fi
+
+ if [ -n "${CONTAINER_COMMANDS_ENABLE}" ]
+ then
+ COMMAND_ALLOWED=""
+
+ for CONTAINER_COMMAND in ${CONTAINER_COMMANDS_ENABLE}
+ do
+ case "${CONTAINER_COMMAND}" in
+ ${COMMAND}|all|about|logout|exit|help)
+ COMMAND_ALLOWED="true"
+ ;;
+ esac
+ done
+
+ case "${COMMAND_ALLOWED}" in
+ true)
+ ;;
+
+ *)
+ echo "'${COMMAND}': command not allowed for current user" >&2
+ return
+ ;;
+ esac
+ fi
+
+ echo
+ sudo ${PROGRAM} ${COMMAND} ${OPTIONS} || true
}
trap 'echo' EXIT HUP INT QUIT TERM