]> andersk Git - openssh.git/commitdiff
- itojun@cvs.openbsd.org 2002/03/15 11:00:38
authormouring <mouring>
Fri, 22 Mar 2002 01:15:33 +0000 (01:15 +0000)
committermouring <mouring>
Fri, 22 Mar 2002 01:15:33 +0000 (01:15 +0000)
     [auth.c]
     fix file type checking (use S_ISREG).  ok by markus

ChangeLog
auth.c

index b3a6f9d954eaddba6851d596c21de9bf821da5fb..4ec51be001c7939f2d10ef8da9005492ac4342b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,9 @@
    - markus@cvs.openbsd.org 2002/03/14 16:56:33
      [auth-rh-rsa.c auth-rsa.c auth.h]
      split auth_rsa() for better readability and privsep; ok provos@
+   - itojun@cvs.openbsd.org 2002/03/15 11:00:38
+     [auth.c]
+     fix file type checking (use S_ISREG).  ok by markus
 
 20020317
  - (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is wanted,
diff --git a/auth.c b/auth.c
index 26dce5b670ab3792e363d779285586a200a6c7ee..de004515fa99dd9e22a2e52640c3170bfefc5be3 100644 (file)
--- a/auth.c
+++ b/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 $");
 
 #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;
This page took 0.734717 seconds and 5 git commands to generate.