diff options
Diffstat (limited to 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sftp-client.c b/sftp-client.c index cc4a5b15b..6124c0f40 100644 --- a/sftp-client.c +++ b/sftp-client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp-client.c,v 1.89 2009/08/18 18:36:20 djm Exp $ */ | 1 | /* $OpenBSD: sftp-client.c,v 1.90 2009/10/11 10:41:26 dtucker 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 | * |
@@ -1512,7 +1512,11 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst, | |||
1512 | new_dst = path_append(dst, filename); | 1512 | new_dst = path_append(dst, filename); |
1513 | new_src = path_append(src, filename); | 1513 | new_src = path_append(src, filename); |
1514 | 1514 | ||
1515 | if (S_ISDIR(DTTOIF(dp->d_type))) { | 1515 | if (lstat(new_src, &sb) == -1) { |
1516 | logit("%s: lstat failed: %s", filename, | ||
1517 | strerror(errno)); | ||
1518 | ret = -1; | ||
1519 | } else if (S_ISDIR(sb.st_mode)) { | ||
1516 | if (strcmp(filename, ".") == 0 || | 1520 | if (strcmp(filename, ".") == 0 || |
1517 | strcmp(filename, "..") == 0) | 1521 | strcmp(filename, "..") == 0) |
1518 | continue; | 1522 | continue; |
@@ -1520,7 +1524,7 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst, | |||
1520 | if (upload_dir_internal(conn, new_src, new_dst, | 1524 | if (upload_dir_internal(conn, new_src, new_dst, |
1521 | pflag, depth + 1, printflag) == -1) | 1525 | pflag, depth + 1, printflag) == -1) |
1522 | ret = -1; | 1526 | ret = -1; |
1523 | } else if (S_ISREG(DTTOIF(dp->d_type)) ) { | 1527 | } else if (S_ISREG(sb.st_mode)) { |
1524 | if (do_upload(conn, new_src, new_dst, pflag) == -1) { | 1528 | if (do_upload(conn, new_src, new_dst, pflag) == -1) { |
1525 | error("Uploading of file %s to %s failed!", | 1529 | error("Uploading of file %s to %s failed!", |
1526 | new_src, new_dst); | 1530 | new_src, new_dst); |