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) {
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) {
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) {