1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

auth/auth_sam_reply: add auth_convert_user_info_dc_saminfo2() helper function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher
2016-01-07 15:23:56 +01:00
committed by Andrew Bartlett
parent aee33fc38a
commit a872670fd6
2 changed files with 29 additions and 0 deletions

View File

@ -202,6 +202,32 @@ NTSTATUS auth_convert_user_info_dc_saminfo6(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
/* Note that the validity of the _sam2 structure is only as long as
* the user_info_dc it was generated from */
NTSTATUS auth_convert_user_info_dc_saminfo2(TALLOC_CTX *mem_ctx,
const struct auth_user_info_dc *user_info_dc,
struct netr_SamInfo2 **_sam2)
{
NTSTATUS status;
struct netr_SamInfo6 *sam6 = NULL;
struct netr_SamInfo2 *sam2 = NULL;
sam2 = talloc_zero(mem_ctx, struct netr_SamInfo2);
if (sam2 == NULL) {
return NT_STATUS_NO_MEMORY;
}
status = auth_convert_user_info_dc_saminfo6(sam2, user_info_dc, &sam6);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(sam2);
return status;
}
sam2->base = sam6->base;
*_sam2 = sam2;
return NT_STATUS_OK;
}
/* Note that the validity of the _sam3 structure is only as long as
* the user_info_dc it was generated from */
NTSTATUS auth_convert_user_info_dc_saminfo3(TALLOC_CTX *mem_ctx,

View File

@ -44,6 +44,9 @@ NTSTATUS auth_convert_user_info_dc_sambaseinfo(TALLOC_CTX *mem_ctx,
NTSTATUS auth_convert_user_info_dc_saminfo6(TALLOC_CTX *mem_ctx,
const struct auth_user_info_dc *user_info_dc,
struct netr_SamInfo6 **_sam6);
NTSTATUS auth_convert_user_info_dc_saminfo2(TALLOC_CTX *mem_ctx,
const struct auth_user_info_dc *user_info_dc,
struct netr_SamInfo2 **_sam2);
NTSTATUS auth_convert_user_info_dc_saminfo3(TALLOC_CTX *mem_ctx,
const struct auth_user_info_dc *user_info_dc,
struct netr_SamInfo3 **_sam3);