From b0160d0fa9b20a4c1bda01dda6ffceac6beb9842 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 23 Jun 2015 12:53:51 -0400 Subject: [PATCH] Log all input/output in rootwrap calls This should make it easier to understand possible interactions between rootwrap processes calling commands that might be the cause of race bugs. Closes-Bug: 1081524 Change-Id: Ic1f1fa42e4478a9d30f0f582a68f648935d0097d --- stack.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stack.sh b/stack.sh index 0d9d836eca..5b3f2c1183 100755 --- a/stack.sh +++ b/stack.sh @@ -212,6 +212,15 @@ is_package_installed sudo || install_package sudo sudo grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers || echo "#includedir /etc/sudoers.d" | sudo tee -a /etc/sudoers +# Conditionally setup detailed logging for sudo +if [[ -n "$LOG_SUDO" ]]; then + TEMPFILE=`mktemp` + echo "Defaults log_output" > $TEMPFILE + chmod 0440 $TEMPFILE + sudo chown root:root $TEMPFILE + sudo mv $TEMPFILE /etc/sudoers.d/00_logging +fi + # Set up DevStack sudoers TEMPFILE=`mktemp` echo "$STACK_USER ALL=(root) NOPASSWD:ALL" >$TEMPFILE