summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc_join.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-08 14:49:30 +0100
committerGünther Deschner <gd@samba.org>2008-02-08 15:30:35 +0100
commit084e28d8851abeef0023159911eb7d101732be35 (patch)
tree6172a9469e5365ca39c86e2fd2e74330008213fa /source3/utils/net_rpc_join.c
parent210a4ab76f9b576b6834106146fcd86ba73acd22 (diff)
downloadsamba-084e28d8851abeef0023159911eb7d101732be35.tar.gz
samba-084e28d8851abeef0023159911eb7d101732be35.tar.bz2
samba-084e28d8851abeef0023159911eb7d101732be35.zip
Use rpccli_samr_LookupNames() in net.
Guenther (This used to be commit a513ae630c9dc0b81215e5513c19f45f18cbc1f1)
Diffstat (limited to 'source3/utils/net_rpc_join.c')
-rw-r--r--source3/utils/net_rpc_join.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index 939a7246f7..0e9e603e23 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -162,14 +162,13 @@ int net_rpc_join_newstyle(int argc, const char **argv)
NTSTATUS result;
int retval = 1;
const char *domain = NULL;
- uint32 num_rids, *name_types, *user_rids;
- uint32 flags = 0x3e8;
char *acct_name;
- const char *const_acct_name;
struct lsa_String lsa_acct_name;
uint32 acct_flags=0;
uint32_t access_granted = 0;
union lsa_PolicyInformation *info = NULL;
+ struct samr_Ids user_rids;
+ struct samr_Ids name_types;
/* check what type of join */
if (argc >= 0) {
@@ -265,7 +264,6 @@ int net_rpc_join_newstyle(int argc, const char **argv)
goto done;
}
strlower_m(acct_name);
- const_acct_name = acct_name;
init_lsa_String(&lsa_acct_name, acct_name);
@@ -306,21 +304,22 @@ int net_rpc_join_newstyle(int argc, const char **argv)
rpccli_samr_Close(pipe_hnd, mem_ctx, &user_pol);
}
- CHECK_RPC_ERR_DEBUG(rpccli_samr_lookup_names(pipe_hnd, mem_ctx,
- &domain_pol, flags,
- 1, &const_acct_name,
- &num_rids,
- &user_rids, &name_types),
+ CHECK_RPC_ERR_DEBUG(rpccli_samr_LookupNames(pipe_hnd, mem_ctx,
+ &domain_pol,
+ 1,
+ &lsa_acct_name,
+ &user_rids,
+ &name_types),
("error looking up rid for user %s: %s\n",
acct_name, nt_errstr(result)));
- if (name_types[0] != SID_NAME_USER) {
- DEBUG(0, ("%s is not a user account (type=%d)\n", acct_name, name_types[0]));
+ if (name_types.ids[0] != SID_NAME_USER) {
+ DEBUG(0, ("%s is not a user account (type=%d)\n", acct_name, name_types.ids[0]));
goto done;
}
- user_rid = user_rids[0];
-
+ user_rid = user_rids.ids[0];
+
/* Open handle on user */
CHECK_RPC_ERR_DEBUG(