summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net.c2
-rw-r--r--source3/utils/net.h1
-rw-r--r--source3/utils/net_ads.c4
-rw-r--r--source3/utils/net_help.c12
4 files changed, 11 insertions, 8 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 34822670d1..5c1156abf9 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -68,6 +68,7 @@ int opt_force = 0;
int opt_port = 0;
int opt_maxusers = -1;
const char *opt_comment = "";
+char *opt_container = "cn=Users";
int opt_flags = -1;
int opt_jobid = 0;
int opt_timeout = 0;
@@ -525,6 +526,7 @@ static struct functable net_func[] = {
{"myname", 'n', POPT_ARG_STRING, &opt_requester_name},
{"conf", 's', POPT_ARG_STRING, &servicesf},
{"server", 'S', POPT_ARG_STRING, &opt_host},
+ {"container", 'c', POPT_ARG_STRING, &opt_container},
{"comment", 'C', POPT_ARG_STRING, &opt_comment},
{"maxusers", 'M', POPT_ARG_INT, &opt_maxusers},
{"flags", 'F', POPT_ARG_INT, &opt_flags},
diff --git a/source3/utils/net.h b/source3/utils/net.h
index 6fa4bd6bce..c1b49a919b 100644
--- a/source3/utils/net.h
+++ b/source3/utils/net.h
@@ -38,6 +38,7 @@
extern int opt_maxusers;
extern const char *opt_comment;
+extern char *opt_container;
extern int opt_flags;
extern const char *opt_comment;
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 4f4ea3e8b8..29abc33fdf 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -257,7 +257,7 @@ static int ads_user_add(int argc, const char **argv)
goto done;
}
- status = ads_add_user_acct(ads, argv[0], opt_comment);
+ status = ads_add_user_acct(ads, argv[0], opt_container, opt_comment);
if (!ADS_ERR_OK(status)) {
d_printf("Could not add user %s: %s\n", argv[0],
@@ -433,7 +433,7 @@ static int ads_group_add(int argc, const char **argv)
goto done;
}
- status = ads_add_group_acct(ads, argv[0], opt_comment);
+ status = ads_add_group_acct(ads, argv[0], opt_container, opt_comment);
if (ADS_ERR_OK(status)) {
d_printf("Group %s added\n", argv[0]);
diff --git a/source3/utils/net_help.c b/source3/utils/net_help.c
index fc0fdd0f09..782a530035 100644
--- a/source3/utils/net_help.c
+++ b/source3/utils/net_help.c
@@ -70,14 +70,14 @@ int net_help_user(int argc, const char **argv)
"\n\tDelete specified user\n");
d_printf("\nnet [<method>] user INFO <name> [misc. options] [targets]"\
"\n\tList the domain groups of the specified user\n");
- d_printf("\nnet [<method>] user ADD <name> [password] "\
+ d_printf("\nnet [<method>] user ADD <name> [password] [-c container] "\
"[-F user flags] [misc. options]"\
" [targets]\n\tAdd specified user\n");
net_common_methods_usage(argc, argv);
net_common_flags_usage(argc, argv);
- d_printf(
- "\t-C or --comment=<comment>\tdescriptive comment (for add only)\n");
+ d_printf("\t-C or --comment=<comment>\tdescriptive comment (for add only)\n");
+ d_printf("\t-c or --container=<container>\tLDAP container, defaults to cn=Users (for add in ADS only)\n");
return -1;
}
@@ -88,12 +88,12 @@ int net_help_group(int argc, const char **argv)
d_printf("net [<method>] group DELETE <name> "\
"[misc. options] [targets]"\
"\n\tDelete specified group\n");
- d_printf("\nnet [<method>] group ADD <name> [-C comment]"\
+ d_printf("\nnet [<method>] group ADD <name> [-C comment] [-c container]"\
" [misc. options] [targets]\n\tCreate specified group\n");
net_common_methods_usage(argc, argv);
net_common_flags_usage(argc, argv);
- d_printf(
- "\t-C or --comment=<comment>\tdescriptive comment (for add only)\n");
+ d_printf("\t-C or --comment=<comment>\tdescriptive comment (for add only)\n");
+ d_printf("\t-c or --container=<container>\tLDAP container, defaults to cn=Users (for add in ADS only)\n");
return -1;
}