mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 16:24:39 +02:00
- (dtucker) [configure.ac sftp-client.c] Remove the gyrations required for
dirent d_type and DTTOIF as we've switched OpenBSD to the more portable lstat.
This commit is contained in:
parent
538738d861
commit
c182d99376
@ -1,3 +1,8 @@
|
|||||||
|
20091011
|
||||||
|
- (dtucker) [configure.ac sftp-client.c] Remove the gyrations required for
|
||||||
|
dirent d_type and DTTOIF as we've switched OpenBSD to the more portable
|
||||||
|
lstat.
|
||||||
|
|
||||||
20091007
|
20091007
|
||||||
- (dtucker) OpenBSD CVS Sync
|
- (dtucker) OpenBSD CVS Sync
|
||||||
- djm@cvs.openbsd.org 2009/08/12 00:13:00
|
- djm@cvs.openbsd.org 2009/08/12 00:13:00
|
||||||
|
13
configure.ac
13
configure.ac
@ -1,4 +1,4 @@
|
|||||||
# $Id: configure.ac,v 1.429 2009/10/07 07:56:10 dtucker Exp $
|
# $Id: configure.ac,v 1.430 2009/10/11 10:50:20 dtucker Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 1999-2004 Damien Miller
|
# Copyright (c) 1999-2004 Damien Miller
|
||||||
#
|
#
|
||||||
@ -15,7 +15,7 @@
|
|||||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
|
AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
|
||||||
AC_REVISION($Revision: 1.429 $)
|
AC_REVISION($Revision: 1.430 $)
|
||||||
AC_CONFIG_SRCDIR([ssh.c])
|
AC_CONFIG_SRCDIR([ssh.c])
|
||||||
|
|
||||||
AC_CONFIG_HEADER(config.h)
|
AC_CONFIG_HEADER(config.h)
|
||||||
@ -1130,15 +1130,6 @@ int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_CHECK_DECL(DTTOIF,
|
|
||||||
AC_DEFINE(DTTOIF_IN_FS_FFS_DIR_H, 1 , [DTTOIF macro in fs/ffs/dir.h]), ,
|
|
||||||
[
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <fs/ffs/dir.h>
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_CHECK_MEMBERS([struct dirent.d_type],,, [#include <dirent.h>])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for /proc/pid/fd directory])
|
AC_MSG_CHECKING([for /proc/pid/fd directory])
|
||||||
if test -d "/proc/$$/fd" ; then
|
if test -d "/proc/$$/fd" ; then
|
||||||
AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd])
|
AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd])
|
||||||
|
@ -37,9 +37,6 @@
|
|||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#ifdef DTTOIF_IN_FS_FFS_DIR_H
|
|
||||||
# include <fs/ffs/dir.h>
|
|
||||||
#endif
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -1454,20 +1451,6 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static mode_t
|
|
||||||
dirent_to_mode(struct dirent *dp)
|
|
||||||
{
|
|
||||||
#if defined(HAVE_STRUCT_DIRENT_D_TYPE) && defined(DTTOIF)
|
|
||||||
return DTTOIF(dp->d_type);
|
|
||||||
#else
|
|
||||||
struct stat sb;
|
|
||||||
|
|
||||||
if (stat(dp->d_name, &sb) == -1)
|
|
||||||
return 0;
|
|
||||||
return sb.st_mode;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
|
upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
|
||||||
int pflag, int printflag, int depth)
|
int pflag, int printflag, int depth)
|
||||||
@ -1529,7 +1512,7 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
|
|||||||
new_dst = path_append(dst, filename);
|
new_dst = path_append(dst, filename);
|
||||||
new_src = path_append(src, filename);
|
new_src = path_append(src, filename);
|
||||||
|
|
||||||
if (S_ISDIR(dirent_to_mode(dp))) {
|
if (S_ISDIR(DTTOIF(dp->d_type))) {
|
||||||
if (strcmp(filename, ".") == 0 ||
|
if (strcmp(filename, ".") == 0 ||
|
||||||
strcmp(filename, "..") == 0)
|
strcmp(filename, "..") == 0)
|
||||||
continue;
|
continue;
|
||||||
@ -1537,7 +1520,7 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
|
|||||||
if (upload_dir_internal(conn, new_src, new_dst,
|
if (upload_dir_internal(conn, new_src, new_dst,
|
||||||
pflag, depth + 1, printflag) == -1)
|
pflag, depth + 1, printflag) == -1)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else if (S_ISREG(dirent_to_mode(dp))) {
|
} else if (S_ISREG(DTTOIF(dp->d_type)) ) {
|
||||||
if (do_upload(conn, new_src, new_dst, pflag) == -1) {
|
if (do_upload(conn, new_src, new_dst, pflag) == -1) {
|
||||||
error("Uploading of file %s to %s failed!",
|
error("Uploading of file %s to %s failed!",
|
||||||
new_src, new_dst);
|
new_src, new_dst);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user