diff options
author | Patrick Monnerat <patrick@monnerat.net> | 2022-09-28 18:12:15 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-09-29 10:51:04 +0200 |
commit | 2437fac01387e2653b8fae785335dc2744bab75a (patch) | |
tree | 76fff79cdfb4599831aac26c2bbf390529137cc4 /lib/mime.c | |
parent | 75670e457367515dc88cf43f7a4b9ddb9c5ab59e (diff) | |
download | curl-2437fac01387e2653b8fae785335dc2744bab75a.tar.gz |
lib: sanitize conditional exclusion around MIME
The introduction of CURL_DISABLE_MIME came with some additional bugs:
- Disabled MIME is compiled-in anyway if SMTP and/or IMAP is enabled.
- CURLOPT_MIMEPOST, CURLOPT_MIME_OPTIONS and CURLOPT_HTTPHEADER are
conditioned on HTTP, although also needed for SMTP and IMAP MIME mail
uploads.
In addition, the CURLOPT_HTTPHEADER and --header documentation does not
mention their use for MIME mail.
This commit fixes the problems above.
Closes #9610
Diffstat (limited to 'lib/mime.c')
-rw-r--r-- | lib/mime.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/mime.c b/lib/mime.c index 11e614dc3..042141fc8 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -31,8 +31,9 @@ #include "urldata.h" #include "sendf.h" -#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_MIME)) || \ - !defined(CURL_DISABLE_SMTP) || !defined(CURL_DISABLE_IMAP) +#if !defined(CURL_DISABLE_MIME) && (!defined(CURL_DISABLE_HTTP) || \ + !defined(CURL_DISABLE_SMTP) || \ + !defined(CURL_DISABLE_IMAP)) #if defined(HAVE_LIBGEN_H) && defined(HAVE_BASENAME) #include <libgen.h> @@ -1924,8 +1925,8 @@ void Curl_mime_unpause(curl_mimepart *part) } -#else /* !CURL_DISABLE_HTTP && !CURL_DISABLE_MIME || - !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP */ +#else /* !CURL_DISABLE_MIME && (!CURL_DISABLE_HTTP || + !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP) */ /* Mime not compiled in: define stubs for externally-referenced functions. */ curl_mime *curl_mime_init(CURL *easy) |