summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Jallot <ejallot@gmail.com>2019-08-20 17:50:05 +0200
committerFlorian Westphal <fw@strlen.de>2019-08-20 18:03:07 +0200
commit03478af1bea03eafd43df94334cb001ed26145a3 (patch)
treeb8d29d5106fb1c62524ebca4209b758dfd88c103
parentd42e9a1b9abc3b8a3cefce03baa0b12be1ba8b6e (diff)
src: secmark: fix brace indentation and missing quotes in selctx output
Before patch: # nft list secmarks | tee rules.nft table inet t { secmark s { system_u:object_r:ssh_server_packet_t:s0 } } # nft flush ruleset # nft -f rules.nft rules.nft:3:11-11: Error: syntax error, unexpected colon system_u:object_r:ssh_server_packet_t:s0 Colon is not allowed in strings and breaks nft -f. So move to quoted string in selctx output. After patch: # nft list secmarks | tee rules.nft table inet t { secmark s { "system_u:object_r:ssh_server_packet_t:s0" } } # nft flush ruleset # nft -f rules.nft Fixes: 3bc84e5c ("src: add support for setting secmark") Signed-off-by: Eric Jallot <ejallot@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--src/rule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rule.c b/src/rule.c
index 5655e8c0..19125131 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1820,7 +1820,7 @@ static void obj_print_data(const struct obj *obj,
if (nft_output_handle(octx))
nft_print(octx, " # handle %" PRIu64, obj->handle.handle.id);
nft_print(octx, "%s%s%s", opts->nl, opts->tab, opts->tab);
- nft_print(octx, "%s", obj->secmark.ctx);
+ nft_print(octx, "\"%s\"%s", obj->secmark.ctx, opts->nl);
break;
case NFT_OBJECT_CT_HELPER:
nft_print(octx, " %s {", obj->handle.obj.name);