]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxt_owner: remove ifdef IPT_COMM_OWNER
authorJan Engelhardt <jengelh@medozas.de>
Fri, 6 May 2011 19:58:38 +0000 (21:58 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 8 May 2011 13:12:59 +0000 (15:12 +0200)
Ever since we keep a copy of the header files anyway, IPT_COMM_OWNER
is always available.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
extensions/libxt_owner.c

index 5cc7b7a68faa4915094f6d98e791fcd49b79b968..f930cf454a6f09b833b6b0afa829cede61d64478 100644 (file)
@@ -65,7 +65,6 @@ enum {
 
 static void owner_mt_help_v0(void)
 {
-#ifdef IPT_OWNER_COMM
        printf(
 "owner match options:\n"
 "[!] --uid-owner userid       Match local UID\n"
@@ -74,15 +73,6 @@ static void owner_mt_help_v0(void)
 "[!] --sid-owner sessionid    Match local SID\n"
 "[!] --cmd-owner name         Match local command name\n"
 "NOTE: PID, SID and command matching are broken on SMP\n");
-#else
-       printf(
-"owner match options:\n"
-"[!] --uid-owner userid       Match local UID\n"
-"[!] --gid-owner groupid      Match local GID\n"
-"[!] --pid-owner processid    Match local PID\n"
-"[!] --sid-owner sessionid    Match local SID\n"
-"NOTE: PID and SID matching are broken on SMP\n");
-#endif /* IPT_OWNER_COMM */
 }
 
 static void owner_mt6_help_v0(void)
@@ -110,9 +100,7 @@ static const struct option owner_mt_opts_v0[] = {
        {.name = "gid-owner", .has_arg = true, .val = 'g'},
        {.name = "pid-owner", .has_arg = true, .val = 'p'},
        {.name = "sid-owner", .has_arg = true, .val = 's'},
-#ifdef IPT_OWNER_COMM
        {.name = "cmd-owner", .has_arg = true, .val = 'c'},
-#endif
        XT_GETOPT_TABLEEND,
 };
 
@@ -189,7 +177,6 @@ owner_mt_parse_v0(int c, char **argv, int invert, unsigned int *flags,
                *flags      |= FLAG_SID_OWNER;
                return true;
 
-#ifdef IPT_OWNER_COMM
        case 'c':
                xtables_param_act(XTF_ONLY_ONCE, "owner", "--cmd-owner", *flags & FLAG_COMM);
                if (strlen(optarg) > sizeof(info->comm))
@@ -205,7 +192,6 @@ owner_mt_parse_v0(int c, char **argv, int invert, unsigned int *flags,
                info->match |= IPT_OWNER_COMM;
                *flags      |= FLAG_COMM;
                return true;
-#endif
        }
        return false;
 }
@@ -394,11 +380,9 @@ owner_mt_print_item_v0(const struct ipt_owner_info *info, const char *label,
                printf(" %u", (unsigned int)info->sid);
                break;
 
-#ifdef IPT_OWNER_COMM
        case IPT_OWNER_COMM:
                printf(" %.*s", (int)sizeof(info->comm), info->comm);
                break;
-#endif
        }
 }
 
@@ -502,9 +486,7 @@ owner_mt_print_v0(const void *ip, const struct xt_entry_match *match,
        owner_mt_print_item_v0(info, "owner GID match", IPT_OWNER_GID, numeric);
        owner_mt_print_item_v0(info, "owner PID match", IPT_OWNER_PID, numeric);
        owner_mt_print_item_v0(info, "owner SID match", IPT_OWNER_SID, numeric);
-#ifdef IPT_OWNER_COMM
        owner_mt_print_item_v0(info, "owner CMD match", IPT_OWNER_COMM, numeric);
-#endif
 }
 
 static void
@@ -538,9 +520,7 @@ owner_mt_save_v0(const void *ip, const struct xt_entry_match *match)
        owner_mt_print_item_v0(info, "--gid-owner", IPT_OWNER_GID, true);
        owner_mt_print_item_v0(info, "--pid-owner", IPT_OWNER_PID, true);
        owner_mt_print_item_v0(info, "--sid-owner", IPT_OWNER_SID, true);
-#ifdef IPT_OWNER_COMM
        owner_mt_print_item_v0(info, "--cmd-owner", IPT_OWNER_COMM, true);
-#endif
 }
 
 static void