[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1281-g38d02c5

Michael Adam obnox at samba.org
Mon Apr 27 09:23:54 GMT 2009


The branch, master has been updated
       via  38d02c5d857ecea3405c3f48e64906764329f1a1 (commit)
      from  cf9b027709b46872b07e7f7ca1c9740fc5e0037b (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 38d02c5d857ecea3405c3f48e64906764329f1a1
Author: Michael Adam <obnox at samba.org>
Date:   Fri Oct 24 13:49:16 2008 +0200

    s3:net conf: support dangling parameters by specifying "" as the section name.
    
    for {get,set,del}parm
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source3/utils/net_conf.c |   42 ++++++++++++++++++++++++++++++------------
 1 files changed, 30 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 663c592..864ca9c 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -769,10 +769,16 @@ static int net_conf_setparm(struct net_context *c, struct smbconf_ctx *conf_ctx,
 		net_conf_setparm_usage(c, argc, argv);
 		goto done;
 	}
-	service = talloc_strdup(mem_ctx, argv[0]);
-	if (service == NULL) {
-		d_printf("error: out of memory!\n");
-		goto done;
+	/*
+	 * NULL service name means "dangling parameters" to libsmbconf.
+	 * We use the empty string from the command line for this purpose.
+	 */
+	if (strlen(argv[0]) != 0) {
+		service = talloc_strdup(mem_ctx, argv[0]);
+		if (service == NULL) {
+			d_printf("error: out of memory!\n");
+			goto done;
+		}
 	}
 	param = strlower_talloc(mem_ctx, argv[1]);
 	if (param == NULL) {
@@ -821,10 +827,16 @@ static int net_conf_getparm(struct net_context *c, struct smbconf_ctx *conf_ctx,
 		net_conf_getparm_usage(c, argc, argv);
 		goto done;
 	}
-	service = talloc_strdup(mem_ctx, argv[0]);
-	if (service == NULL) {
-		d_printf("error: out of memory!\n");
-		goto done;
+	/*
+	 * NULL service name means "dangling parameters" to libsmbconf.
+	 * We use the empty string from the command line for this purpose.
+	 */
+	if (strlen(argv[0]) != 0) {
+		service = talloc_strdup(mem_ctx, argv[0]);
+		if (service == NULL) {
+			d_printf("error: out of memory!\n");
+			goto done;
+		}
 	}
 	param = strlower_talloc(mem_ctx, argv[1]);
 	if (param == NULL) {
@@ -871,10 +883,16 @@ static int net_conf_delparm(struct net_context *c, struct smbconf_ctx *conf_ctx,
 		net_conf_delparm_usage(c, argc, argv);
 		goto done;
 	}
-	service = talloc_strdup(mem_ctx, argv[0]);
-	if (service == NULL) {
-		d_printf("error: out of memory!\n");
-		goto done;
+	/*
+	 * NULL service name means "dangling parameters" to libsmbconf.
+	 * We use the empty string from the command line for this purpose.
+	 */
+	if (strlen(argv[0]) != 0) {
+		service = talloc_strdup(mem_ctx, argv[0]);
+		if (service == NULL) {
+			d_printf("error: out of memory!\n");
+			goto done;
+		}
 	}
 	param = strlower_talloc(mem_ctx, argv[1]);
 	if (param == NULL) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list