summaryrefslogtreecommitdiffstats
path: root/source/utils/net_ads.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/utils/net_ads.c')
-rw-r--r--source/utils/net_ads.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/utils/net_ads.c b/source/utils/net_ads.c
index 2efd470bbe7..19311cde654 100644
--- a/source/utils/net_ads.c
+++ b/source/utils/net_ads.c
@@ -21,7 +21,7 @@
*/
#include "includes.h"
-#include "../utils/net.h"
+#include "utils/net.h"
#ifdef HAVE_ADS
@@ -297,6 +297,10 @@ static int ads_user_add(int argc, const char **argv)
goto done;
}
+ if (opt_container == NULL) {
+ opt_container = ads_default_ou_string(ads, WELL_KNOWN_GUID_USERS);
+ }
+
status = ads_add_user_acct(ads, argv[0], opt_container, opt_comment);
if (!ADS_ERR_OK(status)) {
@@ -498,6 +502,10 @@ static int ads_group_add(int argc, const char **argv)
goto done;
}
+ if (opt_container == NULL) {
+ opt_container = ads_default_ou_string(ads, WELL_KNOWN_GUID_USERS);
+ }
+
status = ads_add_group_acct(ads, argv[0], opt_container, opt_comment);
if (ADS_ERR_OK(status)) {
@@ -690,7 +698,7 @@ int net_ads_join(int argc, const char **argv)
char *password;
char *machine_account = NULL;
char *tmp_password;
- const char *org_unit = "Computers";
+ const char *org_unit = NULL;
char *dn;
void *res;
DOM_SID dom_sid;
@@ -728,7 +736,7 @@ int net_ads_join(int argc, const char **argv)
return -1;
}
- ou_str = ads_ou_string(org_unit);
+ ou_str = ads_ou_string(ads,org_unit);
asprintf(&dn, "%s,%s", ou_str, ads->config.bind_path);
free(ou_str);
@@ -847,7 +855,7 @@ int net_ads_printer_usage(int argc, const char **argv)
{
d_printf(
"\nnet ads printer search <printer>"
-"\n\tsearch for a printer in the directory"
+"\n\tsearch for a printer in the directory\n"
"\nnet ads printer info <printer> <server>"
"\n\tlookup info in directory for printer on server"
"\n\t(note: printer defaults to \"*\", server defaults to local)\n"