net:conf:import: print error message when importing fails.
authorMichael Adam <obnox@samba.org>
Fri, 26 Jun 2015 11:54:57 +0000 (13:54 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 30 Jun 2015 12:23:18 +0000 (14:23 +0200)
If there is a mis-spelled option in a share definition,
'net conf import' will currently silently drop it
(but exit with code != 0). We want to be notified
of what went wrong.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/utils/net_conf.c

index e8481b4d5f975e8332c0b6cd366a4d2eb6c0bbd8..8d9f1e6b99b3331c645c036b0d1df59a17d186a6 100644 (file)
@@ -339,6 +339,8 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx,
 
                err = import_process_service(c, conf_ctx, service);
                if (!SBC_ERROR_IS_OK(err)) {
+                       d_printf(_("error importing service %s: %s\n"),
+                                servicename, sbcErrorString(err));
                        goto cancel;
                }
        } else {
@@ -376,6 +378,9 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx,
                        err = import_process_service(c, conf_ctx,
                                                     services[sidx]);
                        if (!SBC_ERROR_IS_OK(err)) {
+                               d_printf(_("error importing service %s: %s\n"),
+                                        services[sidx]->name,
+                                        sbcErrorString(err));
                                goto cancel;
                        }