summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-07-18 16:24:02 +0200
committerGünther Deschner <gd@samba.org>2008-07-18 17:26:55 +0200
commit6565087b7313b4ebaa1cc6df8ff888f3fd49ecf6 (patch)
tree1dc7faceaab1aca540f6c5be144992fc3d113797 /source3
parent3d140562fa67a468828c46c703cc3c3de23fa113 (diff)
downloadsamba-6565087b7313b4ebaa1cc6df8ff888f3fd49ecf6.tar.gz
samba-6565087b7313b4ebaa1cc6df8ff888f3fd49ecf6.tar.bz2
samba-6565087b7313b4ebaa1cc6df8ff888f3fd49ecf6.zip
netapi: let libnetapi_samr_lookup_and_open_alias compose lsa string.
Guenther (This used to be commit f93090037798ffb4d9b875a4320f970ae10a64b6)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/netapi/localgroup.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/source3/lib/netapi/localgroup.c b/source3/lib/netapi/localgroup.c
index a7dc5e4752..2c1e9dfc4c 100644
--- a/source3/lib/netapi/localgroup.c
+++ b/source3/lib/netapi/localgroup.c
@@ -27,18 +27,22 @@
static WERROR libnetapi_samr_lookup_and_open_alias(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *pipe_cli,
struct policy_handle *domain_handle,
- struct lsa_String *lsa_account_name,
+ const char *group_name,
uint32_t access_rights,
struct policy_handle *alias_handle)
{
NTSTATUS status;
WERROR werr;
+
+ struct lsa_String lsa_account_name;
struct samr_Ids user_rids, name_types;
+ init_lsa_String(&lsa_account_name, group_name);
+
status = rpccli_samr_LookupNames(pipe_cli, mem_ctx,
domain_handle,
1,
- lsa_account_name,
+ &lsa_account_name,
&user_rids,
&name_types);
if (!NT_STATUS_IS_OK(status)) {
@@ -177,11 +181,9 @@ WERROR NetLocalGroupAdd_r(struct libnetapi_ctx *ctx,
goto done;
}
- init_lsa_String(&lsa_account_name, alias_name);
-
werr = libnetapi_samr_lookup_and_open_alias(ctx, pipe_cli,
&builtin_handle,
- &lsa_account_name,
+ alias_name,
SAMR_ALIAS_ACCESS_LOOKUP_INFO,
&alias_handle);
@@ -275,7 +277,6 @@ WERROR NetLocalGroupDel_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- struct lsa_String lsa_account_name;
struct policy_handle connect_handle, domain_handle, builtin_handle, alias_handle;
struct dom_sid2 *domain_sid = NULL;
@@ -308,11 +309,9 @@ WERROR NetLocalGroupDel_r(struct libnetapi_ctx *ctx,
goto done;
}
- init_lsa_String(&lsa_account_name, r->in.group_name);
-
werr = libnetapi_samr_lookup_and_open_alias(ctx, pipe_cli,
&builtin_handle,
- &lsa_account_name,
+ r->in.group_name,
SEC_STD_DELETE,
&alias_handle);
@@ -336,7 +335,7 @@ WERROR NetLocalGroupDel_r(struct libnetapi_ctx *ctx,
werr = libnetapi_samr_lookup_and_open_alias(ctx, pipe_cli,
&domain_handle,
- &lsa_account_name,
+ r->in.group_name,
SEC_STD_DELETE,
&alias_handle);
@@ -445,7 +444,6 @@ WERROR NetLocalGroupGetInfo_r(struct libnetapi_ctx *ctx,
struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
- struct lsa_String lsa_account_name;
struct policy_handle connect_handle, domain_handle, builtin_handle, alias_handle;
struct dom_sid2 *domain_sid = NULL;
union samr_AliasInfo *alias_info = NULL;
@@ -489,11 +487,9 @@ WERROR NetLocalGroupGetInfo_r(struct libnetapi_ctx *ctx,
goto done;
}
- init_lsa_String(&lsa_account_name, r->in.group_name);
-
werr = libnetapi_samr_lookup_and_open_alias(ctx, pipe_cli,
&builtin_handle,
- &lsa_account_name,
+ r->in.group_name,
SAMR_ALIAS_ACCESS_LOOKUP_INFO,
&alias_handle);
@@ -517,7 +513,7 @@ WERROR NetLocalGroupGetInfo_r(struct libnetapi_ctx *ctx,
werr = libnetapi_samr_lookup_and_open_alias(ctx, pipe_cli,
&domain_handle,
- &lsa_account_name,
+ r->in.group_name,
SAMR_ALIAS_ACCESS_LOOKUP_INFO,
&alias_handle);
@@ -672,7 +668,7 @@ WERROR NetLocalGroupSetInfo_r(struct libnetapi_ctx *ctx,
werr = libnetapi_samr_lookup_and_open_alias(ctx, pipe_cli,
&builtin_handle,
- &lsa_account_name,
+ r->in.group_name,
SAMR_ALIAS_ACCESS_SET_INFO,
&alias_handle);
@@ -695,7 +691,7 @@ WERROR NetLocalGroupSetInfo_r(struct libnetapi_ctx *ctx,
werr = libnetapi_samr_lookup_and_open_alias(ctx, pipe_cli,
&domain_handle,
- &lsa_account_name,
+ r->in.group_name,
SAMR_ALIAS_ACCESS_SET_INFO,
&alias_handle);
if (!W_ERROR_IS_OK(werr)) {