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

7834 Commits

Author SHA1 Message Date
Steve Holme
ef5b98742f sasl_sspi: Don't use hard coded sizes in Kerberos V5 security data
Don't use a hard coded size of 4 for the security layer and buffer size
in Curl_sasl_create_gssapi_security_message(), instead, use sizeof() as
we have done in the sasl_gssapi module.
2014-12-05 00:22:34 +00:00
Steve Holme
697592b3dd sasl_sspi: Free the Kerberos V5 challenge as soon as we're done with it
Reduced the amount of free's required for the decoded challenge message
in Curl_sasl_create_gssapi_security_message() as a result of coding it
differently in the sasl_gssapi module.
2014-12-05 00:18:13 +00:00
Steve Holme
ee1d729ce0 gssapi: Corrected typo in comments 2014-12-05 00:10:11 +00:00
Steve Holme
7b29c2803f sasl_gssapi: Added body to Curl_sasl_create_gssapi_security_message() 2014-12-05 00:08:59 +00:00
Stefan Bühler
576ac00eb3 http_perhapsrewind: don't abort CONNECT requests
...they never have a body
2014-12-04 14:46:31 -08:00
Stefan Bühler
87c4abb611 HTTP: Free (proxy)userpwd for NTLM/Negotiate after sending a request
Sending NTLM/Negotiate header again after successful authentication
breaks the connection with certain Proxies and request types (POST to MS
Forefront).
2014-12-04 14:46:13 -08:00
Stefan Bühler
5dc68dd609 HTTP: don't abort connections with pending Negotiate authentication
... similarly to how NTLM works as Negotiate is in fact often NTLM with
another name.
2014-12-04 14:41:48 -08:00
Steve Holme
0b311834eb sasl_gssapi: Fixed missing include from commit d3cca934ee 2014-12-04 22:32:49 +00:00
Steve Holme
d3cca934ee sasl_gssapi: Fixed missing decoding debug failure message 2014-12-04 22:24:24 +00:00
Steve Holme
750203bde4 sasl_gssapi: Fixed honouring of no mutual authentication 2014-12-04 22:05:14 +00:00
Steve Holme
0fcd74b836 sasl_sspi: Added more Kerberos V5 decoding debug failure messages 2014-12-04 21:09:06 +00:00
Anthon Pang
1b3a398ec1 docs: Fix FAILONERROR typos
It returns error for >= 400 HTTP responses.

Bug: https://github.com/bagder/curl/pull/129
2014-12-04 12:14:59 -08:00
Patrick Monnerat
4ce87e33ee OS400: enable Unix sockets. 2014-12-04 15:34:03 +01:00
Daniel Stenberg
9730c9fb70 updateconninfo: clear destination struct before getsockname()
Otherwise we may read uninitialized bytes later in the unix-domain
sockets case.
2014-12-04 02:52:19 +01:00
Peter Wu
970c22f970 libcurl: add UNIX domain sockets support
The ability to do HTTP requests over a UNIX domain socket has been
requested before, in Apr 2008 [0][1] and Sep 2010 [2]. While a
discussion happened, no patch seems to get through. I decided to give it
a go since I need to test a nginx HTTP server which listens on a UNIX
domain socket.

One patch [3] seems to make it possible to use the
CURLOPT_OPENSOCKETFUNCTION function to gain a UNIX domain socket.
Another person wrote a Go program which can do HTTP over a UNIX socket
for Docker[4] which uses a special URL scheme (though the name contains
cURL, it has no relation to the cURL library).

This patch considers support for UNIX domain sockets at the same level
as HTTP proxies / IPv6, it acts as an intermediate socket provider and
not as a separate protocol. Since this feature affects network
operations, a new feature flag was added ("unix-sockets") with a
corresponding CURL_VERSION_UNIX_SOCKETS macro.

A new CURLOPT_UNIX_SOCKET_PATH option is added and documented. This
option enables UNIX domain sockets support for all requests on the
handle (replacing IP sockets and skipping proxies).

A new configure option (--enable-unix-sockets) and CMake option
(ENABLE_UNIX_SOCKETS) can disable this optional feature. Note that I
deliberately did not mark this feature as advanced, this is a
feature/component that should easily be available.

 [0]: http://curl.haxx.se/mail/lib-2008-04/0279.html
 [1]: http://daniel.haxx.se/blog/2008/04/14/http-over-unix-domain-sockets/
 [2]: http://sourceforge.net/p/curl/feature-requests/53/
 [3]: http://curl.haxx.se/mail/lib-2008-04/0361.html
 [4]: https://github.com/Soulou/curl-unix-socket

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:19 +01:00
Steve Holme
fa437e14a4 sasl_gssapi: Added body to Curl_sasl_create_gssapi_user_message() 2014-12-03 19:58:59 +00:00
Steve Holme
61e71a8bc8 sasl_gssapi: Added body to Curl_sasl_gssapi_cleanup() 2014-12-03 18:59:08 +00:00
Steve Holme
71dd581127 sasl_gssapi: Added Curl_sasl_build_gssapi_spn() function
Added helper function for returning a GSS-API compatible SPN.
2014-12-03 18:36:48 +00:00
Daniel Stenberg
26b57832fe NSS: enable the CAPATH option
Bug: http://curl.haxx.se/bug/view.cgi?id=1457
Patch-by: Tomasz Kojm
2014-12-03 06:21:29 -08:00
Steve Holme
884df3a51f sasl_gssapi: Enable USE_KERBEROS5 for GSS-API based builds 2014-12-03 13:16:17 +00:00
Steve Holme
86b889485d sasl_gssapi: Added GSS-API based Kerberos V5 variables 2014-12-03 07:47:05 +00:00
Steve Holme
2b604eada5 sasl_gssapi: Made log_gss_error() a common GSS-API function
Made log_gss_error() a common function so that it can be used in both
the http_negotiate code as well as the curl_sasl_gssapi code.
2014-12-02 22:27:02 +00:00
Steve Holme
018b9d421a sasl_gssapi: Introduced GSS-API based SASL module
Added the initial version of curl_sasl_gssapi.c and updated the project
files in preparation for adding GSS-API based Kerberos V5 support.
2014-12-02 21:57:45 +00:00
Steve Holme
f9b7132175 smb: Don't try to connect with empty credentials
On some platforms curl would crash if no credentials were used. As such
added detection of such a use case to prevent this from happening.

Reported-by: Gisle Vanem
2014-12-02 21:04:23 +00:00
Steve Holme
bbccbfe9d1 smb.c: Coding policing of pointer usage 2014-12-02 20:50:49 +00:00
Guenter Knauf
228f1ee9f2 build: in Makefile.m32 simplified autodetection. 2014-12-01 16:39:56 +01:00
Peter Wu
aba5888f6b lib/connect: restrict IP/TCP options to said sockets
This patch prepares for adding UNIX domain sockets support.

TCP_NODELAY and TCP_KEEPALIVE are specific to TCP/IP sockets, so do not
apply these to other socket types. bindlocal only works for IP sockets
(independent of TCP/UDP), so filter that out too for other types.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-30 23:21:14 +01:00
Daniel Stenberg
397a634ebd smb.c: use size_t as input argument types for msg sizes
This fixes warnings about conversions to int
2014-11-30 23:12:24 +01:00
Steve Holme
6b8e5c0e8a smb.c: Fixed compilation warnings
smb.c:398: warning: comparison of integers of different signs:
           'ssize_t' (aka 'long') and 'unsigned long'
smb.c:443: warning: comparison of integers of different signs:
           'ssize_t' (aka 'long') and 'unsigned long'
2014-11-30 21:20:19 +00:00
Steve Holme
ce2d84b3bb libcurl: Exclude SMB from the protocol redirect
As local files could be accessed through \\localhost\c$.
2014-11-30 20:42:05 +00:00
Bill Nagel
6f2419342f libcurl: Enable support for the SMB protocol
This patch enables SMB/CIFS support in libcurl.
2014-11-30 20:25:28 +00:00
Steve Holme
d95cb3edc8 smb.c: Fixed compilation warnings
smb.c:322: warning: conversion to 'short unsigned int' from 'unsigned
           int' may alter its value
smb.c:323: warning: conversion to 'short unsigned int' from 'unsigned
           int' may alter its value
smb.c:482: warning: conversion to 'short unsigned int' from 'int' may
           alter its value
smb.c:521: warning: conversion to 'unsigned int' from 'curl_off_t' may
           alter its value
smb.c:549: warning: conversion to 'unsigned int' from 'curl_off_t' may
           alter its value
smb.c:550: warning: conversion to 'short unsigned int' from 'int' may
           alter its value
2014-11-30 20:17:53 +00:00
Steve Holme
99c2bad222 smb.c: Renamed SMB command message variables to avoid compiler warnings
smb.c:489: warning: declaration of 'close' shadows a global declaration
smb.c:511: warning: declaration of 'read' shadows a global declaration
smb.c:528: warning: declaration of 'write' shadows a global declaration
2014-11-30 18:59:41 +00:00
Steve Holme
069f63c893 smb.c: Fixed compilation warnings
smb.c:212: warning: unused parameter 'done'
smb.c:380: warning: ISO C does not allow extra ';' outside of a function
smb.c:812: warning: unused parameter 'premature'
smb.c:822: warning: unused parameter 'dead'
2014-11-30 18:33:37 +00:00
Steve Holme
676f79f8d2 smb.c: Fixed compilation warnings
smb.c:311: warning: conversion from 'unsigned __int64' to 'u_short',
           possible loss of data
smb.c:425: warning: conversion from '__int64' to 'unsigned short',
           possible loss of data
smb.c:452: warning: conversion from '__int64' to 'unsigned short',
           possible loss of data
2014-11-30 18:11:12 +00:00
Steve Holme
cef28131f7 smb.c: Fixed compilation warnings
smb.c:162: error: comma at end of enumerator list
smb.c:469: warning: conversion from 'size_t' to 'unsigned short',
           possible loss of data
smb.c:517: warning: conversion from 'curl_off_t' to 'unsigned int',
           possible loss of data
smb.c:545: warning: conversion from 'curl_off_t' to 'unsigned int',
           possible loss of data
2014-11-30 18:08:01 +00:00
Bill Nagel
02d2c0a08d smb: Added initial SMB functionality
Initial implementation of the SMB/CIFS protocol.
2014-11-30 18:01:15 +00:00
Bill Nagel
aec2e865f0 smb: Added SMB handler interfaces
Added the SMB and SMBS handler interface structures and associated
functions required for SMB/CIFS operation.
2014-11-30 15:56:30 +00:00
Steve Holme
56120ca04b transfer: Code style policing
Prefer ! rather than NULL in if statements, added comments and updated
function spacing, argument spacing and line spacing to be more readble.
2014-11-30 15:06:16 +00:00
Steve Holme
785d76d681 transfer: Fixed existing scratch buffer being checked for NULL twice
If the scratch buffer already existed when the CRLF conversion was
performed then the buffer pointer would be checked twice for NULL. This
second check is only necessary if the call to malloc() was performed by
the first check.
2014-11-30 15:06:13 +00:00
Steve Holme
9afd97022e smtp: Fixed dot stuffing being performed when no new data read
Whilst I had moved the dot stuffing code from being performed before
CRLF conversion takes place to after it, in commit 4bd860a001, I had
moved it outside the 'when something read' block of code when meant
it could perform the dot stuffing twice on partial send if nread
happened to contain the right values. It also meant the function could
potentially read past the end of buffer. This was highlighted by the
following warning:

warning: `nread' might be used uninitialized in this function
2014-11-30 14:24:35 +00:00
Daniel Stenberg
5409f32984 smb.h: fixed picky compiler warning
smb.h:30:16: error: comma at end of enumerator list [-Werror=pedantic]
2014-11-29 23:06:04 +01:00
Bill Nagel
557658776f smb: Added SMB protocol and port definitions
Added the necessary protocol and port definitions in order to support
SMB/CIFS.
2014-11-29 21:26:40 +00:00
Bill Nagel
0627c48dde smb: Added internal SMB definitions and structures
Added the internal definitions and structures necessary for SMB/CIFS
support.
2014-11-29 20:32:34 +00:00
Bill Nagel
7c00ba10da smb: Added SMB connection structure
Added the connection structure that will be required in urldata.h for
SMB/CIFS based connections.
2014-11-29 20:16:51 +00:00
Bill Nagel
e80d9d5902 smb: Added initial source files for SMB
Added the initial source files and updated the relevant project files in
order to support SMB/CIFS.
2014-11-29 18:10:41 +00:00
Steve Holme
93e080cbaa http.c: Fixed compilation warnings from features being disabled
warning: unused variable 'data'
warning: variable 'addcookies' set but not used

...and some very minor coding style policing.
2014-11-27 22:29:31 +00:00
Steve Holme
854049f962 smtp: Fixed const'ness of nread parameter in Curl_smtp_escape_eob()
...and some comment typos!
2014-11-26 23:31:57 +00:00
Steve Holme
4bd860a001 smtp: Added support for the conversion of Unix newlines during mail send
Added support for the automatic conversion of Unix newlines to CRLF
during mail uploads.

Feature: http://curl.haxx.se/bug/view.cgi?id=1456
2014-11-26 23:31:54 +00:00
Daniel Stenberg
700843d69f select.c: fix compilation for VxWorks
Reported-by: Brian
Bug: http://curl.haxx.se/bug/view.cgi?id=1455
2014-11-25 08:55:17 +01:00