summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2018-08-30 16:33:25 +0200
committerBjörn Baumbach <bb@sernet.de>2018-10-11 10:28:17 +0200
commit96b5bf1370fc7975e766dccb1ad70aa57f1d9c6a (patch)
treec5e3bf99b646d479f96295a7744cf4646eac49c0 /source3/auth
parent31daab88e6a415e72ead69844e3eccf5dc02e53c (diff)
downloadsamba-96b5bf1370fc7975e766dccb1ad70aa57f1d9c6a.tar.gz
auth: move copy_session_info() from source3 into the global auth context
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_util.c39
-rw-r--r--source3/auth/proto.h2
-rw-r--r--source3/auth/wscript_build2
3 files changed, 2 insertions, 41 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 24d1e37e9cb..7b0d69f1f21 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -38,6 +38,7 @@
#include "../lib/tsocket/tsocket.h"
#include "rpc_client/util_netlogon.h"
#include "source4/auth/auth.h"
+#include "auth/auth_util.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
@@ -1674,44 +1675,6 @@ static struct auth_serversupplied_info *copy_session_info_serverinfo_guest(TALLO
return dst;
}
-struct auth_session_info *copy_session_info(TALLOC_CTX *mem_ctx,
- const struct auth_session_info *src)
-{
- struct auth_session_info *dst;
- DATA_BLOB blob;
- enum ndr_err_code ndr_err;
-
- ndr_err = ndr_push_struct_blob(
- &blob, talloc_tos(), src,
- (ndr_push_flags_fn_t)ndr_push_auth_session_info);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- DEBUG(0, ("copy_session_info(): ndr_push_auth_session_info failed: "
- "%s\n", ndr_errstr(ndr_err)));
- return NULL;
- }
-
- dst = talloc(mem_ctx, struct auth_session_info);
- if (dst == NULL) {
- DEBUG(0, ("talloc failed\n"));
- TALLOC_FREE(blob.data);
- return NULL;
- }
-
- ndr_err = ndr_pull_struct_blob(
- &blob, dst, dst,
- (ndr_pull_flags_fn_t)ndr_pull_auth_session_info);
- TALLOC_FREE(blob.data);
-
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- DEBUG(0, ("copy_session_info(): ndr_pull_auth_session_info failed: "
- "%s\n", ndr_errstr(ndr_err)));
- TALLOC_FREE(dst);
- return NULL;
- }
-
- return dst;
-}
-
/*
* Set a new session key. Used in the rpc server where we have to override the
* SMB level session key with SystemLibraryDTC
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
index e4a6830eecb..75cf1e6724f 100644
--- a/source3/auth/proto.h
+++ b/source3/auth/proto.h
@@ -270,8 +270,6 @@ NTSTATUS make_session_info_from_username(TALLOC_CTX *mem_ctx,
const char *username,
bool is_guest,
struct auth_session_info **session_info);
-struct auth_session_info *copy_session_info(TALLOC_CTX *mem_ctx,
- const struct auth_session_info *src);
bool init_guest_session_info(TALLOC_CTX *mem_ctx);
NTSTATUS init_system_session_info(TALLOC_CTX *mem_ctx);
bool session_info_set_session_key(struct auth_session_info *info,
diff --git a/source3/auth/wscript_build b/source3/auth/wscript_build
index 8fd7dcded86..d27c231caa7 100644
--- a/source3/auth/wscript_build
+++ b/source3/auth/wscript_build
@@ -14,7 +14,7 @@ bld.SAMBA3_SUBSYSTEM('AUTH_COMMON',
server_info.c
server_info_sam.c
user_info.c''',
- deps='TOKEN_UTIL DCUTIL USER_UTIL')
+ deps='TOKEN_UTIL DCUTIL USER_UTIL common_auth')
bld.SAMBA3_LIBRARY('auth',
source='''auth.c