]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxt_owner: add spaces to output
authorJan Engelhardt <jengelh@medozas.de>
Fri, 6 Jun 2008 12:20:05 +0000 (14:20 +0200)
committerPatrick McHardy <kaber@trash.net>
Fri, 6 Jun 2008 12:20:05 +0000 (14:20 +0200)
It could happen that --<arg><value> was printed on iptables-save with
owner rules (owner_mt_save() function) without the obligatory space
inbetween. Also transfer printing of the space character into
owner_mt_print_item().

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
extensions/libxt_owner.c

index 55666e9128c9656e5ca47cb1da9bbe0fe1354246..7c66663351446e47da7be865df51168d4b28a24a 100644 (file)
@@ -419,7 +419,7 @@ owner_mt_print_item(const struct xt_owner_match_info *info, const char *label,
                return;
        if (info->invert & flag)
                printf("! ");
-       printf(label);
+       printf("%s ", label);
 
        switch (info->match & flag) {
        case XT_OWNER_UID:
@@ -462,12 +462,12 @@ owner_mt_print_v0(const void *ip, const struct xt_entry_match *match,
 {
        const struct ipt_owner_info *info = (void *)match->data;
 
-       owner_mt_print_item_v0(info, "owner UID match ", IPT_OWNER_UID, numeric);
-       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);
+       owner_mt_print_item_v0(info, "owner UID match", IPT_OWNER_UID, numeric);
+       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);
+       owner_mt_print_item_v0(info, "owner CMD match", IPT_OWNER_COMM, numeric);
 #endif
 }
 
@@ -477,10 +477,10 @@ owner_mt6_print_v0(const void *ip, const struct xt_entry_match *match,
 {
        const struct ip6t_owner_info *info = (void *)match->data;
 
-       owner_mt6_print_item_v0(info, "owner UID match ", IPT_OWNER_UID, numeric);
-       owner_mt6_print_item_v0(info, "owner GID match ", IPT_OWNER_GID, numeric);
-       owner_mt6_print_item_v0(info, "owner PID match ", IPT_OWNER_PID, numeric);
-       owner_mt6_print_item_v0(info, "owner SID match ", IPT_OWNER_SID, numeric);
+       owner_mt6_print_item_v0(info, "owner UID match", IPT_OWNER_UID, numeric);
+       owner_mt6_print_item_v0(info, "owner GID match", IPT_OWNER_GID, numeric);
+       owner_mt6_print_item_v0(info, "owner PID match", IPT_OWNER_PID, numeric);
+       owner_mt6_print_item_v0(info, "owner SID match", IPT_OWNER_SID, numeric);
 }
 
 static void owner_mt_print(const void *ip, const struct xt_entry_match *match,
@@ -488,9 +488,9 @@ static void owner_mt_print(const void *ip, const struct xt_entry_match *match,
 {
        const struct xt_owner_match_info *info = (void *)match->data;
 
-       owner_mt_print_item(info, "owner socket exists ", XT_OWNER_SOCKET, numeric);
-       owner_mt_print_item(info, "owner UID match ",     XT_OWNER_UID,    numeric);
-       owner_mt_print_item(info, "owner GID match ",     XT_OWNER_GID,    numeric);
+       owner_mt_print_item(info, "owner socket exists", XT_OWNER_SOCKET, numeric);
+       owner_mt_print_item(info, "owner UID match",     XT_OWNER_UID,    numeric);
+       owner_mt_print_item(info, "owner GID match",     XT_OWNER_GID,    numeric);
 }
 
 static void
@@ -498,12 +498,12 @@ owner_mt_save_v0(const void *ip, const struct xt_entry_match *match)
 {
        const struct ipt_owner_info *info = (void *)match->data;
 
-       owner_mt_print_item_v0(info, "--uid-owner ", IPT_OWNER_UID, true);
-       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);
+       owner_mt_print_item_v0(info, "--uid-owner", IPT_OWNER_UID, true);
+       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);
+       owner_mt_print_item_v0(info, "--cmd-owner", IPT_OWNER_COMM, true);
 #endif
 }
 
@@ -512,17 +512,17 @@ owner_mt6_save_v0(const void *ip, const struct xt_entry_match *match)
 {
        const struct ip6t_owner_info *info = (void *)match->data;
 
-       owner_mt6_print_item_v0(info, "--uid-owner ", IPT_OWNER_UID, true);
-       owner_mt6_print_item_v0(info, "--gid-owner ", IPT_OWNER_GID, true);
-       owner_mt6_print_item_v0(info, "--pid-owner ", IPT_OWNER_PID, true);
-       owner_mt6_print_item_v0(info, "--sid-owner ", IPT_OWNER_SID, true);
+       owner_mt6_print_item_v0(info, "--uid-owner", IPT_OWNER_UID, true);
+       owner_mt6_print_item_v0(info, "--gid-owner", IPT_OWNER_GID, true);
+       owner_mt6_print_item_v0(info, "--pid-owner", IPT_OWNER_PID, true);
+       owner_mt6_print_item_v0(info, "--sid-owner", IPT_OWNER_SID, true);
 }
 
 static void owner_mt_save(const void *ip, const struct xt_entry_match *match)
 {
        const struct xt_owner_match_info *info = (void *)match->data;
 
-       owner_mt_print_item(info, "--socket-exists ", XT_OWNER_SOCKET, false);
+       owner_mt_print_item(info, "--socket-exists",  XT_OWNER_SOCKET, false);
        owner_mt_print_item(info, "--uid-owner",      XT_OWNER_UID,    false);
        owner_mt_print_item(info, "--gid-owner",      XT_OWNER_GID,    false);
 }