Yang Tse [Tue, 23 Nov 2010 20:38:20 +0000 (21:38 +0100)]
Curl_getaddrinfo_ex: sanitize function results.
Ensure that spurious results from system's getaddrinfo() ares not propagated
by Curl_getaddrinfo_ex() into the library.
Also ensure that the ai_addrlen member of Curl_getaddrinfo_ex()'s output linked
list of Curl_addrinfo structures has appropriate family-specific address size.
Matthias Bolte [Fri, 19 Nov 2010 21:31:34 +0000 (13:31 -0800)]
Detect socket errors in GnuTLS on Windows
On Windows, translate WSAGetLastError() to errno values as GNU
TLS does it internally, too. This is necessary because send() and
recv() on Windows don't set errno when they fail but GNU TLS
expects a proper errno value.
Yang Tse [Thu, 18 Nov 2010 16:12:15 +0000 (17:12 +0100)]
configure: use autobuilds to temporarily verify strict aliasing warnings.
Temporarily, When cross-compiling with gcc 3.0 or later, enable strict aliasing
rules and warnings. Given that cross-compiled targets autobuilds do not run the
Daniel Stenberg [Sun, 14 Nov 2010 11:42:29 +0000 (12:42 +0100)]
gnutls->handshake: improved timeout handling
When no timeout is set, we call the socket_ready function with a timeout
value of 0 during handshake, which makes it loop too much/fast in this
function. It also made this function return CURLE_OPERATION_TIMEDOUT
wrongly on a slow handshake.
However, the particular bug report that highlighted this problem is not
solved by this fix, as this fix only makes the more proper error get
reported instead.
Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594150
Reported by: Johannes Ernst
Julien Chaffraix [Sat, 13 Nov 2010 20:01:33 +0000 (12:01 -0800)]
security: tighten enum protection_level usage.
While changing Curl_sec_read_msg to accept an enum protection_level
instead of an int, I went ahead and fixed the usage of the associated
fields.
Some code was assuming that prot_clear == 0. Fixed those to use the
proper value. Added assertions prior to any code that would set the
protection level.
Daniel Stenberg [Fri, 12 Nov 2010 22:26:57 +0000 (23:26 +0100)]
version-check.pl: display version number for symbols
This script is the start of a helper tool that scans a source code and
outputs the most recent libcurl version it finds symbols for. Meaning
that if there's no conditions in the code, that's the earliest libcurl
version the scanned code requires.
It is not added to the Makefile.am yet as it is still a bit crude, but
I'm committing it to keep it and allow us to work on it.
Julien Chaffraix [Fri, 12 Nov 2010 16:20:50 +0000 (08:20 -0800)]
krb5: Use GSS_ERROR to check for error.
This is the advised way of checking for errors in the GSS-API RFC.
Also added some '\n' to the error message so that they are not mixed
with other outputs.
Daniel Stenberg [Thu, 11 Nov 2010 15:41:59 +0000 (16:41 +0100)]
HTTP Auth: Add CURLAUTH_ONLY
This is a meta symbol. OR this value together with a single specific
auth value to force libcurl to probe for un-restricted auth and if not,
only that single auth algorithm is acceptable.
For example you can use CURLAUTH_DIGEST|CURLAUTH_ONLY to make libcurl
first probe for what method to use, but yet only consider Digest to be
acceptable.
Using _only_ CURLAUTH_DIGEST without the CURLAUTH_ONLY field, will make
libcurl explicitly use Digest right away and not do any probing.
Daniel Stenberg [Thu, 11 Nov 2010 13:51:39 +0000 (14:51 +0100)]
ip_version: moved to connection struct
The IP version choice was previously only in the UserDefined struct
within the SessionHandle, but since we sometimes alter that option
during a request we need to have it on a per-connection basis.
I also moved more "init conn" code into the allocate_conn() function
which is designed for that purpose more or less.
Stefan Tomanek [Sun, 7 Nov 2010 15:54:49 +0000 (16:54 +0100)]
write extended attributes by using fsetxattr
Instead of reopening the downloaded file, fsetxattr uses the (already
open) file descriptor to attach extended attributes. This makes the
procedure more robust against errors caused by moved or deleted files.
Daniel Stenberg [Fri, 5 Nov 2010 21:31:40 +0000 (22:31 +0100)]
CURLOPT_RESOLVE: added
CURLOPT_RESOLVE is a new option that sends along a curl_slist with
name:port:address sets that will populate the DNS cache with entries so
that request can be "fooled" to use another host than what otherwise
would've been used. Previously we've encouraged the use of Host: for
that when dealing with HTTP, but this new feature has the added bonus
that it allows the name from the URL to be used for TLS SNI and server
certificate name checks as well.
This is a first change. Surely more will follow to make it decent.
Alfred Gebert [Fri, 5 Nov 2010 14:53:41 +0000 (15:53 +0100)]
LDAP: detect non-binary attributes properly
If the query result has a binary attribute, the binary attribute is
base64 encoded. But all following non binary attributes are also base64
encoded which is wrong.
Daniel Stenberg [Fri, 5 Nov 2010 13:07:38 +0000 (14:07 +0100)]
xattr: add configure check and #ifdefs
setxattr is a glibc call to set extended attributes, so configure now
checks for it and the code is adapted to only build when the
functionality is present.
Stefan Tomanek [Fri, 5 Nov 2010 11:39:46 +0000 (12:39 +0100)]
save metadata to extended file attributes
It is often convinient to track back the source of a once downloaded
file; this patch makes curl store the source URL and other metadata
alongside the retrieved file by using the extended attributes (if
supported by the file system and enabled by --xattr).
Daniel Stenberg [Fri, 5 Nov 2010 10:19:21 +0000 (11:19 +0100)]
test: remove test 580
Test 580 is removed again for two reasons:
1) Some compilers aren't satisfied by just a data variable called 'test'
when first.o wants a function called 'test'. The Solaris compiler says
"ld: warning: symbol `test' has differing types:" while the AIX compiler
downright rejects it.
2) Test case 1119 that was added after this test is way more complete
and cover everything test 580 does and more without introducing the same
problems.
Daniel Stenberg [Thu, 4 Nov 2010 14:18:35 +0000 (15:18 +0100)]
certcheck: use the custom Host: name for checks
If you use a custom Host: name in a request to a SSL server, libcurl
will now use that given name when it verifies the server certificate to
be correct rather than using the host name used in the actual URL.
Daniel Stenberg [Thu, 4 Nov 2010 13:58:15 +0000 (14:58 +0100)]
host: get the custom Host: name more genericly
When given a custom host name in a Host: header, we can use it for
several different purposes other than just cookies, so we rename it and
use it for SSL SNI etc.
Daniel Stenberg [Thu, 4 Nov 2010 09:32:38 +0000 (10:32 +0100)]
example: add smtp-multi.c
An example application source code sending SMTP mail with the multi
interface. It is based on the code Alona Rossen provided, which in turn
is based on existing example/test code, and I converted it even more
into a decent example with a fair multi API use, put the info required
to edit at the top and I added some comments.
Daniel Stenberg [Wed, 3 Nov 2010 10:20:19 +0000 (11:20 +0100)]
symbol-scan: verifies symbols-in-versions
This new script scans for all enums and #defines used by the curl/curl.h
and curl/multi.h headers. Then it reads all symbols mentioned in
symbols-in-vesions and make sure that there's no entries missing in
there. It then proceeds to verify that the entries that
symbols-in-vesions mentions but aren't found in the sources are truly
documented as removed.
Daniel Stenberg [Wed, 3 Nov 2010 09:04:23 +0000 (10:04 +0100)]
symbols-in-versions: added 119 missing symbols
I've developed a script I call symbol-scan.pl that scans the curl.h and
multi.h header files and compare the symbols it finds in there with the
symbols symbols-in-versions documents and outputs a report on the
differences. Using this I've dug through the history to fill up
symbols-in-versions with all the symbols my script found mismatches for.
I will commit symbol-scan.pl separatly and think of a way to put it to
use in the build/tests so that we from now on will get this in-sync
check automatically.
Daniel Stenberg [Tue, 2 Nov 2010 21:27:33 +0000 (22:27 +0100)]
test: added test 580 - verifies symbols-in-versions
The new perl script mk580.pl generates a C table in a fresh source file
named lib580.c and if that compiles fine we know that the file
docs/libcurl/symbols-in-versions at least doesn't include any symbols
that are misspelled.
An additional feature would be to somehow scan curl/curl.h and compare
with symbols-in-versions to see if there are symbols missing.
Kamil Dudka [Wed, 27 Oct 2010 08:54:35 +0000 (10:54 +0200)]
ftp: prevent server from hanging on closed data connection
Some FTP servers (e.g. Pure-ftpd) end up hanging if we close the data
connection before transferring all the requested data. If we send ABOR
in that case, it prevents the server from hanging.
Bug: https://bugzilla.redhat.com/643656
Reported by: Pasi Karkkainen, Patrick Monnerat