[Firehol-devs] running 'debug' as non-root user

Andrew Schulman andrex at alumni.utexas.net
Sun Jul 29 06:54:03 BST 2007


When a firehol user is developing a config file and just wants to test their config with 'firehol.sh debug', they should
be able to run firehol as a regular user, i.e. not as root.  This is good practice.

Using firehol 1.260, when I try to do this, firehol first complains that I'm not root-- noisy, but harmless.  But then
it quits because it can't save the existing firewall rules.  But since I'm running 'debug', that shouldn't matter; I'm
not going to change the firewall.

The patch below fixes this problem and allows me to run 'firehol debug' as a non-root user.

Andrew.

--- firehol.sh.orig     2007-07-29 01:03:13.000000000 -0400
+++ firehol.sh  2007-07-29 01:08:13.000000000 -0400
@@ -6573,17 +6573,20 @@
        return $err
 }

-echo -n $"FireHOL: Saving your old firewall to a temporary file:"
-fixed_iptables_save >${FIREHOL_SAVED}
-if [ $? -eq 0 ]
+if [ ${FIREHOL_DEBUG} -eq 0 ]
 then
-       success $"FireHOL: Saving your old firewall to a temporary file:"
-       echo
-else
-       test -f "${FIREHOL_SAVED}" && ${RM_CMD} -f "${FIREHOL_SAVED}"
-       failure $"FireHOL: Saving your old firewall to a temporary file:"
-       echo
-       exit 1
+       echo -n $"FireHOL: Saving your old firewall to a temporary file:"
+       fixed_iptables_save >${FIREHOL_SAVED}
+       if [ $? -eq 0 ]
+       then
+               success $"FireHOL: Saving your old firewall to a temporary file:"
+               echo
+       else
+               test -f "${FIREHOL_SAVED}" && ${RM_CMD} -f "${FIREHOL_SAVED}"
+               failure $"FireHOL: Saving your old firewall to a temporary file:"
+               echo
+               exit 1
+       fi
 fi







More information about the Firehol-devs mailing list