summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac13
-rw-r--r--sftp-client.c21
3 files changed, 9 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index df6fba7aa..85446e312 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
120091011
2 - (dtucker) [configure.ac sftp-client.c] Remove the gyrations required for
3 dirent d_type and DTTOIF as we've switched OpenBSD to the more portable
4 lstat.
5
120091007 620091007
2 - (dtucker) OpenBSD CVS Sync 7 - (dtucker) OpenBSD CVS Sync
3 - djm@cvs.openbsd.org 2009/08/12 00:13:00 8 - djm@cvs.openbsd.org 2009/08/12 00:13:00
diff --git a/configure.ac b/configure.ac
index 80db43af1..0447bd62d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.429 2009/10/07 07:56:10 dtucker Exp $ 1# $Id: configure.ac,v 1.430 2009/10/11 10:50:20 dtucker Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) 17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
18AC_REVISION($Revision: 1.429 $) 18AC_REVISION($Revision: 1.430 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20 20
21AC_CONFIG_HEADER(config.h) 21AC_CONFIG_HEADER(config.h)
@@ -1130,15 +1130,6 @@ int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
1130 ] 1130 ]
1131) 1131)
1132 1132
1133AC_CHECK_DECL(DTTOIF,
1134 AC_DEFINE(DTTOIF_IN_FS_FFS_DIR_H, 1 , [DTTOIF macro in fs/ffs/dir.h]), ,
1135 [
1136#include <sys/types.h>
1137#include <fs/ffs/dir.h>
1138 ])
1139
1140AC_CHECK_MEMBERS([struct dirent.d_type],,, [#include <dirent.h>])
1141
1142AC_MSG_CHECKING([for /proc/pid/fd directory]) 1133AC_MSG_CHECKING([for /proc/pid/fd directory])
1143if test -d "/proc/$$/fd" ; then 1134if test -d "/proc/$$/fd" ; then
1144 AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd]) 1135 AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd])
diff --git a/sftp-client.c b/sftp-client.c
index a9c895a0d..cc4a5b15b 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -37,9 +37,6 @@
37#include <sys/uio.h> 37#include <sys/uio.h>
38 38
39#include <dirent.h> 39#include <dirent.h>
40#ifdef DTTOIF_IN_FS_FFS_DIR_H
41# include <fs/ffs/dir.h>
42#endif
43#include <errno.h> 40#include <errno.h>
44#include <fcntl.h> 41#include <fcntl.h>
45#include <signal.h> 42#include <signal.h>
@@ -1454,20 +1451,6 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1454 return status; 1451 return status;
1455} 1452}
1456 1453
1457static mode_t
1458dirent_to_mode(struct dirent *dp)
1459{
1460#if defined(HAVE_STRUCT_DIRENT_D_TYPE) && defined(DTTOIF)
1461 return DTTOIF(dp->d_type);
1462#else
1463 struct stat sb;
1464
1465 if (stat(dp->d_name, &sb) == -1)
1466 return 0;
1467 return sb.st_mode;
1468#endif
1469}
1470
1471static int 1454static int
1472upload_dir_internal(struct sftp_conn *conn, char *src, char *dst, 1455upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
1473 int pflag, int printflag, int depth) 1456 int pflag, int printflag, int depth)
@@ -1529,7 +1512,7 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
1529 new_dst = path_append(dst, filename); 1512 new_dst = path_append(dst, filename);
1530 new_src = path_append(src, filename); 1513 new_src = path_append(src, filename);
1531 1514
1532 if (S_ISDIR(dirent_to_mode(dp))) { 1515 if (S_ISDIR(DTTOIF(dp->d_type))) {
1533 if (strcmp(filename, ".") == 0 || 1516 if (strcmp(filename, ".") == 0 ||
1534 strcmp(filename, "..") == 0) 1517 strcmp(filename, "..") == 0)
1535 continue; 1518 continue;
@@ -1537,7 +1520,7 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
1537 if (upload_dir_internal(conn, new_src, new_dst, 1520 if (upload_dir_internal(conn, new_src, new_dst,
1538 pflag, depth + 1, printflag) == -1) 1521 pflag, depth + 1, printflag) == -1)
1539 ret = -1; 1522 ret = -1;
1540 } else if (S_ISREG(dirent_to_mode(dp))) { 1523 } else if (S_ISREG(DTTOIF(dp->d_type)) ) {
1541 if (do_upload(conn, new_src, new_dst, pflag) == -1) { 1524 if (do_upload(conn, new_src, new_dst, pflag) == -1) {
1542 error("Uploading of file %s to %s failed!", 1525 error("Uploading of file %s to %s failed!",
1543 new_src, new_dst); 1526 new_src, new_dst);