net conf: fix output of out-of-share parameters in test mode import
authorMichael Adam <obnox@samba.org>
Tue, 15 Apr 2008 12:38:36 +0000 (14:38 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 15 Apr 2008 15:40:27 +0000 (17:40 +0200)
Michael
(This used to be commit 5424e07e7d3e842488cba7ae389124f01221c5ba)

source3/utils/net_conf.c

index 88cc15e0eb7a82b9d4d94cbb734bf2bdc35c8908..7d1658ba94a0196f3f5b1d42768fe3ea808fa642 100644 (file)
@@ -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;