diff options
author | 2017-09-10 18:20:00 +0000 | |
---|---|---|
committer | 2017-09-10 18:20:00 +0000 | |
commit | 81064d433281cbb881394cc726b6ecbb9268d4ee (patch) | |
tree | bc0dbc3e8baf2fddc8cfad4fc471e1cb0a8b517e /lib/libc/gen/shm_open.c | |
parent | Backslash escapes the next character in filename patterns. (diff) | |
download | wireguard-openbsd-81064d433281cbb881394cc726b6ecbb9268d4ee.tar.xz wireguard-openbsd-81064d433281cbb881394cc726b6ecbb9268d4ee.zip |
shm_open(), sysconf(), tcflow(), and tcsendbreak() are not permitted to be
cancellation points in POSIX, so change them to invoke the non-cancellation
point versions of open(), close(), nanosleep(), and write()
ok deraadt@ millert@
Diffstat (limited to 'lib/libc/gen/shm_open.c')
-rw-r--r-- | lib/libc/gen/shm_open.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/shm_open.c b/lib/libc/gen/shm_open.c index de17de65d22..106c7e2261d 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.8 2015/12/10 13:03:22 tedu Exp $ */ +/* $OpenBSD: shm_open.c,v 1.9 2017/09/10 18:20:00 guenther Exp $ */ /* * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org> * @@ -61,16 +61,16 @@ shm_open(const char *path, int flags, mode_t mode) makeshmpath(path, shmpath, sizeof(shmpath)); - fd = open(shmpath, flags, mode); + fd = HIDDEN(open)(shmpath, flags, mode); if (fd == -1) return -1; if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode)) { - close(fd); + HIDDEN(close)(fd); errno = EINVAL; return -1; } if (sb.st_uid != geteuid()) { - close(fd); + HIDDEN(close)(fd); errno = EPERM; return -1; } |