Introduced in 3d27526
--

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)