Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
Issue 605: sosetup: replace tmp with mktemp
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed Jul 8, 2015
1 parent 2ce727e commit 6c21013
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/sosetup
Original file line number Diff line number Diff line change
Expand Up @@ -1684,16 +1684,16 @@ function SERVER_QUEUE() {
#########################################
if [ "$SERVERNAME" != "localhost" ]; then
# Copy the script over
scp -i "$KEY" $SOSETUPSCP $SSH_USERNAME@$SERVERNAME:/tmp/sosetupscp >> $LOG 2>&1
scp -i "$KEY" $SOSETUPSCP $SSH_USERNAME@$SERVERNAME:$SOSETUPSCP >> $LOG 2>&1
# Run the script on the master server using sudo
if [ "$OUTPUT" = "gui" ]; then
xfce4-terminal -x ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME sudo /bin/bash /tmp/sosetupscp
xfce4-terminal -x ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME sudo /bin/bash $SOSETUPSCP
else
ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME sudo /bin/bash /tmp/sosetupscp >> $LOG 2>&1
ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME sudo /bin/bash $SOSETUPSCP >> $LOG 2>&1
fi
# Cleanup
rm -f $SOSETUPSCP
ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME rm -f /tmp/sosetupscp >> $LOG 2>&1
ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME rm -f $SOSETUPSCP >> $LOG 2>&1
fi

if [ $SERVER -ne 1 ] && [ "$ELSA" = "YES" ]; then
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
securityonion-setup (20120912-0ubuntu0securityonion153) precise; urgency=low

* Issue 605: sosetup: replace tmp with mktemp

-- Doug Burks <[email protected]> Wed, 08 Jul 2015 16:38:16 -0400

securityonion-setup (20120912-0ubuntu0securityonion152) precise; urgency=low

* replace /tmp/securityonion.conf with $SECURITYONION_CONF_MASTER using mktemp
Expand Down
48 changes: 48 additions & 0 deletions debian/patches/Issue-605:-sosetup:-replace-tmp-with-mktemp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
securityonion-setup (20120912-0ubuntu0securityonion153) precise; urgency=low
.
* Issue 605: sosetup: replace tmp with mktemp
Author: Doug Burks <[email protected]>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- securityonion-setup-20120912.orig/bin/sosetup
+++ securityonion-setup-20120912/bin/sosetup
@@ -1684,16 +1684,16 @@ function SERVER_QUEUE() {
#########################################
if [ "$SERVERNAME" != "localhost" ]; then
# Copy the script over
- scp -i "$KEY" $SOSETUPSCP $SSH_USERNAME@$SERVERNAME:/tmp/sosetupscp >> $LOG 2>&1
+ scp -i "$KEY" $SOSETUPSCP $SSH_USERNAME@$SERVERNAME:$SOSETUPSCP >> $LOG 2>&1
# Run the script on the master server using sudo
if [ "$OUTPUT" = "gui" ]; then
- xfce4-terminal -x ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME sudo /bin/bash /tmp/sosetupscp
+ xfce4-terminal -x ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME sudo /bin/bash $SOSETUPSCP
else
- ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME sudo /bin/bash /tmp/sosetupscp >> $LOG 2>&1
+ ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME sudo /bin/bash $SOSETUPSCP >> $LOG 2>&1
fi
# Cleanup
rm -f $SOSETUPSCP
- ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME rm -f /tmp/sosetupscp >> $LOG 2>&1
+ ssh -i "$KEY" -t $SSH_USERNAME@$SERVERNAME rm -f $SOSETUPSCP >> $LOG 2>&1
fi

if [ $SERVER -ne 1 ] && [ "$ELSA" = "YES" ]; then
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,4 @@ redirect-apache-output-to-log-file
Issue-596:-sosetup:-sensor-should-stopdisable-Apache-and-Snorby-worker
pkill-autossh-before-using-mysql-and-also-replace-sosetupscp-with-mktemp
replace-tmpsecurityonion.conf-with-$SECURITYONION_CONF_MASTER-using-mktemp
Issue-605:-sosetup:-replace-tmp-with-mktemp

0 comments on commit 6c21013

Please sign in to comment.