From 77219ddd220649986fc4f1532271a832d25528bc Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 4 Jan 2008 17:33:24 +0100 Subject: Fix build warning. Guenther (This used to be commit a43125d9e9052fab8eb561976f45d1db4622482e) --- source3/utils/net_conf.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/utils/net_conf.c') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index a758391630..63d5477c9d 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -856,7 +856,6 @@ int net_conf(int argc, const char **argv) regdb_close(); -done: return ret; } -- cgit From 2a8722d4c3177077f5d6cc648f4ef42e38e0ab4d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Jan 2008 19:49:57 +0100 Subject: 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) --- source3/utils/net_conf.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/utils/net_conf.c') 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)) { -- cgit From b1472c0956c6d016973c2a76e4dfce5ecc3b9c05 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Jan 2008 19:52:22 +0100 Subject: Remove the final regdb_close() from net_conf.c This is to hide the registry from net_conf. Right now, it does not harm if "net conf" does not close the registry file explicitly just before exiting. I am working out a proper way of handling open/close operations transparently in the libnet_conf library. Michael (This used to be commit 790ef789444945fbae5637f0b469665859171dcd) --- source3/utils/net_conf.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/utils/net_conf.c') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 2df2410160..d212b451bc 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -863,8 +863,6 @@ int net_conf(int argc, const char **argv) ret = net_run_function2(argc, argv, "net conf", func); - regdb_close(); - return ret; } -- cgit From 34fb7839658af03da0a5f3939777ceb6576dfb42 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Jan 2008 21:03:24 +0100 Subject: Update the introductory comment to net_conf.c to mention linbet_conf. Michael (This used to be commit e166b886375b450534c894676ab1f64571dd46b8) --- source3/utils/net_conf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source3/utils/net_conf.c') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index d212b451bc..f1bf330950 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -19,9 +19,13 @@ */ /* - * This is an interface to the configuration stored inside the - * samba registry. In the future there might be support for other - * configuration backends as well. + * This is an interface to the Samba's configuration as made available + * by the libnet_conf interface (source/libnet/libnet_conf.c). + * + * This currently supports local interaction with the configuration + * stored in the registry. But other backends and remote access via + * rpc (to registry stored configuration) might get implemented in + * the future. */ #include "includes.h" -- cgit From dee8e32d8d66fb07817f28780978cd2b928233ad Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Jan 2008 21:05:51 +0100 Subject: Remove the word "registry" from the help output of the "net conf" command. Michael (This used to be commit 8d9e3e08f3cc6a1f54661d1e54a3902ad50be191) --- source3/utils/net_conf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source3/utils/net_conf.c') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index f1bf330950..1cf98aa3a2 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -24,8 +24,7 @@ * * This currently supports local interaction with the configuration * stored in the registry. But other backends and remote access via - * rpc (to registry stored configuration) might get implemented in - * the future. + * rpc might get implemented in the future. */ #include "includes.h" @@ -847,15 +846,15 @@ int net_conf(int argc, const char **argv) {"import", net_conf_import, "Import configuration from file in smb.conf format."}, {"listshares", net_conf_listshares, - "List the registry shares."}, + "List the share names."}, {"drop", net_conf_drop, - "Delete the complete configuration from registry."}, + "Delete the complete configuration."}, {"showshare", net_conf_showshare, - "Show the definition of a registry share."}, + "Show the definition of a share."}, {"addshare", net_conf_addshare, - "Create a new registry share."}, + "Create a new share."}, {"delshare", net_conf_delshare, - "Delete a registry share."}, + "Delete a share."}, {"setparm", net_conf_setparm, "Store a parameter."}, {"getparm", net_conf_getparm, -- cgit From dbdaa5eeec62e2a643a8be36db0a30c20092b064 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Jan 2008 21:09:55 +0100 Subject: Fix a comment. Michael (This used to be commit fc9c3f39b5af55026f1e5e964857c203cf6c9316) --- source3/utils/net_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils/net_conf.c') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 1cf98aa3a2..52dcda03db 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -19,7 +19,7 @@ */ /* - * This is an interface to the Samba's configuration as made available + * This is an interface to Samba's configuration as made available * by the libnet_conf interface (source/libnet/libnet_conf.c). * * This currently supports local interaction with the configuration -- cgit From 517ad5318d3d196713b96f69eff8e2f5d38d922a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Jan 2008 21:16:48 +0100 Subject: Fix spacing - spaces mixed with tabs. Michael (This used to be commit a4ef828102417f04af1e9823c89404e77e4fd5c1) --- source3/utils/net_conf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/utils/net_conf.c') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 52dcda03db..38cdeacc11 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -46,9 +46,9 @@ static int net_conf_import_usage(int argc, const char**argv) d_printf("USAGE: net conf import [--test|-T] " "[]\n" "\t[--test|-T] testmode - do not act, just print " - "what would be done\n" + "what would be done\n" "\t only import service , " - "ignore the rest\n"); + "ignore the rest\n"); return -1; } @@ -139,14 +139,14 @@ static char *parm_valstr(TALLOC_CTX *ctx, struct parm_struct *parm, valstr = talloc_asprintf(ctx, "%s", BOOLSTR(!*(bool *)ptr)); break; case P_ENUM: - for (i = 0; parm->enum_list[i].name; i++) { - if (*(int *)ptr == parm->enum_list[i].value) + for (i = 0; parm->enum_list[i].name; i++) { + if (*(int *)ptr == parm->enum_list[i].value) { valstr = talloc_asprintf(ctx, "%s", - parm->enum_list[i].name); - break; - } - } + parm->enum_list[i].name); + break; + } + } break; case P_OCTAL: { char *o = octal_string(*(int *)ptr); -- cgit