summaryrefslogtreecommitdiff
path: root/source3/utils/net_conf.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-01-04 19:49:57 +0100
committerMichael Adam <obnox@samba.org>2008-01-04 19:49:57 +0100
commit2a8722d4c3177077f5d6cc648f4ef42e38e0ab4d (patch)
treed4b92432087155659b0dc4b8ea4c7549c53d8a39 /source3/utils/net_conf.c
parent77219ddd220649986fc4f1532271a832d25528bc (diff)
downloadsamba-2a8722d4c3177077f5d6cc648f4ef42e38e0ab4d.tar.gz
samba-2a8722d4c3177077f5d6cc648f4ef42e38e0ab4d.tar.bz2
samba-2a8722d4c3177077f5d6cc648f4ef42e38e0ab4d.zip
Fix the behaviour of "net conf setparm" to create the share if necessary.
This moves functionality taken away from libnet_conf_set_parameter() to the higher level user frontend function. (Somehow I thought I had done this already ... :-) Michael (This used to be commit fc0fca980f08a0af65d82784ef5a50a7b1ac0927)
Diffstat (limited to 'source3/utils/net_conf.c')
-rw-r--r--source3/utils/net_conf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 63d5477c9d..2df2410160 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -719,6 +719,15 @@ static int net_conf_setparm(int argc, const char **argv)
param = strdup_lower(argv[1]);
value_str = argv[2];
+ if (!libnet_conf_share_exists(service)) {
+ werr = libnet_conf_create_share(service);
+ if (!W_ERROR_IS_OK(werr)) {
+ d_fprintf(stderr, "Error creating share '%s': %s\n",
+ service, dos_errstr(werr));
+ goto done;
+ }
+ }
+
werr = libnet_conf_set_parameter(service, param, value_str);
if (!W_ERROR_IS_OK(werr)) {