Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gssapi: default pam_gssapi_services to NULL in domain section and coverity fixes #5453

Closed
wants to merge 2 commits into from

Commits on Jan 11, 2021

  1. gssapi: default pam_gssapi_services to NULL in domain section

    We need to distinguish when the option is not set in domain section and when
    it is is explicitly disabled. Now if it is not set, domain->gssapi_services
    is NULL and we'll use value from the pam section.
    
    Without this change, the value in the pam section is ignored.
    pbrezina committed Jan 11, 2021
    Configuration menu
    Copy the full SHA
    1e15e80 View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2021

  1. pam_sss_gssapi: fix coverity issues

    ```
    1. Defect type: RESOURCE_LEAK
    7. sssd-2.4.0/src/sss_client/pam_sss_gss.c:556: leaked_storage: Variable "username" going out of scope leaks the storage it points to.
    Expand
    2. Defect type: RESOURCE_LEAK
    3. sssd-2.4.0/src/sss_client/pam_sss_gss.c:321: leaked_storage: Variable "reply" going out of scope leaks the storage it points to.
    Expand
    3. Defect type: RESOURCE_LEAK
    7. sssd-2.4.0/src/sss_client/pam_sss_gss.c:260: leaked_storage: Variable "username" going out of scope leaks the storage it points to.
    Expand
    4. Defect type: RESOURCE_LEAK
    6. sssd-2.4.0/src/sss_client/pam_sss_gss.c:260: leaked_storage: Variable "upn" going out of scope leaks the storage it points to.
    Expand
    5. Defect type: RESOURCE_LEAK
    7. sssd-2.4.0/src/sss_client/pam_sss_gss.c:260: leaked_storage: Variable "target" going out of scope leaks the storage it points to.
    Expand
    6. Defect type: RESOURCE_LEAK
    7. sssd-2.4.0/src/sss_client/pam_sss_gss.c:260: leaked_storage: Variable "domain" going out of scope leaks the storage it points to.
    
    1. Defect type: CLANG_WARNING
    1. sssd-2.4.0/src/sss_client/pam_sss_gss.c:260:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'username'
    Expand
    2. Defect type: CLANG_WARNING
    1. sssd-2.4.0/src/sss_client/pam_sss_gss.c:260:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'upn'
    Expand
    3. Defect type: CLANG_WARNING
    1. sssd-2.4.0/src/sss_client/pam_sss_gss.c:260:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'target'
    Expand
    4. Defect type: CLANG_WARNING
    1. sssd-2.4.0/src/sss_client/pam_sss_gss.c:260:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'domain'
    ```
    
    Also fix compilation warning
    ```
    ../src/sss_client/pam_sss_gss.c:339:5: warning: ‘reply’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      339 |     free(reply);
          |     ^~~~~~~~~~~
    ../src/sss_client/pam_sss_gss.c:328:14: note: ‘reply’ was declared here
      328 |     uint8_t *reply;
          |              ^~~~~
    ../src/sss_client/pam_sss_gss.c:270:11: warning: ‘reply_len’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      270 |     upn = malloc(reply_len * sizeof(char));
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/sss_client/pam_sss_gss.c:327:12: note: ‘reply_len’ was declared here
      327 |     size_t reply_len;
          |            ^~~~~~~~~
    ```
    pbrezina committed Jan 15, 2021
    Configuration menu
    Copy the full SHA
    beb8116 View commit details
    Browse the repository at this point in the history