diff options
author | Ralph Boehme <slow@samba.org> | 2017-12-02 22:35:36 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2018-01-13 08:24:08 +0100 |
commit | 158c89068b5f0ebd10e41f578530e3210fc1d8b3 (patch) | |
tree | 1621d101b23d3b5be893ecbd8054aed714e1d993 /source3/auth | |
parent | a1a9feb72001e9107d339555d2d7593c8be637ca (diff) | |
download | samba-158c89068b5f0ebd10e41f578530e3210fc1d8b3.tar.gz |
s3/rpc_client: move copy_netr_SamInfo3() to util_netlogon
The next commit will add an additional caller that in rpc_client and I
don't want to pull in AUTH_COMMON. The natural place to consolidate
netlogon related helper functions seems to be util_netlogon.c which
already has copy_netr_SamBaseInfo().
No change in behaviour.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_util.c | 1 | ||||
-rw-r--r-- | source3/auth/proto.h | 2 | ||||
-rw-r--r-- | source3/auth/server_info.c | 42 |
3 files changed, 1 insertions, 44 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 464fe25abcc..5bb5a69dfa7 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -36,6 +36,7 @@ #include "../librpc/gen_ndr/idmap.h" #include "lib/param/loadparm.h" #include "../lib/tsocket/tsocket.h" +#include "rpc_client/util_netlogon.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_AUTH diff --git a/source3/auth/proto.h b/source3/auth/proto.h index 996b432f18c..e7746701022 100644 --- a/source3/auth/proto.h +++ b/source3/auth/proto.h @@ -322,8 +322,6 @@ NTSTATUS passwd_to_SamInfo3(TALLOC_CTX *mem_ctx, const struct passwd *pwd, struct netr_SamInfo3 **pinfo3, struct extra_auth_info *extra); -struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx, - const struct netr_SamInfo3 *orig); /* The following definitions come from auth/pampass.c */ diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c index 8461d2089f2..20d43d237fa 100644 --- a/source3/auth/server_info.c +++ b/source3/auth/server_info.c @@ -711,45 +711,3 @@ done: return status; } - -#undef RET_NOMEM - -#define RET_NOMEM(ptr) do { \ - if (!ptr) { \ - TALLOC_FREE(info3); \ - return NULL; \ - } } while(0) - -struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx, - const struct netr_SamInfo3 *orig) -{ - struct netr_SamInfo3 *info3; - unsigned int i; - NTSTATUS status; - - info3 = talloc_zero(mem_ctx, struct netr_SamInfo3); - if (!info3) return NULL; - - status = copy_netr_SamBaseInfo(info3, &orig->base, &info3->base); - if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(info3); - return NULL; - } - - if (orig->sidcount) { - info3->sidcount = orig->sidcount; - info3->sids = talloc_array(info3, struct netr_SidAttr, - orig->sidcount); - RET_NOMEM(info3->sids); - for (i = 0; i < orig->sidcount; i++) { - info3->sids[i].sid = dom_sid_dup(info3->sids, - orig->sids[i].sid); - RET_NOMEM(info3->sids[i].sid); - info3->sids[i].attributes = - orig->sids[i].attributes; - } - } - - return info3; -} - |