]> andersk Git - openssh.git/commitdiff
- otto@cvs.openbsd.org 2006/09/19 05:52:23
authordtucker <dtucker>
Thu, 21 Sep 2006 02:59:33 +0000 (02:59 +0000)
committerdtucker <dtucker>
Thu, 21 Sep 2006 02:59:33 +0000 (02:59 +0000)
     [sftp.c]
     Use S_IS* macros insted of masking with S_IF* flags. The latter may
     have multiple bits set, which lead to surprising results. Spotted by
     Paul Stoeber, more to come. ok millert@ pedro@ jaredy@ djm@

ChangeLog
sftp.c

index 5aea0d00a73b05558ac529f4b65c622bf058f193..139be43ac843c5f4c2a05a380b5c6dab903fc982 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+20060921
+ - (dtucker) OpenBSD CVS Sync
+   - otto@cvs.openbsd.org 2006/09/19 05:52:23
+     [sftp.c]
+     Use S_IS* macros insted of masking with S_IF* flags. The latter may
+     have multiple bits set, which lead to surprising results. Spotted by
+     Paul Stoeber, more to come. ok millert@ pedro@ jaredy@ djm@
+
 20060918
  - (dtucker) [configure.ac] On AIX, check to see if the compiler will allow
    macro redefinitions, and if not, remove "-qlanglvl=ansi" from the flags.
diff --git a/sftp.c b/sftp.c
index cf3dea048122cc7d6cfa51e9c6530728ac808809..c018615ae61b13f27d9884e0755f317e52d37250 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.91 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: sftp.c,v 1.92 2006/09/19 05:52:23 otto Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *
@@ -493,7 +493,7 @@ is_dir(char *path)
        if (stat(path, &sb) == -1)
                return(0);
 
-       return(sb.st_mode & S_IFDIR);
+       return(S_ISDIR(sb.st_mode));
 }
 
 static int
@@ -517,7 +517,7 @@ remote_is_dir(struct sftp_conn *conn, char *path)
                return(0);
        if (!(a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS))
                return(0);
-       return(a->perm & S_IFDIR);
+       return(S_ISDIR(a->perm));
 }
 
 static int
This page took 0.048405 seconds and 5 git commands to generate.