summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2016-05-26 15:51:37 +0000
committermillert <millert@openbsd.org>2016-05-26 15:51:37 +0000
commit68924cfbda2b4d1bccb7c7487d92b5077c485d0e (patch)
tree5158df6263891cddd2599130970ceaf428f64754 /lib/libc
parentRename variables to a less ambiguous name better matching their purpose. (diff)
downloadwireguard-openbsd-68924cfbda2b4d1bccb7c7487d92b5077c485d0e.tar.xz
wireguard-openbsd-68924cfbda2b4d1bccb7c7487d92b5077c485d0e.zip
Use S_ISDIR instead of doing it by hand. No binary change.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/authenticate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/gen/authenticate.c b/lib/libc/gen/authenticate.c
index d62ef5a4975..f1373694d58 100644
--- a/lib/libc/gen/authenticate.c
+++ b/lib/libc/gen/authenticate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authenticate.c,v 1.25 2015/11/24 22:03:33 millert Exp $ */
+/* $OpenBSD: authenticate.c,v 1.26 2016/05/26 15:51:37 millert Exp $ */
/*-
* Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@@ -282,8 +282,7 @@ auth_approval(auth_session_t *as, login_cap_t *lc, char *name, char *type)
pwd->pw_dir[0]) {
struct stat sb;
- if (stat(pwd->pw_dir, &sb) < 0 ||
- (sb.st_mode & 0170000) != S_IFDIR ||
+ if (stat(pwd->pw_dir, &sb) < 0 || !S_ISDIR(sb.st_mode) ||
(pwd->pw_uid && sb.st_uid == pwd->pw_uid &&
(sb.st_mode & S_IXUSR) == 0)) {
auth_setstate(as, (auth_getstate(as) & ~AUTH_ALLOW));