diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-22 01:15:33 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-22 01:15:33 +0000 |
commit | b61e6df9f3ef2617af9cb81f32ec5256a1185d35 (patch) | |
tree | 73933629ffadcbc1ead0a5d0f56faaa7bf4cc2af /auth.c | |
parent | 9c8aefe7500dad8f78300b2a015c624b9935e372 (diff) |
- itojun@cvs.openbsd.org 2002/03/15 11:00:38
[auth.c]
fix file type checking (use S_ISREG). ok by markus
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 $"); #ifdef HAVE_LOGIN_H #include <login.h> @@ -110,7 +110,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; |