From: Volker Lendecke Date: Mon, 6 Jul 2026 11:59:26 +0000 (+0200) Subject: gensec: Declare vars closer to their use X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b24f985cf1a20722e4c8eb3be95705a67b4275d;p=thirdparty%2Fsamba.git gensec: Declare vars closer to their use We don't need "workstation" and "domain" in the client case. Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/auth/gensec/schannel.c b/auth/gensec/schannel.c index 10157fffba5..4b046b8b7ba 100644 --- a/auth/gensec/schannel.c +++ b/auth/gensec/schannel.c @@ -824,13 +824,7 @@ static NTSTATUS schannel_update_internal(struct gensec_security *gensec_security struct schannel_state); NTSTATUS status; enum ndr_err_code ndr_err; - struct NL_AUTH_MESSAGE bind_schannel = { - .Flags = 0, - }; - struct NL_AUTH_MESSAGE bind_schannel_ack; struct netlogon_creds_CredentialState *creds; - const char *workstation; - const char *domain; *out = data_blob(NULL, 0); @@ -845,7 +839,9 @@ static NTSTATUS schannel_update_internal(struct gensec_security *gensec_security } switch (gensec_security->gensec_role) { - case GENSEC_CLIENT: + case GENSEC_CLIENT: { + struct NL_AUTH_MESSAGE bind_schannel = {}; + if (state != NULL) { /* we could parse the bind ack, but we don't know what it is yet */ return NT_STATUS_OK; @@ -897,7 +893,12 @@ static NTSTATUS schannel_update_internal(struct gensec_security *gensec_security } return NT_STATUS_MORE_PROCESSING_REQUIRED; - case GENSEC_SERVER: + } + case GENSEC_SERVER: { + struct NL_AUTH_MESSAGE bind_schannel = {}; + struct NL_AUTH_MESSAGE bind_schannel_ack = {}; + const char *workstation = NULL; + const char *domain = NULL; if (state != NULL) { /* no third leg on this protocol */ @@ -985,6 +986,7 @@ static NTSTATUS schannel_update_internal(struct gensec_security *gensec_security return NT_STATUS_OK; } + } return NT_STATUS_INVALID_PARAMETER; }