summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-09-21 12:59:33 +1000
committerDarren Tucker <dtucker@zip.com.au>2006-09-21 12:59:33 +1000
commit1e80e4023bce285ef4858383b5064b9ac3b254c1 (patch)
tree1a325ebda0f4736a43c3cc24f31d8c518423127f
parentc70ce7b09d8fd0b341c33e1b8d584a91bb241547 (diff)
- 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--ChangeLog10
-rw-r--r--sftp.c6
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e43185568..0373fe17a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
120060921
2 - (dtucker) OpenBSD CVS Sync
3 - otto@cvs.openbsd.org 2006/09/19 05:52:23
4 [sftp.c]
5 Use S_IS* macros insted of masking with S_IF* flags. The latter may
6 have multiple bits set, which lead to surprising results. Spotted by
7 Paul Stoeber, more to come. ok millert@ pedro@ jaredy@ djm@
8
120060918 920060918
2 - (dtucker) [configure.ac] On AIX, check to see if the compiler will allow 10 - (dtucker) [configure.ac] On AIX, check to see if the compiler will allow
3 macro redefinitions, and if not, remove "-qlanglvl=ansi" from the flags. 11 macro redefinitions, and if not, remove "-qlanglvl=ansi" from the flags.
@@ -5457,4 +5465,4 @@
5457 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 5465 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
5458 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 5466 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
5459 5467
5460$Id: ChangeLog,v 1.4552 2006/09/18 13:54:32 dtucker Exp $ 5468$Id: ChangeLog,v 1.4553 2006/09/21 02:59:33 dtucker Exp $
diff --git a/sftp.c b/sftp.c
index cf3dea048..c018615ae 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.91 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: sftp.c,v 1.92 2006/09/19 05:52:23 otto Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -493,7 +493,7 @@ is_dir(char *path)
493 if (stat(path, &sb) == -1) 493 if (stat(path, &sb) == -1)
494 return(0); 494 return(0);
495 495
496 return(sb.st_mode & S_IFDIR); 496 return(S_ISDIR(sb.st_mode));
497} 497}
498 498
499static int 499static int
@@ -517,7 +517,7 @@ remote_is_dir(struct sftp_conn *conn, char *path)
517 return(0); 517 return(0);
518 if (!(a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS)) 518 if (!(a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS))
519 return(0); 519 return(0);
520 return(a->perm & S_IFDIR); 520 return(S_ISDIR(a->perm));
521} 521}
522 522
523static int 523static int