Skip to content

Commit

Permalink
Problem: Pulp containers do not allow commands like "/bin/bash"
Browse files Browse the repository at this point in the history
to be run, only "bash"

Solution: Only apply the /bin/ logic for the 4 pulp-* commands.

fixes: #6420
Pulp containers do not allow commands like "/bin/bash" to be run, only "bash"
https://pulp.plan.io/issues/6420
  • Loading branch information
mikedep333 committed Mar 31, 2020
1 parent 4873b16 commit 10804a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES/6420.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed pulp containers not allowing commands to be run via absolute path.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
# Prevent pip-installed /usr/local/bin/pulp-content from getting run instead of
# our /usr/bin/pulp script.
#
# We still want conatiner users to call command names, not paths, so we can
# change our scripts' locations in the future, and call special logic in this
# script based solely on the command name.
exec "/usr/bin/$@"
# We still want conatiner users to call pulp-* command names, not paths, so we
# can change our scripts' locations in the future, and call special logic in this
# script based solely on theo command name.

if [[ "$@" = "pulp-content" || "$@" = "pulp-api" || "$@" = "pulp-worker" || "$@" = "pulp-resource-manager" ]]; then
exec "/usr/bin/$@"
else
exec "$@"
fi

0 comments on commit 10804a7

Please sign in to comment.