Correct order of sudo in apache sync logs
authorclinton_admin <clinton_admin@navajos.hcoop.net>
Thu, 20 Dec 2012 08:25:58 +0000 (03:25 -0500)
committerclinton_admin <clinton_admin@navajos.hcoop.net>
Thu, 20 Dec 2012 08:25:58 +0000 (03:25 -0500)
* Modern sudo clears the environment, so we have to run k5start within sudo not outside

apache-sync-logs

index 95b66ef..7ad7668 100755 (executable)
@@ -75,8 +75,8 @@ for A in $(find $LOCAL_LOG_DIR -mindepth 3 -maxdepth 3 -print); do
         cp -r $LOG_SRC $TMP_DEST
         chown -R $USER:nogroup $TMP_DEST
         chmod -R u=rwX,go=X $TMP_DEST
         cp -r $LOG_SRC $TMP_DEST
         chown -R $USER:nogroup $TMP_DEST
         chmod -R u=rwX,go=X $TMP_DEST
-        k5start -qtU -f $KEYTAB_DIR/$USER \
-            -- sudo -u $USER rsync -a $TMP_DEST/ $LOG_DEST/
+        sudo -u $USER k5start -qtU -f $KEYTAB_DIR/$USER \
+            -- rsync -a $TMP_DEST/ $LOG_DEST/
         rm -fr $TMP_DEST
         test "$VERBOSE" = "true" && echo "  done."
     fi
         rm -fr $TMP_DEST
         test "$VERBOSE" = "true" && echo "  done."
     fi