summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-09 23:24:52 +0200
committerMichael Adam <obnox@samba.org>2008-04-10 01:29:03 +0200
commit6f7fcdcda5aa4227c63cd2bd129cb0f2ca5c0009 (patch)
treedccd8d97d94fc08d78d7e4ae4ac04e9f91a53de2
parentf3cfc1446e923104f7aba13c519af8f706749eaf (diff)
downloadsamba-6f7fcdcda5aa4227c63cd2bd129cb0f2ca5c0009.tar.gz
samba-6f7fcdcda5aa4227c63cd2bd129cb0f2ca5c0009.tar.bz2
samba-6f7fcdcda5aa4227c63cd2bd129cb0f2ca5c0009.zip
net conf: implement "net conf delincludes".
usage: "net conf delincludes <servicename>" This is equivalent to "net conf setincludes <servicename>" (without further arguments). Michael (This used to be commit a1d09f34ec39b614d738c6f795fe8eafaf634105)
-rw-r--r--source3/utils/net_conf.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index e6957d0f3e..e83a2be524 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -121,6 +121,12 @@ static int net_conf_setincludes_usage(int argc, const char **argv)
return -1;
}
+static int net_conf_delincludes_usage(int argc, const char **argv)
+{
+ d_printf("USAGE: net conf delincludes <section>\n");
+ return -1;
+}
+
/**********************************************************************
*
@@ -868,6 +874,38 @@ done:
return ret;
}
+static int net_conf_delincludes(struct smbconf_ctx *conf_ctx,
+ int argc, const char **argv)
+{
+ WERROR werr;
+ char *service;
+ int ret = -1;
+ TALLOC_CTX *mem_ctx = talloc_stackframe();
+
+ if (argc != 1) {
+ net_conf_delincludes_usage(argc, argv);
+ goto done;
+ }
+
+ service = talloc_strdup_lower(mem_ctx, argv[0]);
+ if (service == NULL) {
+ d_printf("error: out of memory!\n");
+ goto done;
+ }
+
+ werr = smbconf_delete_includes(conf_ctx, service);
+ if (!W_ERROR_IS_OK(werr)) {
+ d_printf("error deleting includes: %s\n", dos_errstr(werr));
+ goto done;
+ }
+
+ ret = 0;
+
+done:
+ TALLOC_FREE(mem_ctx);
+ return ret;
+}
+
/**********************************************************************
*
@@ -972,6 +1010,8 @@ int net_conf(int argc, const char **argv)
"Show the includes of a share definition."},
{"setincludes", net_conf_setincludes,
"Set includes for a share."},
+ {"delincludes", net_conf_delincludes,
+ "Delete includes from a share definition."},
{NULL, NULL, NULL}
};