Export the 'short_source' function & don't keep PS4 in sudo
Export the 'short_source' function so that it will be present in the environment for child shell scripts. Do this because we are passing PS4 to the child shell scripts and it is using 'short_source' Don't do an 'env_keep' in the sudoers file for PS4, since it is difficult to also pass along the 'short_source' function. Change-Id: I9781010d6eb336d02939c7fd47f18bedeae5ccc6 Closes-Bug: #1563443
This commit is contained in:
parent
8d27280f3e
commit
daa7a41e21
@ -41,6 +41,9 @@ function short_source {
|
|||||||
file=${file#$RC_DIR/}
|
file=${file#$RC_DIR/}
|
||||||
printf "%-40s " "$file:${called[1]}:${called[0]}"
|
printf "%-40s " "$file:${called[1]}:${called[0]}"
|
||||||
}
|
}
|
||||||
|
# PS4 is exported to child shells and uses the 'short_source' function, so
|
||||||
|
# export it so child shells have access to the 'short_source' function also.
|
||||||
|
export -f short_source
|
||||||
|
|
||||||
|
|
||||||
# Retrieve an image from a URL and upload into Glance.
|
# Retrieve an image from a URL and upload into Glance.
|
||||||
|
1
stack.sh
1
stack.sh
@ -240,7 +240,6 @@ echo "$STACK_USER ALL=(root) NOPASSWD:ALL" >$TEMPFILE
|
|||||||
# see them by forcing ``PATH``
|
# see them by forcing ``PATH``
|
||||||
echo "Defaults:$STACK_USER secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin" >> $TEMPFILE
|
echo "Defaults:$STACK_USER secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin" >> $TEMPFILE
|
||||||
echo "Defaults:$STACK_USER !requiretty" >> $TEMPFILE
|
echo "Defaults:$STACK_USER !requiretty" >> $TEMPFILE
|
||||||
echo "Defaults env_keep += PS4" >> $TEMPFILE
|
|
||||||
chmod 0440 $TEMPFILE
|
chmod 0440 $TEMPFILE
|
||||||
sudo chown root:root $TEMPFILE
|
sudo chown root:root $TEMPFILE
|
||||||
sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh
|
sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh
|
||||||
|
@ -22,6 +22,9 @@ function short_source {
|
|||||||
file=${file#$RC_DIR/}
|
file=${file#$RC_DIR/}
|
||||||
printf "%-40s " "$file:${called[1]}:${called[0]}"
|
printf "%-40s " "$file:${called[1]}:${called[0]}"
|
||||||
}
|
}
|
||||||
|
# PS4 is exported to child shells and uses the 'short_source' function, so
|
||||||
|
# export it so child shells have access to the 'short_source' function also.
|
||||||
|
export -f short_source
|
||||||
|
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user