Check fcache st_uid == geteuid(), not getuid()
Programs like sshd may create or access a ccache with ruid != user's UID, euid == user's UID. Set-uid-0 programs (ob reminder: they start life as ruid == user's UID, euid == 0) shouldn't unintentionally access ccaches. Therefore we shouldn't check both of ruid and euid, just euid.
This commit is contained in:
@@ -494,10 +494,9 @@ again:
|
|||||||
/*
|
/*
|
||||||
* XXX Should probably add options to improve control over this
|
* XXX Should probably add options to improve control over this
|
||||||
* check. We might want strict checking of everything except
|
* check. We might want strict checking of everything except
|
||||||
* this, and we might want st_uid == getuid() || st_uid == geteuid()
|
* this.
|
||||||
* to be OK.
|
|
||||||
*/
|
*/
|
||||||
if (sb2.st_uid != getuid()) {
|
if (sb2.st_uid != geteuid()) {
|
||||||
krb5_set_error_message(context, EPERM, N_("Refuses to open cache files not own by myself FILE:%s (owned by %d)", ""), filename, (int)sb2.st_uid);
|
krb5_set_error_message(context, EPERM, N_("Refuses to open cache files not own by myself FILE:%s (owned by %d)", ""), filename, (int)sb2.st_uid);
|
||||||
close(fd);
|
close(fd);
|
||||||
return EPERM;
|
return EPERM;
|
||||||
|
Reference in New Issue
Block a user