diff options
author | Darren Tucker <dtucker@zip.com.au> | 2006-09-21 12:59:33 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2006-09-21 12:59:33 +1000 |
commit | 1e80e4023bce285ef4858383b5064b9ac3b254c1 (patch) | |
tree | 1a325ebda0f4736a43c3cc24f31d8c518423127f | |
parent | c70ce7b09d8fd0b341c33e1b8d584a91bb241547 (diff) | |
download | openssh-git-1e80e4023bce285ef4858383b5064b9ac3b254c1.tar.gz |
- 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@
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | sftp.c | 6 |
2 files changed, 12 insertions, 4 deletions
@@ -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. @@ -5457,4 +5465,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4552 2006/09/18 13:54:32 dtucker Exp $ +$Id: ChangeLog,v 1.4553 2006/09/21 02:59:33 dtucker Exp $ @@ -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 |