From 0a6ec9615b5979aebcdbd8a0548a3b5691496896 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 12 Feb 2014 15:00:04 -0700 Subject: [PATCH] Fix indentation of Defaults entries. The initial indent should be outside the loop iterating over the entries. --- plugins/sudoers/visudo_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sudoers/visudo_json.c b/plugins/sudoers/visudo_json.c index 2cf9c5556..0598b31f5 100644 --- a/plugins/sudoers/visudo_json.c +++ b/plugins/sudoers/visudo_json.c @@ -603,6 +603,7 @@ print_defaults_json(FILE *fp, int indent, bool need_comma) debug_return_bool(need_comma); fprintf(fp, "%s\n%*s\"Defaults\": [\n", need_comma ? "," : "", indent, ""); + indent += 4; TAILQ_FOREACH_SAFE(def, &defaults, entries, next) { type = get_defaults_type(def); @@ -613,7 +614,6 @@ print_defaults_json(FILE *fp, int indent, bool need_comma) } /* Found it, print object container and binding (if any). */ - indent += 4; fprintf(fp, "%*s{\n", indent, ""); indent += 4; print_binding_json(fp, def->binding, def->type, indent);