]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix setting lib_dir in ip*tables-{save,restore}
authorMartin Josefsson <gandalf@wlug.westbo.se>
Mon, 27 Dec 2004 19:49:28 +0000 (19:49 +0000)
committerMartin Josefsson <gandalf@wlug.westbo.se>
Mon, 27 Dec 2004 19:49:28 +0000 (19:49 +0000)
include/ip6tables.h
include/iptables.h
include/iptables_common.h
ip6tables-restore.c
ip6tables-save.c
ip6tables-standalone.c
ip6tables.c
iptables-restore.c
iptables-save.c
iptables-standalone.c
iptables.c

index 8360617c34405a92f304949d54d7f501de0fed94..d4dadd881f85452093351eb6969c6545f3bf25e9 100644 (file)
@@ -4,6 +4,10 @@
 #include "iptables_common.h"
 #include "libiptc/libip6tc.h"
 
+#ifndef IP6T_LIB_DIR
+#define IP6T_LIB_DIR "/usr/local/lib/iptables"
+#endif
+
 struct ip6tables_rule_match
 {
        struct ip6tables_rule_match *next;
index 5aca69a6a0a9ba31874fb8c0681e20e04b403ef4..6d997f7ce4a59dda3aa7d058745d642a84df610b 100644 (file)
@@ -4,6 +4,10 @@
 #include "iptables_common.h"
 #include "libiptc/libiptc.h"
 
+#ifndef IPT_LIB_DIR
+#define IPT_LIB_DIR "/usr/local/lib/iptables"
+#endif
+
 #ifndef IPPROTO_SCTP
 #define IPPROTO_SCTP 132
 #endif
index ca65594ee1dce446d32205fdd9c10d955975c51e..db5e93f630c70a0d4209b2a80d8e7f389c049a6c 100644 (file)
@@ -26,6 +26,7 @@ extern int iptables_insmod(const char *modname, const char *modprobe);
 void exit_error(enum exittype, char *, ...)__attribute__((noreturn,
                                                          format(printf,2,3)));
 extern const char *program_name, *program_version;
+extern char *lib_dir;
 
 #ifdef NO_SHARED_LIBS
 # ifdef _INIT
index 76dddcba69b162b6718063fca0de97740817268c..6909c8d7abd43a472563f7094ab929a28fcb9260 100644 (file)
@@ -7,7 +7,7 @@
  *     Rusty Russell <rusty@linuxcare.com.au>
  * This code is distributed under the terms of GNU GPL v2
  *
- * $Id: ip6tables-restore.c,v 1.22 2004/05/26 16:04:48 gandalf Exp $
+ * $Id$
  */
 
 #include <getopt.h>
@@ -116,6 +116,10 @@ int main(int argc, char *argv[])
        program_version = IPTABLES_VERSION;
        line = 0;
 
+       lib_dir = getenv("IP6TABLES_LIB_DIR");
+       if (!lib_dir)
+               lib_dir = IP6T_LIB_DIR;
+
 #ifdef NO_SHARED_LIBS
        init_extensions();
 #endif
index 9deed33c8fa87ce8692227400683643b6b65ba2b..37b1f197ef9ac89698482d14bafc70e2d48d98e2 100644 (file)
@@ -322,6 +322,10 @@ int main(int argc, char *argv[])
        program_name = "ip6tables-save";
        program_version = IPTABLES_VERSION;
 
+       lib_dir = getenv("IP6TABLES_LIB_DIR");
+       if (!lib_dir)
+               lib_dir = IP6T_LIB_DIR;
+
 #ifdef NO_SHARED_LIBS
        init_extensions();
 #endif
index 7391ccfb1952e2ad1100a2b589e6388c1e3c8ae2..36dde33141ef136010816979811e386ca9435e3c 100644 (file)
@@ -46,6 +46,10 @@ main(int argc, char *argv[])
        program_name = "ip6tables";
        program_version = IPTABLES_VERSION;
 
+       lib_dir = getenv("IP6TABLES_LIB_DIR");
+       if (!lib_dir)
+               lib_dir = IP6T_LIB_DIR;
+
 #ifdef NO_SHARED_LIBS
        init_extensions();
 #endif
index aac953167cba17f4c0a3f02fd3ce1d38086d1eaa..aa1e148bdc2a050c545ceea3ed04e18c94229478 100644 (file)
 #define FALSE 0
 #endif
 
-#ifndef IP6T_LIB_DIR
-#define IP6T_LIB_DIR "/usr/local/lib/iptables"
-#endif
-
 #ifndef PROC_SYS_MODPROBE
 #define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
 #endif
@@ -195,8 +191,7 @@ static int inverse_for_options[NUMBER_OF_OPT] =
 
 const char *program_version;
 const char *program_name;
-
-static char *lib_dir;
+char *lib_dir;
 
 /* Keeping track of external matches and targets: linked lists.  */
 struct ip6tables_match *ip6tables_matches = NULL;
@@ -1718,10 +1713,6 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle)
 
        memset(&fw, 0, sizeof(fw));
 
-       lib_dir = getenv("IP6TABLES_LIB_DIR");
-       if (!lib_dir)
-               lib_dir = IP6T_LIB_DIR;
-
        /* re-set optind to 0 in case do_command gets called
         * a second time */
        optind = 0;
index 284f25c65fb06ecc0ba8b7fdefcf447aecbd1103..42aa2a27b5f1c0fec6ad635a88b261693389b98c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * This code is distributed under the terms of GNU GPL v2
  *
- * $Id: iptables-restore.c,v 1.35 2004/06/25 11:18:57 kadlec Exp $
+ * $Id$
  */
 
 #include <getopt.h>
@@ -119,6 +119,10 @@ main(int argc, char *argv[])
        program_version = IPTABLES_VERSION;
        line = 0;
 
+       lib_dir = getenv("IPTABLES_LIB_DIR");
+       if (!lib_dir)
+               lib_dir = IPT_LIB_DIR;
+
 #ifdef NO_SHARED_LIBS
        init_extensions();
 #endif
index d825130e04e361c190617de95029044f627c6502..6c7267e20ce0d5b7948302da65d7bc715ef6c2eb 100644 (file)
@@ -335,6 +335,10 @@ main(int argc, char *argv[])
        program_name = "iptables-save";
        program_version = IPTABLES_VERSION;
 
+       lib_dir = getenv("IPTABLES_LIB_DIR");
+       if (!lib_dir)
+               lib_dir = IPT_LIB_DIR;
+
 #ifdef NO_SHARED_LIBS
        init_extensions();
 #endif
index 244db5fe9d6f4bcb54094b80e6af89a7d30aa141..257b677743110e2a8767e2564889b92d0a04764e 100644 (file)
@@ -52,6 +52,10 @@ main(int argc, char *argv[])
        program_name = "iptables";
        program_version = IPTABLES_VERSION;
 
+       lib_dir = getenv("IPTABLES_LIB_DIR");
+       if (!lib_dir)
+               lib_dir = IPT_LIB_DIR;
+
 #ifdef NO_SHARED_LIBS
        init_extensions();
 #endif
index 7c003ad19bbab424682cde2c6776737c1aca2fe9..ca0a66faddcfdb89badfb393c1e8e7f2bc07c875 100644 (file)
 #define FALSE 0
 #endif
 
-#ifndef IPT_LIB_DIR
-#define IPT_LIB_DIR "/usr/local/lib/iptables"
-#endif
-
 #ifndef PROC_SYS_MODPROBE
 #define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
 #endif
@@ -195,6 +191,7 @@ static int inverse_for_options[NUMBER_OF_OPT] =
 
 const char *program_version;
 const char *program_name;
+char *lib_dir;
 
 /* Keeping track of external matches and targets: linked lists.  */
 struct iptables_match *iptables_matches = NULL;
@@ -210,8 +207,6 @@ struct pprot {
        u_int8_t num;
 };
 
-static char *lib_dir;
-
 /* Primitive headers... */
 /* defined in netinet/in.h */
 #if 0
@@ -1715,10 +1710,6 @@ int do_command(int argc, char *argv[], char **table, iptc_handle_t *handle)
 
        memset(&fw, 0, sizeof(fw));
 
-       lib_dir = getenv("IPTABLES_LIB_DIR");
-       if (!lib_dir)
-               lib_dir = IPT_LIB_DIR;
-
        /* re-set optind to 0 in case do_command gets called
         * a second time */
        optind = 0;