From 6f7fcdcda5aa4227c63cd2bd129cb0f2ca5c0009 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 9 Apr 2008 23:24:52 +0200 Subject: net conf: implement "net conf delincludes". usage: "net conf delincludes " This is equivalent to "net conf setincludes " (without further arguments). Michael (This used to be commit a1d09f34ec39b614d738c6f795fe8eafaf634105) --- source3/utils/net_conf.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'source3/utils') 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
\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} }; -- cgit