From 7624bab9631b004815decfeced58ee72ebe125cb Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Apr 2008 14:38:36 +0200 Subject: net conf: fix output of out-of-share parameters in test mode import Michael (This used to be commit 5424e07e7d3e842488cba7ae389124f01221c5ba) --- source3/utils/net_conf.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 88cc15e0eb..7d1658ba94 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -150,10 +150,18 @@ static WERROR import_process_service(struct smbconf_ctx *conf_ctx, TALLOC_CTX *mem_ctx = talloc_stackframe(); if (opt_testmode) { - d_printf("[%s]\n", servicename); - for (idx = 0; idx < num_params; idx ++) { - d_printf("\t%s = %s\n", param_names[idx], - param_values[idx]); + if (servicename != NULL) { + d_printf("[%s]\n", servicename); + for (idx = 0; idx < num_params; idx++) { + d_printf("\t%s = %s\n", param_names[idx], + param_values[idx]); + } + } + else { + for (idx = 0; idx < num_params; idx++) { + d_printf("%s = %s\n", param_names[idx], + param_values[idx]); + } } d_printf("\n"); goto done; -- cgit From 770b1923dc7735c2681c9976201569896feb74d9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Apr 2008 17:36:11 +0200 Subject: net conf: simplify logic in test output of net conf import. Michael (This used to be commit 367c8b133b2f3e73155f20f689602909eef9827b) --- source3/utils/net_conf.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 7d1658ba94..293485aab1 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -150,18 +150,14 @@ static WERROR import_process_service(struct smbconf_ctx *conf_ctx, TALLOC_CTX *mem_ctx = talloc_stackframe(); if (opt_testmode) { + const char *indent = ""; if (servicename != NULL) { d_printf("[%s]\n", servicename); - for (idx = 0; idx < num_params; idx++) { - d_printf("\t%s = %s\n", param_names[idx], - param_values[idx]); - } + indent = "\t"; } - else { - for (idx = 0; idx < num_params; idx++) { - d_printf("%s = %s\n", param_names[idx], - param_values[idx]); - } + for (idx = 0; idx < num_params; idx++) { + d_printf("%s%s = %s\n", indent, param_names[idx], + param_values[idx]); } d_printf("\n"); goto done; -- cgit From ed85ea4248688005d1769894f0b2f2e86d822fde Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Apr 2008 17:36:44 +0200 Subject: net conf: adapt output of NULL share params in net conf list. don't list NULL share name and don't indent these parameters Michael (This used to be commit 0212b38913945ce3c8b14734804d81f1cd315621) --- source3/utils/net_conf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 293485aab1..4fffcf8a8c 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -246,11 +246,16 @@ static int net_conf_list(struct smbconf_ctx *conf_ctx, } for (share_count = 0; share_count < num_shares; share_count++) { - d_printf("[%s]\n", share_names[share_count]); + const char *indent = ""; + if (share_names[share_count] != NULL) { + d_printf("[%s]\n", share_names[share_count]); + indent = "\t"; + } for (param_count = 0; param_count < num_params[share_count]; param_count++) { - d_printf("\t%s = %s\n", + d_printf("%s%s = %s\n", + indent, param_names[share_count][param_count], param_values[share_count][param_count]); } -- cgit