From 2a425ac1ad8fe67d8ea124f37cfd86af16034ef4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 6 Jun 2018 20:00:46 -0400 Subject: [PATCH] install-gosu-binary.sh: install sudo wrapper when executing the script --- common.docker | 1 - imagefiles/install-gosu-binary.sh | 12 ++++++++++++ imagefiles/sudo.sh | 5 ----- 3 files changed, 12 insertions(+), 6 deletions(-) delete mode 100755 imagefiles/sudo.sh diff --git a/common.docker b/common.docker index 47c9b64..c18c5a2 100644 --- a/common.docker +++ b/common.docker @@ -47,7 +47,6 @@ RUN \ COPY imagefiles/cmake.sh /usr/local/bin/cmake COPY imagefiles/ccmake.sh /usr/local/bin/ccmake -COPY imagefiles/sudo.sh /usr/bin/sudo RUN if [ -e /opt/python/cp35-cp35m/bin/python ]; then \ : nothing to do here since it is updated by manylinux-common/install-python-packages.sh ; \ diff --git a/imagefiles/install-gosu-binary.sh b/imagefiles/install-gosu-binary.sh index 2f43922..8c9153b 100755 --- a/imagefiles/install-gosu-binary.sh +++ b/imagefiles/install-gosu-binary.sh @@ -40,3 +40,15 @@ chmod +x /usr/local/bin/gosu # verify that the binary works gosu nobody true + + +cat << EOF >> /usr/bin/sudo +#!/bin/sh + +# Emulate the sudo command + +exec gosu root:root "\$@" + +EOF + +chmod +x /usr/bin/sudo diff --git a/imagefiles/sudo.sh b/imagefiles/sudo.sh deleted file mode 100755 index 6d86568..0000000 --- a/imagefiles/sudo.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Emulate the sudo command - -exec gosu root:root "$@"