diff options
author | 2016-05-26 15:51:37 +0000 | |
---|---|---|
committer | 2016-05-26 15:51:37 +0000 | |
commit | 68924cfbda2b4d1bccb7c7487d92b5077c485d0e (patch) | |
tree | 5158df6263891cddd2599130970ceaf428f64754 | |
parent | Rename variables to a less ambiguous name better matching their purpose. (diff) | |
download | wireguard-openbsd-68924cfbda2b4d1bccb7c7487d92b5077c485d0e.tar.xz wireguard-openbsd-68924cfbda2b4d1bccb7c7487d92b5077c485d0e.zip |
Use S_ISDIR instead of doing it by hand. No binary change.
-rw-r--r-- | lib/libc/gen/authenticate.c | 5 |
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)); |