]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:gensec: Fix overflow issues in switch statement
authorAndreas Schneider <asn@samba.org>
Mon, 1 Feb 2021 13:33:55 +0000 (14:33 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 1 Feb 2021 21:50:32 +0000 (21:50 +0000)
error: overflow converting case value to switch condition type (-1765328344 to 2529638952) [-Werror,-Wswitch]

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/auth/gensec/gensec_gssapi.c

index 2a261a1664f4bac70533449977ade73d08c37c23..165200044156ad553505b3d7bf34e9437c103fa5 100644 (file)
@@ -764,27 +764,27 @@ init_sec_context_done:
                } else if (smb_gss_oid_equal(gensec_gssapi_state->gss_oid,
                                             gss_mech_krb5)) {
                        switch (min_stat) {
-                       case KRB5KRB_AP_ERR_TKT_NYV:
+                       case (OM_uint32)KRB5KRB_AP_ERR_TKT_NYV:
                                DEBUG(1, ("Error with ticket to contact %s: possible clock skew between us and the KDC or target server: %s\n",
                                          gensec_gssapi_state->target_principal,
                                          gssapi_error_string(out_mem_ctx, maj_stat, min_stat, gensec_gssapi_state->gss_oid)));
                                return NT_STATUS_TIME_DIFFERENCE_AT_DC; /* Make SPNEGO ignore us, we can't go any further here */
-                       case KRB5KRB_AP_ERR_TKT_EXPIRED:
+                       case (OM_uint32)KRB5KRB_AP_ERR_TKT_EXPIRED:
                                DEBUG(1, ("Error with ticket to contact %s: ticket is expired, possible clock skew between us and the KDC or target server: %s\n",
                                          gensec_gssapi_state->target_principal,
                                          gssapi_error_string(out_mem_ctx, maj_stat, min_stat, gensec_gssapi_state->gss_oid)));
                                return NT_STATUS_INVALID_PARAMETER; /* Make SPNEGO ignore us, we can't go any further here */
-                       case KRB5_KDC_UNREACH:
+                       case (OM_uint32)KRB5_KDC_UNREACH:
                                DEBUG(3, ("Cannot reach a KDC we require in order to obtain a ticket to %s: %s\n",
                                          gensec_gssapi_state->target_principal,
                                          gssapi_error_string(out_mem_ctx, maj_stat, min_stat, gensec_gssapi_state->gss_oid)));
                                return NT_STATUS_NO_LOGON_SERVERS; /* Make SPNEGO ignore us, we can't go any further here */
-                       case KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN:
+                       case (OM_uint32)KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN:
                                DEBUG(3, ("Server %s is not registered with our KDC: %s\n",
                                          gensec_gssapi_state->target_principal,
                                          gssapi_error_string(out_mem_ctx, maj_stat, min_stat, gensec_gssapi_state->gss_oid)));
                                return NT_STATUS_INVALID_PARAMETER; /* Make SPNEGO ignore us, we can't go any further here */
-                       case KRB5KRB_AP_ERR_MSG_TYPE:
+                       case (OM_uint32)KRB5KRB_AP_ERR_MSG_TYPE:
                                /* garbage input, possibly from the auto-mech detection */
                                return NT_STATUS_INVALID_PARAMETER;
                        default: