Changeset View
Changeset View
Standalone View
Standalone View
crypto/heimdal/lib/krb5/kuserok.c
Show First 20 Lines • Show All 270 Lines • ▼ Show 20 Lines | return FALSE; | ||||
strlcat(buf, KLOGIN, buflen); | strlcat(buf, KLOGIN, buflen); | ||||
ret = check_one_file(context, buf, pwd, principal, &result); | ret = check_one_file(context, buf, pwd, principal, &result); | ||||
if(ret == 0 && result == TRUE) { | if(ret == 0 && result == TRUE) { | ||||
free(buf); | free(buf); | ||||
return TRUE; | return TRUE; | ||||
} | } | ||||
if(ret != ENOENT) | if(ret != ENOENT && ret != EACCES && ret != EPERM) | ||||
found_file = TRUE; | found_file = TRUE; | ||||
strlcat(buf, ".d", buflen); | strlcat(buf, ".d", buflen); | ||||
ret = check_directory(context, buf, pwd, principal, &result); | ret = check_directory(context, buf, pwd, principal, &result); | ||||
free(buf); | free(buf); | ||||
if(ret == 0 && result == TRUE) | if(ret == 0 && result == TRUE) | ||||
return TRUE; | return TRUE; | ||||
if(ret != ENOENT && ret != ENOTDIR) | if(ret != ENOENT && ret != ENOTDIR && ret != EACCES && ret != EPERM) | ||||
found_file = TRUE; | found_file = TRUE; | ||||
/* finally if no files exist, allow all principals matching | /* finally if no files exist, allow all principals matching | ||||
<localuser>@<LOCALREALM> */ | <localuser>@<LOCALREALM> */ | ||||
if(found_file == FALSE) | if(found_file == FALSE) | ||||
return match_local_principals(context, principal, luser); | return match_local_principals(context, principal, luser); | ||||
return FALSE; | return FALSE; | ||||
#else | #else | ||||
/* The .k5login file may be on a remote profile and we don't have | /* The .k5login file may be on a remote profile and we don't have | ||||
access to the profile until we have a token handle for the | access to the profile until we have a token handle for the | ||||
user's credentials. */ | user's credentials. */ | ||||
return match_local_principals(context, principal, luser); | return match_local_principals(context, principal, luser); | ||||
#endif | #endif | ||||
} | } |