mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
[merge]
* removed unused variable from rpcclient code * added container option to net command (patch from SuSE) * Makefile patch for examples/VFS from SuSE
This commit is contained in:
parent
49685e0fe3
commit
25a9681ddd
@ -3,7 +3,7 @@ CFLAGS = @CFLAGS@
|
|||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LDSHFLAGS = -shared
|
LDSHFLAGS = -shared
|
||||||
srcdir = @builddir@
|
srcdir = ../../source/
|
||||||
FLAGS = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper -I. $(CPPFLAGS) -I$(srcdir)
|
FLAGS = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper -I. $(CPPFLAGS) -I$(srcdir)
|
||||||
|
|
||||||
# Auto target
|
# Auto target
|
||||||
|
@ -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,
|
ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user,
|
||||||
const char *fullname)
|
const char *container, const char *fullname)
|
||||||
{
|
{
|
||||||
TALLOC_CTX *ctx;
|
TALLOC_CTX *ctx;
|
||||||
ADS_MODLIST mods;
|
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)))
|
if (!(upn = talloc_asprintf(ctx, "%s@%s", user, ads->config.realm)))
|
||||||
goto done;
|
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)))
|
ads->config.bind_path)))
|
||||||
goto done;
|
goto done;
|
||||||
if (!(controlstr = talloc_asprintf(ctx, "%u", UF_NORMAL_ACCOUNT)))
|
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,
|
ADS_STATUS ads_add_group_acct(ADS_STRUCT *ads, const char *group,
|
||||||
const char *comment)
|
const char *container, const char *comment)
|
||||||
{
|
{
|
||||||
TALLOC_CTX *ctx;
|
TALLOC_CTX *ctx;
|
||||||
ADS_MODLIST mods;
|
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);
|
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)))
|
ads->config.bind_path)))
|
||||||
goto done;
|
goto done;
|
||||||
if (!(mods = ads_init_mods(ctx)))
|
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_str(ctx, &mods, "cn", group);
|
||||||
ads_mod_strlist(ctx, &mods, "objectClass",objectClass);
|
ads_mod_strlist(ctx, &mods, "objectClass",objectClass);
|
||||||
ads_mod_str(ctx, &mods, "name", group);
|
ads_mod_str(ctx, &mods, "name", group);
|
||||||
if (comment)
|
if (comment && *comment)
|
||||||
ads_mod_str(ctx, &mods, "description", comment);
|
ads_mod_str(ctx, &mods, "description", comment);
|
||||||
ads_mod_str(ctx, &mods, "sAMAccountName", group);
|
ads_mod_str(ctx, &mods, "sAMAccountName", group);
|
||||||
status = ads_gen_add(ads, new_dn, mods);
|
status = ads_gen_add(ads, new_dn, mods);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Unix SMB/CIFS implementation.
|
Unix SMB/CIFS implementation.
|
||||||
RPC pipe client
|
RPC pipe client
|
||||||
|
|
||||||
@ -410,8 +410,7 @@ static NTSTATUS cmd_lsa_enum_privsaccounts(struct cli_state *cli,
|
|||||||
POLICY_HND dom_pol;
|
POLICY_HND dom_pol;
|
||||||
POLICY_HND user_pol;
|
POLICY_HND user_pol;
|
||||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||||
uint32 access_desired = 0x000f000f;
|
|
||||||
|
|
||||||
DOM_SID sid;
|
DOM_SID sid;
|
||||||
uint32 count=0;
|
uint32 count=0;
|
||||||
LUID_ATTR *set;
|
LUID_ATTR *set;
|
||||||
|
@ -68,6 +68,7 @@ int opt_force = 0;
|
|||||||
int opt_port = 0;
|
int opt_port = 0;
|
||||||
int opt_maxusers = -1;
|
int opt_maxusers = -1;
|
||||||
const char *opt_comment = "";
|
const char *opt_comment = "";
|
||||||
|
char *opt_container = "cn=Users";
|
||||||
int opt_flags = -1;
|
int opt_flags = -1;
|
||||||
int opt_jobid = 0;
|
int opt_jobid = 0;
|
||||||
int opt_timeout = 0;
|
int opt_timeout = 0;
|
||||||
@ -446,6 +447,7 @@ static struct functable net_func[] = {
|
|||||||
{"myname", 'n', POPT_ARG_STRING, &opt_requester_name},
|
{"myname", 'n', POPT_ARG_STRING, &opt_requester_name},
|
||||||
{"conf", 's', POPT_ARG_STRING, &servicesf},
|
{"conf", 's', POPT_ARG_STRING, &servicesf},
|
||||||
{"server", 'S', POPT_ARG_STRING, &opt_host},
|
{"server", 'S', POPT_ARG_STRING, &opt_host},
|
||||||
|
{"container", 'c', POPT_ARG_STRING, &opt_container},
|
||||||
{"comment", 'C', POPT_ARG_STRING, &opt_comment},
|
{"comment", 'C', POPT_ARG_STRING, &opt_comment},
|
||||||
{"maxusers", 'M', POPT_ARG_INT, &opt_maxusers},
|
{"maxusers", 'M', POPT_ARG_INT, &opt_maxusers},
|
||||||
{"flags", 'F', POPT_ARG_INT, &opt_flags},
|
{"flags", 'F', POPT_ARG_INT, &opt_flags},
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
extern int opt_maxusers;
|
extern int opt_maxusers;
|
||||||
extern const char *opt_comment;
|
extern const char *opt_comment;
|
||||||
|
extern char *opt_container;
|
||||||
extern int opt_flags;
|
extern int opt_flags;
|
||||||
|
|
||||||
extern const char *opt_comment;
|
extern const char *opt_comment;
|
||||||
|
@ -255,7 +255,7 @@ static int ads_user_add(int argc, const char **argv)
|
|||||||
goto done;
|
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)) {
|
if (!ADS_ERR_OK(status)) {
|
||||||
d_printf("Could not add user %s: %s\n", argv[0],
|
d_printf("Could not add user %s: %s\n", argv[0],
|
||||||
@ -431,7 +431,7 @@ static int ads_group_add(int argc, const char **argv)
|
|||||||
goto done;
|
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)) {
|
if (ADS_ERR_OK(status)) {
|
||||||
d_printf("Group %s added\n", argv[0]);
|
d_printf("Group %s added\n", argv[0]);
|
||||||
|
@ -70,14 +70,14 @@ int net_help_user(int argc, const char **argv)
|
|||||||
"\n\tDelete specified user\n");
|
"\n\tDelete specified user\n");
|
||||||
d_printf("\nnet [<method>] user INFO <name> [misc. options] [targets]"\
|
d_printf("\nnet [<method>] user INFO <name> [misc. options] [targets]"\
|
||||||
"\n\tList the domain groups of the specified user\n");
|
"\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]"\
|
"[-F user flags] [misc. options]"\
|
||||||
" [targets]\n\tAdd specified user\n");
|
" [targets]\n\tAdd specified user\n");
|
||||||
|
|
||||||
net_common_methods_usage(argc, argv);
|
net_common_methods_usage(argc, argv);
|
||||||
net_common_flags_usage(argc, argv);
|
net_common_flags_usage(argc, argv);
|
||||||
d_printf(
|
d_printf("\t-C or --comment=<comment>\tdescriptive comment (for add only)\n");
|
||||||
"\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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,12 +88,12 @@ int net_help_group(int argc, const char **argv)
|
|||||||
d_printf("net [<method>] group DELETE <name> "\
|
d_printf("net [<method>] group DELETE <name> "\
|
||||||
"[misc. options] [targets]"\
|
"[misc. options] [targets]"\
|
||||||
"\n\tDelete specified group\n");
|
"\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");
|
" [misc. options] [targets]\n\tCreate specified group\n");
|
||||||
net_common_methods_usage(argc, argv);
|
net_common_methods_usage(argc, argv);
|
||||||
net_common_flags_usage(argc, argv);
|
net_common_flags_usage(argc, argv);
|
||||||
d_printf(
|
d_printf("\t-C or --comment=<comment>\tdescriptive comment (for add only)\n");
|
||||||
"\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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user