From 1d9f2815433f8fe0885f672fa8bc490638809c00 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 22 Sep 2013 10:00:55 +0200 Subject: [PATCH] s3:net conf: add the same parameter checks to "setparm" as in "net rpc conf". In "net rpc conf" these checks are necessary, since the that command uses the plain rpc-registry interface at this moment, and so unfortunately it has to duplicate the checks from the smbconf library. Since "net conf" uses the registry, these checks are not necessary in this command. I add them nonetheless to make the output more similar to "net rpc conf". It is also a little more user friendy than just printing "INVALID_PARAMETER" as handed back from libsmbconf. Implement these checks by calling the new net_conf_param_valid() function. Signed-off-by: Michael Adam Reviewed-by: Andrew Bartlett --- source3/utils/net_conf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index e43cd121644..e8481b4d5f9 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -30,6 +30,7 @@ #include "includes.h" #include "system/filesys.h" #include "utils/net.h" +#include "utils/net_conf_util.h" #include "lib/smbconf/smbconf.h" #include "lib/smbconf/smbconf_init.h" #include "lib/smbconf/smbconf_reg.h" @@ -788,6 +789,10 @@ static int net_conf_setparm(struct net_context *c, struct smbconf_ctx *conf_ctx, } value_str = argv[2]; + if (!net_conf_param_valid(service,param, value_str)) { + goto done; + } + err = smbconf_transaction_start(conf_ctx); if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error starting transaction: %s\n"),