]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh: Improve fix for missing SSH_S_ stat macros
authorJay Satiro <raysatiro@yahoo.com>
Sat, 12 Mar 2022 23:48:18 +0000 (18:48 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Mon, 14 Mar 2022 07:31:20 +0000 (03:31 -0400)
- If building libcurl against an old libssh version missing SSH_S_IFMT
  and SSH_S_IFLNK then use the values from a supported version.

Prior to this change if libssh did not define SSH_S_IFMT and SSH_S_IFLNK
then S_IFMT and S_IFLNK, respectively, were used instead. The problem
with that is the user's S_ stat macros don't have the same values across
platforms. For example Windows has values different from Linux.

Follow-up to 7b0fd39.

Ref: https://github.com/curl/curl/pull/8511#discussion_r815292391
Ref: https://github.com/curl/curl/pull/8574

Closes https://github.com/curl/curl/pull/8588

lib/vssh/libssh.c

index 0d265a0d3ab797a3e4fd4354ba8b5224bc7fbaac..957b938fc881b767c4e7abbafd80b086e19b7cbf 100644 (file)
   } while(0)
 #endif
 
+/* These stat values may not be the same as the user's S_IFMT / S_IFLNK */
 #ifndef SSH_S_IFMT
-#define SSH_S_IFMT S_IFMT
+#define SSH_S_IFMT   00170000
 #endif
 #ifndef SSH_S_IFLNK
-#define SSH_S_IFLNK S_IFLNK
+#define SSH_S_IFLNK  0120000
 #endif
 
 /* Local functions: */