Bug 1678872

Summary: mod_auth_gssapi: test failure due to wrong int sizing
Product: [Fedora] Fedora Reporter: Robbie Harwood <rharwood>
Component: mod_auth_gssapiAssignee: Simo Sorce <ssorce>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bnater, ipa-qe, jorton, luhliari, rharwood, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Unspecified   
URL: https://github.com/modauthgssapi/mod_auth_gssapi/pull/198
Whiteboard:
Fixed In Version: mod_auth_gssapi-1.6.1-5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1674501 Environment:
Last Closed: 2019-02-27 19:05:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1674501, 1678873    

Description Robbie Harwood 2019-02-19 19:00:27 UTC
Description of problem:
Upstream test suite, namely "BASIC Fail Second User" test is failing on s390x. No failures appear on x86_64, aarch64 or ppc64le.

--- Additional comment from Joe Orton on 2019-02-19 03:56:48 EST ---

mod_auth_gssapi is using:

    AP_INIT_FLAG("GssapiPublishErrors", ap_set_flag_slot,
                 (void *)APR_OFFSETOF(struct mag_config, enverrs), OR_AUTHCFG,
                 "Publish GSSAPI Errors in Envionment Variables"),

but enverrs is a bool:

    bool enverrs;

ap_set_flag_slot() requires a variable with sizeof(int) whereas it looks like sizeof(bool) is not fixed by C99, only "big enough to store one bit".  On x86_64 sizeof(bool) is sizeof(char) anyway, so it's broken everywhere.

The simplest fix would be to change envvers to type int.

--- Additional comment from Joe Orton on 2019-02-19 04:04:39 EST ---

The other use of ap_set_flag_slot in this module:

    AP_INIT_FLAG("GssapiImpersonate", ap_set_flag_slot,
          (void *)APR_OFFSETOF(struct mag_config, s4u2self), OR_AUTHCFG,
               "Do impersonation call (S4U2Self) "
               "based on already authentication username"),

also has the same problem; using either these directives may be splatting over other config fields in nasty ways depending on the struct padding.

--- Additional comment from Robbie Harwood on 2019-02-19 13:59:07 EST ---

Thanks Joe.  Posted fix upstream.