Skip to content

KRB5:do_keytab_copy(): don't faccessat() for types other than 'FILE:'  #8555

@257

Description

@257

Introduced in 3d27526
--

critical

The readability check with faccessat is applied to all keytab types that are not MEMORY:. This could cause issues with other valid keytab types like KCM: or API:, which are not file-based and for which faccessat would likely fail, causing a regression.

To avoid this, the check should be performed only for FILE: keytabs.

    if (strncmp(keytab_name, "FILE:", sizeof("FILE:") - 1) == 0) {
        if (faccessat(AT_FDCWD, sep+1, R_OK, AT_EACCESS) != 0) {
            saved_errno = errno;
            DEBUG(SSSDBG_CRIT_FAILURE,
                  "keytab [%s] is not readable: [%d][%s].\n",
                  keytab_file, saved_errno, sss_strerror(saved_errno));

            kerr = KRB5KRB_ERR_GENERIC;
            goto done;
        }
    }

Originally posted by @gemini-code-assist[bot] in #8554 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions