From f026370bbea6770c618e1794a386dc9eb0689a3b Mon Sep 17 00:00:00 2001 From: lars Date: Mon, 3 Oct 2005 10:11:09 +0000 Subject: [PATCH] version information added to footer of web interface 'status' link fixed check_smb_idle.sh fixed (insufficient path environment by cron) --- cbox-tree.d/etc/cryptobox/cryptobox.conf | 1 + cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh | 4 ++-- cbox-tree.d/usr/lib/cryptobox/check_smb_idle.sh | 8 ++++---- cbox-tree.d/usr/share/cryptobox/templates/footer.cs | 4 +++- cbox-tree.d/usr/share/cryptobox/templates/nav.cs | 6 +++--- scripts/cbox-build.sh | 5 +++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cbox-tree.d/etc/cryptobox/cryptobox.conf b/cbox-tree.d/etc/cryptobox/cryptobox.conf index 016a127..a53681a 100644 --- a/cbox-tree.d/etc/cryptobox/cryptobox.conf +++ b/cbox-tree.d/etc/cryptobox/cryptobox.conf @@ -35,6 +35,7 @@ WIPE=/usr/bin/wipe MKFS_DATA=/sbin/mkfs.ext3 MKFS_CONFIG=/sbin/mkfs.ext2 CRYPTSETUP=/sbin/cryptsetup +IPTABLES=/sbin/iptables # firewall setings # do not use multiports (iptables) as the timeout-script depends on diff --git a/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh b/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh index c510b4e..1f87e02 100755 --- a/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh +++ b/cbox-tree.d/usr/lib/cryptobox/cbox-manage.sh @@ -358,7 +358,7 @@ case "$ACTION" in ;; network-down ) log_msg "Stopping the firewall ..." - $FIREWALL_SCRIPT stop + "$FIREWALL_SCRIPT" stop log_msg "Stopping stunnel ..." killall stunnel log_msg "Shutting the network interface down ..." @@ -474,7 +474,7 @@ case "$ACTION" in echo " get_config NAME - retrieve a configuration setting" echo " diskinfo - show the partition table of the harddisk" echo " poweroff - shutdown the cryptobox" - echo " clean - remove all partitions [only for development]" + echo " clean - remove all partitions [only for development]" echo " reboot - reboot the cryptobox" echo ;; diff --git a/cbox-tree.d/usr/lib/cryptobox/check_smb_idle.sh b/cbox-tree.d/usr/lib/cryptobox/check_smb_idle.sh index 33d95d1..83dec84 100755 --- a/cbox-tree.d/usr/lib/cryptobox/check_smb_idle.sh +++ b/cbox-tree.d/usr/lib/cryptobox/check_smb_idle.sh @@ -15,7 +15,7 @@ # iptables -A INPUT -i eth0 -p tcp --dport 139 -j ACCEPT # # called by: -# - cron (/etc/cron.d/cryptobox +# - cron (/etc/cron.d/cryptobox) # set -eu @@ -29,7 +29,7 @@ set -eu filter_ipt_rules() # get the input rules for smb datagram traffic { - iptables -L INPUT -vnx | grep -E "udp dpt:138|tcp dpt:139" + "$IPTABLES" -L INPUT -vnx | grep -E "udp dpt:138|tcp dpt:139" } @@ -41,7 +41,7 @@ function check_for_traffic() filter_ipt_rules | sed 's/ */ /g' | cut -d " " -f 3 | while read a do [ "$a" -gt 0 ] && echo "$a" done | grep -q "" && traffic_yes=1 - iptables -Z INPUT + "$IPTABLES" -Z INPUT [ "$traffic_yes" = "1" ] } @@ -56,7 +56,7 @@ MAX_IDLE_COUNTER=$("$CB_SCRIPT" get_config timeout) [ "$MAX_IDLE_COUNTER" -eq 0 ] && exit 0 # config test -[ -z "`filter_ipt_rules`" ] && echo "[`basename $0`]: Could not find a matching iptables rule!" >>"$LOG_FILE" && exit 1 +[ -z "$(filter_ipt_rules)" ] && echo "[`basename $0`]: Could not find a matching iptables rule!" >>"$LOG_FILE" && exit 1 # read current idle counter if [ -e "$IDLE_COUNTER_FILE" ] diff --git a/cbox-tree.d/usr/share/cryptobox/templates/footer.cs b/cbox-tree.d/usr/share/cryptobox/templates/footer.cs index 6a5b4de..4b36c03 100644 --- a/cbox-tree.d/usr/share/cryptobox/templates/footer.cs +++ b/cbox-tree.d/usr/share/cryptobox/templates/footer.cs @@ -5,7 +5,9 @@ diff --git a/cbox-tree.d/usr/share/cryptobox/templates/nav.cs b/cbox-tree.d/usr/share/cryptobox/templates/nav.cs index 4ce8b29..1887b1a 100644 --- a/cbox-tree.d/usr/share/cryptobox/templates/nav.cs +++ b/cbox-tree.d/usr/share/cryptobox/templates/nav.cs @@ -1,11 +1,11 @@ - + - - + + diff --git a/scripts/cbox-build.sh b/scripts/cbox-build.sh index d3c3023..af1d80d 100755 --- a/scripts/cbox-build.sh +++ b/scripts/cbox-build.sh @@ -112,8 +112,9 @@ function configure_cb() echo "Configuring the cryptobox ..." # "harden" removes /etc/issue ... if [ -e "$IMAGE_DIR/etc/issue" ] - then sed -i "s/^Version:.*/Revision: $(fetch_revision)/" "$IMAGE_DIR/etc/issue" - else echo "Version:.*/Revision: $(fetch_revision)" >"$IMAGE_DIR/etc/issue" + then sed -i "s/^Version:/Revision:/" "$IMAGE_DIR/etc/issue" + sed -i "s/^Revision:.*/Revision: $(fetch_revision)/" "$IMAGE_DIR/etc/issue" + else echo "Revision: $(fetch_revision)" >"$IMAGE_DIR/etc/issue" fi fetch_revision >"$IMAGE_DIR/etc/cryptobox/revision" chroot "$IMAGE_DIR" "$CHROOT_START" /usr/lib/cryptobox/configure-cryptobox.sh normal