summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/VFS/Makefile.in2
-rw-r--r--source3/libads/ldap_user.c10
-rw-r--r--source3/rpcclient/cmd_lsarpc.c5
-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
7 files changed, 19 insertions, 17 deletions
diff --git a/examples/VFS/Makefile.in b/examples/VFS/Makefile.in
index 46e1a90263..30019caccd 100644
--- a/examples/VFS/Makefile.in
+++ b/examples/VFS/Makefile.in
@@ -3,7 +3,7 @@ CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LDSHFLAGS = -shared
-srcdir = @builddir@
+srcdir = ../../source/
FLAGS = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper -I. $(CPPFLAGS) -I$(srcdir)
# Auto target
diff --git a/source3/libads/ldap_user.c b/source3/libads/ldap_user.c
index de19e2da5e..2e38e7a00d 100644
--- a/source3/libads/ldap_user.c
+++ b/source3/libads/ldap_user.c
@@ -38,7 +38,7 @@ ADS_STATUS ads_find_user_acct(ADS_STRUCT *ads, void **res, const char *user)
}
ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user,
- const char *fullname)
+ const char *container, const char *fullname)
{
TALLOC_CTX *ctx;
ADS_MODLIST mods;
@@ -57,7 +57,7 @@ ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user,
if (!(upn = talloc_asprintf(ctx, "%s@%s", user, ads->config.realm)))
goto done;
- if (!(new_dn = talloc_asprintf(ctx, "cn=%s,cn=Users,%s", name,
+ if (!(new_dn = talloc_asprintf(ctx, "cn=%s,%s,%s", name, container,
ads->config.bind_path)))
goto done;
if (!(controlstr = talloc_asprintf(ctx, "%u", UF_NORMAL_ACCOUNT)))
@@ -80,7 +80,7 @@ ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user,
}
ADS_STATUS ads_add_group_acct(ADS_STRUCT *ads, const char *group,
- const char *comment)
+ const char *container, const char *comment)
{
TALLOC_CTX *ctx;
ADS_MODLIST mods;
@@ -93,7 +93,7 @@ ADS_STATUS ads_add_group_acct(ADS_STRUCT *ads, const char *group,
status = ADS_ERROR(LDAP_NO_MEMORY);
- if (!(new_dn = talloc_asprintf(ctx, "cn=%s,cn=Users,%s", group,
+ if (!(new_dn = talloc_asprintf(ctx, "cn=%s,%s,%s", group, container,
ads->config.bind_path)))
goto done;
if (!(mods = ads_init_mods(ctx)))
@@ -102,7 +102,7 @@ ADS_STATUS ads_add_group_acct(ADS_STRUCT *ads, const char *group,
ads_mod_str(ctx, &mods, "cn", group);
ads_mod_strlist(ctx, &mods, "objectClass",objectClass);
ads_mod_str(ctx, &mods, "name", group);
- if (comment)
+ if (comment && *comment)
ads_mod_str(ctx, &mods, "description", comment);
ads_mod_str(ctx, &mods, "sAMAccountName", group);
status = ads_gen_add(ads, new_dn, mods);
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index e1c6fe5d3d..decbc8e161 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -1,4 +1,4 @@
-/*
+/*
Unix SMB/CIFS implementation.
RPC pipe client
@@ -462,8 +462,7 @@ static NTSTATUS cmd_lsa_enum_acct_rights(struct cli_state *cli,
{
POLICY_HND dom_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- uint32 access_desired = 0x000f000f;
-
+
DOM_SID sid;
uint32 count;
char **rights;
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;
}