Aanok / jftui

Jellyfin Terminal User Interface
The Unlicense
142 stars 7 forks source link

Warning: the libcurl version jftui was compiled against will defer URL validation to the first network request #36

Closed c4em closed 1 year ago

c4em commented 1 year ago

https://github.com/Aanok/jftui/blob/38762b78b4329fc519068b9561b5dada0ab743ae/src/net.c#L800 It seems like the preprocessor incorrectly determines the minor and major version of libcurl. I've throughway verified that the libcurl version is not 7.>=62 but rather 8.0.1

curl 8.0.1 (x86_64-pc-linux-gnu) libcurl/8.0.1 OpenSSL/3.0.8 zlib/1.2.13 c-ares/1.19.0 nghttp2/1.52.0
Release-Date: 2023-03-20
Protocols: dict file ftp ftps http https imap imaps mqtt pop3 pop3s rtsp smtp smtps tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM SSL threadsafe TLS-SRP UnixSockets

Appending the following:

fprintf(stderr, "LIBCURL_VERSION_MAJOR: %d\nLIBCURL_VERSION_MINOR: %d\n", LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR);

to line 818 results in the following output:

LIBCURL_VERSION_MAJOR: 8
LIBCURL_VERSION_MINOR: 0

The version inside /usr/include/curl/curlver.h also seems correct

/* This is the version number of the libcurl package from which this header
   file origins: */
#define LIBCURL_VERSION "8.0.1"

/* The numeric version number is also available "in parts" by using these
   defines: */
#define LIBCURL_VERSION_MAJOR 8
#define LIBCURL_VERSION_MINOR 0
#define LIBCURL_VERSION_PATCH 1

Don't think this could be the cause but these are the use flags for my local installation of libcurl, just in case:

[ebuild   R    ] net-misc/curl-8.0.1::gentoo  USE="adns ftp http2 imap openssl pop3 progress-meter smtp ssl tftp -alt-svc -brotli -gnutls -gopher -hsts -idn -kerberos -ldap -mbedtls (-nghttp3) -nss -rtmp -rustls -samba -ssh -sslv3 -static-libs -telnet -test -verify-sig -websockets -zstd" ABI_X86="32 (64) (-x32)" CURL_SSL="openssl -gnutls -mbedtls -nss -rustls"

This seems quite fishy.

Aanok commented 1 year ago

Ah, that's because the major is 8 and not 7, so the preprocessor falls into the else branch. With an abundance of paranoia, I wrote that test against a future major release potentially breaking this specific behaviour (same goes for line 831 and probably a bunch of other places. I should really check all over). Now that we know that's not the case, I'll make it accept major version 8 too.

Thanks!