]> andersk Git - openssh.git/blobdiff - sftp-client.c
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / sftp-client.c
index b49e81b9179ef0a89f47a2ec6936754b0f558470..6124c0f408cc2ed731786a28b3bdcb47b069a4b1 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.89 2009/08/18 18:36:20 djm Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.90 2009/10/11 10:41:26 dtucker Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *
@@ -37,9 +37,6 @@
 #include <sys/uio.h>
 
 #include <dirent.h>
-#ifdef DTTOIF_IN_FS_FFS_DIR_H
-# include <fs/ffs/dir.h>
-#endif
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
@@ -1515,7 +1512,11 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
                new_dst = path_append(dst, filename);
                new_src = path_append(src, filename);
 
-               if (S_ISDIR(DTTOIF(dp->d_type))) {
+               if (lstat(new_src, &sb) == -1) {
+                       logit("%s: lstat failed: %s", filename,
+                           strerror(errno));
+                       ret = -1;
+               } else if (S_ISDIR(sb.st_mode)) {
                        if (strcmp(filename, ".") == 0 ||
                            strcmp(filename, "..") == 0)
                                continue;
@@ -1523,7 +1524,7 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
                        if (upload_dir_internal(conn, new_src, new_dst,
                            pflag, depth + 1, printflag) == -1)
                                ret = -1;
-               } else if (S_ISREG(DTTOIF(dp->d_type)) ) {
+               } else if (S_ISREG(sb.st_mode)) {
                        if (do_upload(conn, new_src, new_dst, pflag) == -1) {
                                error("Uploading of file %s to %s failed!",
                                    new_src, new_dst);
This page took 0.044701 seconds and 4 git commands to generate.