From: Stefan Metzmacher Date: Thu, 7 Jan 2016 13:50:27 +0000 (+0100) Subject: auth/auth_sam_reply: add some const to input parameters X-Git-Tag: tdb-1.3.10~635 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4034c0a8ea818b9b956bae64bcd43fb477351d56;p=thirdparty%2Fsamba.git auth/auth_sam_reply: add some const to input parameters BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/auth/auth_sam_reply.c b/auth/auth_sam_reply.c index 4ede02cb9c5..d7b84c43279 100644 --- a/auth/auth_sam_reply.c +++ b/auth/auth_sam_reply.c @@ -26,7 +26,7 @@ #include "auth/auth_sam_reply.h" NTSTATUS auth_convert_user_info_dc_sambaseinfo(TALLOC_CTX *mem_ctx, - struct auth_user_info_dc *user_info_dc, + const struct auth_user_info_dc *user_info_dc, struct netr_SamBaseInfo **_sam) { NTSTATUS status; @@ -133,7 +133,7 @@ NTSTATUS auth_convert_user_info_dc_sambaseinfo(TALLOC_CTX *mem_ctx, /* 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, - struct auth_user_info_dc *user_info_dc, + const struct auth_user_info_dc *user_info_dc, struct netr_SamInfo3 **_sam3) { struct netr_SamBaseInfo *sam; @@ -191,7 +191,7 @@ NTSTATUS auth_convert_user_info_dc_saminfo3(TALLOC_CTX *mem_ctx, NTSTATUS make_user_info_SamBaseInfo(TALLOC_CTX *mem_ctx, const char *account_name, - struct netr_SamBaseInfo *base, + const struct netr_SamBaseInfo *base, bool authenticated, struct auth_user_info **_user_info) { @@ -259,7 +259,7 @@ NTSTATUS make_user_info_SamBaseInfo(TALLOC_CTX *mem_ctx, NTSTATUS make_user_info_dc_netlogon_validation(TALLOC_CTX *mem_ctx, const char *account_name, uint16_t validation_level, - union netr_Validation *validation, + const union netr_Validation *validation, bool authenticated, struct auth_user_info_dc **_user_info_dc) { @@ -396,7 +396,7 @@ NTSTATUS make_user_info_dc_netlogon_validation(TALLOC_CTX *mem_ctx, * Make a user_info_dc struct from the PAC_LOGON_INFO supplied in the krb5 logon */ NTSTATUS make_user_info_dc_pac(TALLOC_CTX *mem_ctx, - struct PAC_LOGON_INFO *pac_logon_info, + const struct PAC_LOGON_INFO *pac_logon_info, struct auth_user_info_dc **_user_info_dc) { uint32_t i; @@ -404,7 +404,7 @@ NTSTATUS make_user_info_dc_pac(TALLOC_CTX *mem_ctx, union netr_Validation validation; struct auth_user_info_dc *user_info_dc; - validation.sam3 = &pac_logon_info->info3; + validation.sam3 = discard_const_p(struct netr_SamInfo3, &pac_logon_info->info3); nt_status = make_user_info_dc_netlogon_validation(mem_ctx, "", 3, &validation, true, /* This user was authenticated */ diff --git a/auth/auth_sam_reply.h b/auth/auth_sam_reply.h index 5481eb26e87..efa02f33a4d 100644 --- a/auth/auth_sam_reply.h +++ b/auth/auth_sam_reply.h @@ -33,16 +33,16 @@ /* The following definitions come from auth/auth_sam_reply.c */ NTSTATUS make_user_info_SamBaseInfo(TALLOC_CTX *mem_ctx, - const char *account_name, - struct netr_SamBaseInfo *base, + const const char *account_name, + const struct netr_SamBaseInfo *base, bool authenticated, struct auth_user_info **_user_info); NTSTATUS auth_convert_user_info_dc_sambaseinfo(TALLOC_CTX *mem_ctx, - struct auth_user_info_dc *user_info_dc, + const struct auth_user_info_dc *user_info_dc, struct netr_SamBaseInfo **_sam); NTSTATUS auth_convert_user_info_dc_saminfo3(TALLOC_CTX *mem_ctx, - struct auth_user_info_dc *user_info_dc, + const struct auth_user_info_dc *user_info_dc, struct netr_SamInfo3 **_sam3); /** @@ -51,15 +51,15 @@ NTSTATUS auth_convert_user_info_dc_saminfo3(TALLOC_CTX *mem_ctx, NTSTATUS make_user_info_dc_netlogon_validation(TALLOC_CTX *mem_ctx, const char *account_name, uint16_t validation_level, - union netr_Validation *validation, - bool authenticated, + const union netr_Validation *validation, + bool authenticated, struct auth_user_info_dc **_user_info_dc); /** * Make a user_info_dc struct from the PAC_LOGON_INFO supplied in the krb5 logon */ NTSTATUS make_user_info_dc_pac(TALLOC_CTX *mem_ctx, - struct PAC_LOGON_INFO *pac_logon_info, + const struct PAC_LOGON_INFO *pac_logon_info, struct auth_user_info_dc **_user_info_dc); /* The following definitions come from auth/wbc_auth_util.c */