[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@
This commit is contained in:
Darren Tucker 2006-09-21 12:59:33 +10:00
parent c70ce7b09d
commit 1e80e4023b
2 changed files with 12 additions and 4 deletions

View File

@ -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 $

6
sftp.c
View File

@ -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