[netfilter-cvslog] r3378 - trunk/nfsim/tools
rusty at netfilter.org
rusty at netfilter.org
Tue Dec 14 07:53:31 CET 2004
Author: rusty at netfilter.org
Date: 2004-12-14 07:53:30 +0100 (Tue, 14 Dec 2004)
New Revision: 3378
Modified:
trunk/nfsim/tools/iptables.c
Log:
Search /usr/local/sbin before /sbin as per FHS recommendation.
Add documentation for iptables command.
Modified: trunk/nfsim/tools/iptables.c
===================================================================
--- trunk/nfsim/tools/iptables.c 2004-12-14 06:21:59 UTC (rev 3377)
+++ trunk/nfsim/tools/iptables.c 2004-12-14 06:53:30 UTC (rev 3378)
@@ -90,9 +90,34 @@
static void run_command_help(int argc, char **argv)
{
- nfsim_log(LOG_ALWAYS, "%s <arguments>\n"
- "\trun %s (on the simulated netfilter code), with the\n"
- "\tspecified arguments", argv[0]);
+#include "iptables-help:iptables"
+/*** XML Help:
+ <section id="c:iptables">
+ <title><command>iptables</command></title>
+ <para>Run the iptables command on the simulator</para>
+ <cmdsynopsis>
+ <command>iptables</command>
+ <arg choice="opt"><replaceable>options</replaceable></arg>
+ </cmdsynopsis>
+
+ <para>The external <command>iptables</command> binary will be
+ invoked, with its operations redirected to the simulator. If the
+ <varname>NFSIM_IPTABLES_PREFIX</varname> environment variable is set,
+ the command in that directory will be executed (useful for
+ testing specific variants). Otherwise, the current
+ <varname>PATH</varname> is searched, then
+ <filename>/usr/local/sbin</filename>, <filename>/sbin</filename>,
+ <filename>/usr/sbin</filename>.</para>
+
+ <para>You do not need to be root to use
+ <command>iptables</command> in this way. If the
+ <command>iptables</command> command fails, that will be reported
+ as <screen><![CDATA[iptables: command failed]]></screen>; with
+ the <arg>-e</arg> to <command>nfsim</command>,
+ <command>nfsim</command> will abort.
+ </para>
+ </section>
+*/
}
static void init(void)
@@ -100,7 +125,7 @@
char *path = getenv("PATH");
/* Some people don't have sbin etc. in their path: append. */
- path = talloc_asprintf(NULL, "%s:/sbin:/usr/sbin:/usr/local/sbin",
+ path = talloc_asprintf(NULL, "%s:/usr/local/sbin:/sbin:/usr/sbin",
getenv("PATH"));
setenv("PATH", path, 1);
talloc_free(path);
More information about the netfilter-cvslog
mailing list