2
0
mirror of https://github.com/curl/curl.git synced 2025-04-12 16:20:35 +08:00

libssh: fix include files and defines use for Windows builds

Reported-by: 梦终无痕
Bug: https://curl.se/mail/lib-2022-02/0131.html
Closes 
This commit is contained in:
Daniel Stenberg 2022-02-25 13:30:16 +01:00
parent f066a91b29
commit 8a9d93e32b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2017 - 2021 Red Hat, Inc.
* Copyright (C) 2017 - 2022 Red Hat, Inc.
*
* Authors: Nikos Mavrogiannopoulos, Tomas Mraz, Stanislav Zidek,
* Robert Kolcun, Andreas Schneider
@ -32,10 +32,6 @@
#include <libssh/libssh.h>
#include <libssh/sftp.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
@ -81,18 +77,22 @@
#include "multiif.h"
#include "select.h"
#include "warnless.h"
#include "curl_path.h"
/* for permission and open flags */
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
#include "curl_path.h"
/* A recent macro provided by libssh. Or make our own. */
#ifndef SSH_STRING_FREE_CHAR
@ -1468,8 +1468,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block)
memcpy(sshc->readdir_line, sshc->readdir_longentry,
sshc->readdir_currLen);
if((sshc->readdir_attrs->flags & SSH_FILEXFER_ATTR_PERMISSIONS) &&
((sshc->readdir_attrs->permissions & S_IFMT) ==
S_IFLNK)) {
((sshc->readdir_attrs->permissions & SSH_S_IFMT) ==
SSH_S_IFLNK)) {
sshc->readdir_linkPath = aprintf("%s%s", protop->path,
sshc->readdir_filename);