1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s4:rpc_server: Make some arrays static

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit beaeeaff501b22fdfb3928d788597398fcbbbe29)

Backported for https://bugzilla.samba.org/show_bug.cgi?id=15425
This commit is contained in:
Jo Sutton 2024-02-20 16:46:07 +13:00 committed by Jule Anger
parent cc3a119585
commit 568ebd48af

@ -410,8 +410,11 @@ static NTSTATUS dcesrv_netr_ServerAuthenticate3_helper(
int num_records; int num_records;
struct ldb_message **msgs; struct ldb_message **msgs;
NTSTATUS nt_status; NTSTATUS nt_status;
const char *attrs[] = {"unicodePwd", "userAccountControl", static const char *attrs[] = {"unicodePwd",
"objectSid", "samAccountName", NULL}; "userAccountControl",
"objectSid",
"samAccountName",
NULL};
uint32_t server_flags = 0; uint32_t server_flags = 0;
uint32_t negotiate_flags = 0; uint32_t negotiate_flags = 0;
@ -536,12 +539,10 @@ static NTSTATUS dcesrv_netr_ServerAuthenticate3_helper(
r->in.secure_channel_type == SEC_CHAN_DNS_DOMAIN) r->in.secure_channel_type == SEC_CHAN_DNS_DOMAIN)
{ {
struct ldb_message *tdo_msg = NULL; struct ldb_message *tdo_msg = NULL;
const char * const tdo_attrs[] = { static const char *const tdo_attrs[] = {"trustAuthIncoming",
"trustAuthIncoming", "trustAttributes",
"trustAttributes", "flatName",
"flatName", NULL};
NULL
};
char *encoded_name = NULL; char *encoded_name = NULL;
size_t len; size_t len;
const char *flatname = NULL; const char *flatname = NULL;
@ -2618,17 +2619,17 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
TALLOC_CTX *mem_ctx, struct netr_LogonGetDomainInfo *r) TALLOC_CTX *mem_ctx, struct netr_LogonGetDomainInfo *r)
{ {
struct netlogon_creds_CredentialState *creds; struct netlogon_creds_CredentialState *creds;
const char * const trusts_attrs[] = { static const char *const trusts_attrs[] = {"securityIdentifier",
"securityIdentifier", "flatName",
"flatName", "trustPartner",
"trustPartner", "trustAttributes",
"trustAttributes", "trustDirection",
"trustDirection", "trustType",
"trustType", NULL};
NULL static const char *const attrs2[] = {"sAMAccountName",
}; "dNSHostName",
const char * const attrs2[] = { "sAMAccountName", "dNSHostName", "msDS-SupportedEncryptionTypes",
"msDS-SupportedEncryptionTypes", NULL }; NULL};
const char *sam_account_name, *old_dns_hostname; const char *sam_account_name, *old_dns_hostname;
struct ldb_context *sam_ctx; struct ldb_context *sam_ctx;
const struct GUID *our_domain_guid = NULL; const struct GUID *our_domain_guid = NULL;
@ -2994,11 +2995,15 @@ static bool sam_rodc_access_check(struct ldb_context *sam_ctx,
struct dom_sid *user_sid, struct dom_sid *user_sid,
struct ldb_dn *obj_dn) struct ldb_dn *obj_dn)
{ {
const char *rodc_attrs[] = { "msDS-NeverRevealGroup", static const char *rodc_attrs[] = {"msDS-NeverRevealGroup",
"msDS-RevealOnDemandGroup", "msDS-RevealOnDemandGroup",
"userAccountControl", "userAccountControl",
NULL }; NULL};
const char *obj_attrs[] = { "tokenGroups", "objectSid", "UserAccountControl", "msDS-KrbTgtLinkBL", NULL }; static const char *obj_attrs[] = {"tokenGroups",
"objectSid",
"UserAccountControl",
"msDS-KrbTgtLinkBL",
NULL};
struct ldb_dn *rodc_dn; struct ldb_dn *rodc_dn;
int ret; int ret;
struct ldb_result *rodc_res = NULL, *obj_res = NULL; struct ldb_result *rodc_res = NULL, *obj_res = NULL;
@ -3938,9 +3943,13 @@ static WERROR fill_trusted_domains_array(TALLOC_CTX *mem_ctx,
{ {
struct ldb_dn *system_dn; struct ldb_dn *system_dn;
struct ldb_message **dom_res = NULL; struct ldb_message **dom_res = NULL;
const char *trust_attrs[] = { "flatname", "trustPartner", static const char *trust_attrs[] = {"flatname",
"securityIdentifier", "trustDirection", "trustPartner",
"trustType", "trustAttributes", NULL }; "securityIdentifier",
"trustDirection",
"trustType",
"trustAttributes",
NULL};
uint32_t n; uint32_t n;
int i; int i;
int ret; int ret;