summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/shm_open.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-12-10 13:03:22 +0000
committertedu <tedu@openbsd.org>2015-12-10 13:03:22 +0000
commita6da238d7223a7cfcd22393dfb171abf442a414f (patch)
treef4f6ffcc3e03b74ad871aaf3b037da5ffff764cb /lib/libc/gen/shm_open.c
parentuse geteuid to allow root to communicate with others. (diff)
downloadwireguard-openbsd-a6da238d7223a7cfcd22393dfb171abf442a414f.tar.xz
wireguard-openbsd-a6da238d7223a7cfcd22393dfb171abf442a414f.zip
use geteuid to make it easier for root to communicate.
reported by Jeunder Yu
Diffstat (limited to 'lib/libc/gen/shm_open.c')
-rw-r--r--lib/libc/gen/shm_open.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/shm_open.c b/lib/libc/gen/shm_open.c
index 59aca4b10a8..de17de65d22 100644
--- a/lib/libc/gen/shm_open.c
+++ b/lib/libc/gen/shm_open.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shm_open.c,v 1.7 2015/09/12 15:01:33 guenther Exp $ */
+/* $OpenBSD: shm_open.c,v 1.8 2015/12/10 13:03:22 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -69,7 +69,7 @@ shm_open(const char *path, int flags, mode_t mode)
errno = EINVAL;
return -1;
}
- if (sb.st_uid != getuid()) {
+ if (sb.st_uid != geteuid()) {
close(fd);
errno = EPERM;
return -1;