1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

use geteuid to allow root to communicate with others.

report from Jeunder Yu
This commit is contained in:
tedu 2015-12-10 13:02:24 +00:00
parent 3c22dd35b2
commit 59e6ef93af

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rthread_sem.c,v 1.20 2015/01/16 16:48:52 deraadt Exp $ */
/* $OpenBSD: rthread_sem.c,v 1.21 2015/12/10 13:02:24 tedu Exp $ */
/*
* Copyright (c) 2004,2005,2013 Ted Unangst <tedu@openbsd.org>
* All Rights Reserved.
@ -342,7 +342,7 @@ sem_open(const char *name, int oflag, ...)
errno = EINVAL;
return (SEM_FAILED);
}
if (sb.st_uid != getuid()) {
if (sb.st_uid != geteuid()) {
close(fd);
errno = EPERM;
return (SEM_FAILED);