From f2a25b776bd1e7bffadf6939ffdc76384da34848 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Wed, 13 Jun 2012 17:45:43 +0200 Subject: [PATCH] Ensure that we have access to sbin binaries through sudo We need to add the sbin paths to the secure path in sudoers for the user running the script, to make sure that running sbin binaries from sudo will work. Change-Id: I7942407df768bfa8dd035f15fa8b43ba05319779 --- stack.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stack.sh b/stack.sh index c1e06cb102..3827d77614 100755 --- a/stack.sh +++ b/stack.sh @@ -193,6 +193,9 @@ else # Set up devstack sudoers TEMPFILE=`mktemp` echo "`whoami` ALL=(root) NOPASSWD:ALL" >$TEMPFILE + # Some binaries might be under /sbin or /usr/sbin, so make sure sudo will + # see them by forcing PATH + echo "Defaults:`whoami` secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin" >> $TEMPFILE chmod 0440 $TEMPFILE sudo chown root:root $TEMPFILE sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh