1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

630 Commits

Author SHA1 Message Date
Yang Tse
e6697ef59c curl tool: fix a bunch of double free's uncovered 2011-09-15
Re-enabling MemoryTracking capability on 'src' subdirectory files and torture
tests have uncovered many issues which were going unnoticed in curl tool. So
here we go fixing some of them. Others still remain and should be addressed
ASAP, given that curl tool is used in our test harness also for test server
start verification purposes. There are even non-socket file descriptor leaks.
2011-09-15 20:03:30 +02:00
Yang Tse
90080da5fe curl tool: re-enable MemoryTracking capability on 'src' subdirectory files.
Use same preprocessor logic for curl tool MemoryTracking activation in source
files located in 'src' subdirectory as the one used for libcurl sources.
2011-09-14 11:30:22 +02:00
Guenter Knauf
443ab77e1f Avoid ftruncate() static define with MinGW64. 2011-09-08 11:17:16 +02:00
Yang Tse
46df51a391 fix bool variables checking and assignment 2011-09-06 01:57:21 +02:00
Yang Tse
a50210710a fix bool variables checking and assignment 2011-09-05 20:46:09 +02:00
Yang Tse
6b75d2c2df fix a bunch of MSVC compiler warnings 2011-09-03 16:07:09 +02:00
Yang Tse
b4f6319cf7 NTLM single-sign on adjustments (XI)
Feature string literal NTLM_SSO renamed to NTLM_WB.
Preprocessor symbol USE_NTLM_SSO renamed to WINBIND_NTLM_AUTH_ENABLED.
curl's 'long' option 'ntlm-sso' renamed to 'ntlm-wb'.
Fix some comments to make clear that this is actually a NTLM delegation.
2011-08-27 01:33:35 +02:00
Yang Tse
407e08baad NTLM single-sign on adjustments (X)
Functions renamed:

Curl_output_ntlm_sso -> Curl_output_ntlm_wb
sso_ntlm_close -> wb_ntlm_close
sso_ntlm_response -> wb_ntlm_response
sso_ntlm_initiate -> wb_ntlm_initiate

Preprocessor symbols renamed:

CURLAUTH_NTLM_SSO -> CURLAUTH_NTLM_WB
CURL_VERSION_NTLM_SSO -> CURL_VERSION_NTLM_WB
2011-08-26 18:57:50 +02:00
Daniel Stenberg
61ae7e9ce7 main: fix segfault
Follow-up to commit 5eb2396cd as that wasn't complete.

At times HEADERFUNCTION+HEADERDATA was set only to have only HEADERDATA
set in the subsequent loop which could cause a NULL to get sent as
userdata to 'header_callback' which wasn't made to handle that.

Now HEADERFUNCTION is explicitly set to NULL if it isn't set to the
callback.
2011-08-21 12:59:06 +02:00
Yang Tse
838dd8f594 MemoryTracking: adjust initialization calling - followup
Fix macro definition
2011-08-21 06:10:52 +02:00
Yang Tse
aaab5fa299 MemoryTracking: adjust initialization calling
Calling of curl_memdebug() was still done with a pending free()
2011-08-20 17:26:42 +02:00
Daniel Stenberg
5538904d77 added --delegation
Using this option with an argument being set to one of
none/policy/always instructs libcurl how to deal with GSS
credentials. Or rather how it tells the server that delegation is fine
or not.
2011-08-12 23:06:12 +02:00
Daniel Stenberg
5eb2396cd1 segfault fixed
When using both -J and a single -O with multiple URLs, a missing init
could cause badness.

Bug: http://curl.haxx.se/mail/lib-2011-07/0126.html and
     http://bugzilla.redhat.com/723075
Reported by: Paul Howarth and Garrett Holmstrom
2011-08-04 23:25:55 +02:00
Daniel Stenberg
8f890470f1 parse_filename: deal with escaped quotes 2011-08-04 23:25:55 +02:00
Daniel Stenberg
519d0c0dd2 -J: support ';' in quoted file names
Content-disposition headers can provide file names with semicolons which
previously would be cut off at that point.

Added test case 1311 and 1312 to verify -J.

Bug: http://curl.haxx.se/bug/view.cgi?id=3375603
Reported by: Peter Hjalmarsson
2011-08-04 17:48:45 +02:00
Yang Tse
f1586cb477 stdio.h, stdlib.h, string.h, stdarg.h and ctype.h inclusion done in setup_once.h 2011-07-26 17:23:27 +02:00
Yang Tse
ef2176109f errno.h inclusion conditionally done in setup_once.h 2011-07-24 04:39:43 +02:00
Mandy Wu
a6d4807d02 NTLM single-sign on supported
With the use of the 'ntlm_auth' tool from the Samba project
2011-07-18 23:36:36 +02:00
Daniel Stenberg
902d3dc33d help output: more gnu like output
First, the -J/--remote-header-name was wrongly sorted in the --help
output as pointed out in bug report #3349271.

Then, I changed the format of the texts to follow the man page better in
that it now uses "-A, --long" intead of "-A/--long". I also made all
additional arguments get written as in "-A, --long FILENAME" instead of
the previous "<filename>" style.

Reported by: Herve Amblard
Bug: http://curl.haxx.se/bug/view.cgi?id=3349271
2011-07-03 22:13:18 +02:00
Yang Tse
2e7a2027f1 main: fix header inclusion order
Currently, Windows cross-compiled autobuilds require inclusion of setup.h
before curl.h to get definitions of CURL_STATICLIB and BUILDING_LIBCURL.
2011-05-29 18:25:49 +02:00
Yang Tse
ae677edf90 main: fix header inclusion order 2011-05-29 03:56:26 +02:00
Daniel Stenberg
aa87f0ab15 checksrc: whitespace and code style cleanup
Make everything adhere to the standards upheld by checksrc.pl and now
run checksrc from the makefile on debug builds.
2011-04-27 09:09:35 +02:00
Fabian Keil
7d86e467fa Fix spelling errors in src/
Found with codespell.
2011-04-21 07:55:53 -07:00
Daniel Stenberg
8e4fb01e64 transfer-encoding: added new option and cmdline
Added CURLOPT_TRANSFER_ENCODING as the option to set to request Transfer
Encoding in HTTP requests (if built zlib enabled). I also renamed
CURLOPT_ENCODING to CURLOPT_ACCEPT_ENCODING (while keeping the old name
around) to reduce the confusion when we have to encoding options for
HTTP.

--tr-encoding is now the new command line option for curl to request
this, and thus I updated the test cases accordingly.
2011-04-18 19:46:21 +02:00
Dan Fandrich
a9aeedcdbe Force setopt constants written by --libcurl to be long 2011-03-09 14:02:42 -08:00
Julien Chaffraix
06fc3569d2 curl: Added --netrc-file.
This enables people to specify a path to the netrc file to use.
The new option override --netrc if both are present. However it
does follow --netrc-optional if specified.
2011-02-20 21:11:52 -08:00
Daniel Stenberg
3bb1291fbd --keepalive-time: warn if not supported properly
Since the feature requires support for TCP_KEEPIDLE and TCP_KEEPINTVL to
function as documented, it now warns if that support is missing when the
option is used.
2011-02-10 22:24:15 +01:00
Daniel Stenberg
b77a3b9a35 main: make the tlsauth options always present
... to not make the connection between the tool and the libcurl used
tighter than necessary, the tlsauth options are now always present but
if the used libcurl doesn't have TLSAUTH support it will return failure.

Also, replaced strncmp() with strequal to get case insensitive matching.
2011-01-19 23:14:55 +01:00
Quinn Slack
59cf93ccdb TLS-SRP: support added when using GnuTLS 2011-01-19 20:35:02 +01:00
Daniel Stenberg
9acac91960 getparameter: add error check
if add2list() returns an error, bail out!
2010-12-20 22:22:02 +01:00
Yang Tse
9c4ff4874e fix compiler warning: assignment within conditional expression 2010-12-03 16:53:11 +01:00
Yang Tse
5db0a412ff atoi: remove atoi usage 2010-11-28 23:11:14 +01:00
Stefan Tomanek
f1db21218b 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.
2010-11-10 10:43:05 +01:00
Daniel Stenberg
fc6c4c10f9 help: indent the --xattr option like the others 2010-11-08 11:20:17 +01:00
Daniel Stenberg
1b24b89cca 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.
2010-11-08 08:56:21 +01:00
Daniel Stenberg
517d3eb0a4 --libcurl: simplify output
Removed the code that was needed for libcurl before 7.19.0 which now is
more than two years old.

Simplified the top comment and corrected the URL.
2010-11-05 22:26:54 +01:00
Daniel Stenberg
95719fbea6 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.
2010-11-05 14:07:38 +01:00
Stefan Tomanek
fbf51696ef 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).
2010-11-05 13:59:10 +01:00
Daniel Stenberg
11e131c9f9 options: check for features for some options
Some options, such as the automatic decompression and some SSL related
ones now will bail out if the underlying libcurl doesn't have support
for the particular feature needed.
2010-10-14 22:18:55 +02:00
Daniel Stenberg
81f151c912 header_callback: strip off file path separated with backslashes
If the filename contains a backslash, only use filename portion. The
idea is that even systems that don't handle backslashes as path
separators probably want that path removed for convenience.

This flaw is considered a security problem, see the curl security
vulnerability http://curl.haxx.se/docs/adv_20101013.html
2010-10-12 22:56:21 +02:00
Daniel Stenberg
d8041a7ea5 whitespace: unified source
if ( => if(
while ( => while(

and some other changes in the similar spirit, trying to make the
whole file use the same style
2010-09-16 23:32:24 +02:00
Daniel Stenberg
abde4c9d84 remote-header-name: don't output filename when NULL 2010-09-16 23:27:03 +02:00
Dan Fandrich
6882ae8dee Use checkprefix() to compare protocol-specific strings
Otherwise, there could be problems running in certain locales.
2010-09-02 21:12:14 -07:00
Cameron Kaiser
201637d468 Gopher protocol support (initial release) 2010-08-25 14:19:58 +02:00
Dan Fandrich
77ba147e76 Fixed a NULL pointer dereference in form posting
It was introduced in commit eeb2cb05 along with the -F type=
change. Also fixed a typo in the name of the magic filename=
parameter. Tweaked tests 39 and 173 to better test this path.
2010-08-24 16:45:31 -07:00
Daniel Stenberg
eeb2cb05a1 cmdline: make -F type= accept ;charset=
The -F option allows some custom parameters within the given string, and
those strings are separated with semicolons. You can for example specify
"name=daniel;type=text/plain" to set content-type for the
field. However, the use of semicolons like that made it not work fine if
you specified one within the content-type, like for:
"name=daniel;type=text/plain;charset=UTF-8"
... as the second one would be seen as a separator and "charset" is no
parameter curl knows anything about so it was just silently discarded.

The new logic now checks if the semicolon and following keyword looks
like a parameter it knows about and if it isn't it is assumed to be
meant to be used within the content-type string itself.

I modified test case 186 to verify that this works as intended.

Reported by: Larry Stone
Bug: http://curl.haxx.se/bug/view.cgi?id=3048988
2010-08-21 00:21:24 +02:00
Dan Fandrich
dc4adc484f Use the S_ISREG macro to determine what is a regular file 2010-08-19 11:49:01 -07:00
Kamil Dudka
5907777153 curl -T: ignore file size of special files
original bug report at https://bugzilla.redhat.com/622520
2010-08-15 11:26:13 +02:00
Daniel Stenberg
f38e52071e retry: consider retrying even if -f is used
The --retry logic does retry HTTP when some specific response codes are
returned, but because the -f option sets the CURLOPT_FAILONERROR to
libcurl, the return codes are different for such situations and then the
curl tool failed to consider it for retrying.

Reported by: Mike Power
Bug: http://curl.haxx.se/bug/view.cgi?id=3037362
2010-08-02 00:10:18 +02:00
Jeff Pohlmeyer
d76874a665 remote-header-name: chop filename at next semicolon
The --remote-header-name option for the command-line tool assumes that
everything beyond the filename= field is part of the filename, but that
might not always be the case, for example:

Content-Disposition: attachment; filename=file.txt; modification-date=...

This fix chops the filename off at the next semicolon, if there is one.
2010-07-17 20:12:47 +02:00