summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/auth.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-03-15 11:00:39 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-03-15 11:00:39 +0000
commit841669506a0a2a64f4ab24abde38d5547a842918 (patch)
tree72601650fbef7ce61c1354ec80bc62eaac9a3302 /usr.bin/ssh/auth.c
parent227a24a50479cbae7a981db87a9d35d20640a687 (diff)
fix file type checking (use S_ISREG). ok by markus
Diffstat (limited to 'usr.bin/ssh/auth.c')
-rw-r--r--usr.bin/ssh/auth.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/auth.c b/usr.bin/ssh/auth.c
index 6e29d662e78..d5c482a9751 100644
--- a/usr.bin/ssh/auth.c
+++ b/usr.bin/ssh/auth.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: auth.c,v 1.35 2002/03/01 13:12:10 markus Exp $");
+RCSID("$OpenBSD: auth.c,v 1.36 2002/03/15 11:00:38 itojun Exp $");
#include <libgen.h>
@@ -76,7 +76,8 @@ allowed_user(struct passwd * pw)
pw->pw_name, shell);
return 0;
}
- if (!((st.st_mode & S_IFREG) && (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)))) {
+ if (S_ISREG(st.st_mode) == 0 ||
+ (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)) == 0) {
log("User %.100s not allowed because shell %.100s is not executable",
pw->pw_name, shell);
return 0;