net: fix net cache samlogon list output
authorRalph Boehme <slow@samba.org>
Tue, 4 Jul 2017 07:38:07 +0000 (09:38 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 4 Jul 2017 11:11:16 +0000 (13:11 +0200)
Don't print the table header for every entry.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12875

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/utils/net_cache.c

index d3ba2edfd89bdfe5eb205be792c6fbd26b0263f0..f43eb0e88c69ead16c8ba4dd5c6498b2715fed0a 100644 (file)
@@ -360,10 +360,6 @@ static int netsamlog_cache_for_all_cb(const char *sid_str,
                return -1;
        }
 
                return -1;
        }
 
-       d_printf("%-50s %-40s When cached\n", "SID", "Name");
-       d_printf("------------------------------------------------------------"
-                "------------------------------------------------------------"
-                "----\n");
        d_printf("%-50s %-40s %s\n",
                 sid_str,
                 name,
        d_printf("%-50s %-40s %s\n",
                 sid_str,
                 name,
@@ -378,6 +374,11 @@ static int net_cache_samlogon_list(struct net_context *c,
 {
        int ret;
 
 {
        int ret;
 
+       d_printf("%-50s %-40s When cached\n", "SID", "Name");
+       d_printf("------------------------------------------------------------"
+                "------------------------------------------------------------"
+                "----\n");
+
        ret = netsamlog_cache_for_all(netsamlog_cache_for_all_cb, c);
        if (ret == -1) {
                return -1;
        ret = netsamlog_cache_for_all(netsamlog_cache_for_all_cb, c);
        if (ret == -1) {
                return -1;