aboutsummaryrefslogtreecommitdiff
path: root/lib/smb.c
AgeCommit message (Collapse)Author
2018-09-01all: s/int/size_t cleanupDaniel Stenberg
Assisted-by: Rikard Falkeborn Closes #2922
2018-08-18upload: allocate upload buffer on-demandDaniel Stenberg
Saves 16KB on the easy handle for operations that don't need that buffer. Part 1 of #2888
2018-08-01smb: don't mark it done in smb_doDaniel Stenberg
Follow-up to 09e401e01bf9. The SMB protocol handler needs to use its doing function too, which requires smb_do() to not mark itself as done... Closes #2822
2018-07-30smb: fix memory leak on early failureDaniel Stenberg
... by making sure connection related data (->share) is stored in the connection and not in the easy handle. Detected by OSS-fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9369 Fixes #2769 Closes #2810
2018-07-20smb_getsock: always wait for write socket tooDaniel Stenberg
... the protocol is doing read/write a lot, so it needs to write often even when downloading. A more proper fix could check for eactly when it wants to write and only ask for it then. Without this fix, an SMB download could easily get stuck when the event-driven API was used. Closes #2768
2018-07-12smb: fix memory-leak in URL parse error pathDaniel Stenberg
Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9369 Closes #2740
2018-05-12smb: reject negative file sizesDaniel Stenberg
Assisted-by: Max Dymond Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8245
2018-02-09get_posix_time: only check for overflows if they can happen!Daniel Stenberg
2018-01-30time: support > year 2038 time stamps for system with 32bit longDaniel Stenberg
... with the introduction of CURLOPT_TIMEVALUE_LARGE and CURLINFO_FILETIME_T. Fixes #2238 Closes #2264
2018-01-16SMB: fix numeric constant suffix and variable typesDaniel Stenberg
1. don't use "ULL" suffix since unsupported in older MSVC 2. use curl_off_t instead of custom long long ifdefs 3. make get_posix_time() not do unaligned data access Fixes #2211 Closes #2240 Reported-by: Chester Liu
2017-11-13SMB: fix uninitialized local variableDaniel Stenberg
Reported-by: Brian Carpenter
2017-07-09smb: rename variable to fix shadowing warningMarcel Raad
GCC 4.6.3 on travis complains: smb.c: In function ‘get_posix_time’: smb.c:725:13: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow] Fix this by renaming the variable.
2017-07-04smb: add support for CURLOPT_FILETIMEGisle Vanem
Bug: https://curl.haxx.se/mail/lib-2017-07/0005.html Closes #1643
2017-07-04smb: fix build for djgpp/MSDOSGisle Vanem
bug: https://curl.haxx.se/mail/lib-2017-07/0005.html
2017-06-30handler: refactor connection checkingMax Dymond
Add a new type of callback to Curl_handler which performs checks on the connection. Alter RTSP so that it uses this callback to do its own check on connection health.
2017-05-01upload: UPLOAD_BUFSIZE is now for the upload bufferDaniel Stenberg
2017-03-29NTLM: check for features with #ifdef instead of #ifMarcel Raad
Feature defines are normally checked with #ifdef instead of #if in the rest of the codebase. Additionally, some compilers warn when a macro is implicitly evaluated to 0 because it is not defined, which was the case here. Ref: https://github.com/curl/curl/pull/1362#discussion_r108605101 Closes https://github.com/curl/curl/pull/1367
2017-02-20smb: use getpid replacement for windows UWP buildsDaniel Stenberg
Source: https://github.com/Microsoft/vcpkg/blob/7676b8780db1e1e591c4fc7eba4f96f73c428cb4/ports/curl/0002_fix_uwp.patch
2017-02-14smb: code indentDaniel Stenberg
2016-11-24Declare endian read functions argument as a const pointer.Patrick Monnerat
This is done for all functions of the form Curl_read[136][624]_[lb]e.
2016-10-09smb: properly check incoming packet boundariesTobias Stoeckmann
Not all reply messages were properly checked for their lengths, which made it possible to access uninitialized memory (but this does not lead to out of boundary accesses). Closes #1052
2016-06-29conn: don't free easy handle data in handler->disconnectDaniel Stenberg
Reported-by: Gou Lingfeng Bug: https://curl.haxx.se/mail/lib-2016-06/0139.html
2016-06-22internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg
2016-02-03URLs: change all http:// URLs to https://Daniel Stenberg
2015-11-21smb.c: Fixed compilation warningsSteve Holme
smb.c:134:3: warning: conversion to 'short unsigned int' from 'int' may alter its value smb.c:146:42: warning: conversion to 'unsigned int' from 'long long unsigned int' may alter its value smb.c:146:65: warning: conversion to 'unsigned int' from 'long long unsigned int' may alter its value
2015-06-17SMB: rangecheck values read off incoming packetDaniel Stenberg
CVE-2015-3237 Detected by Coverity. CID 1299430. Bug: http://curl.haxx.se/docs/adv_20150617B.html
2015-03-24curl_memory: make curl_memory.h the second-last header file loadedDan Fandrich
This header file must be included after all header files except memdebug.h, as it does similar memory function redefinitions and can be similarly affected by conflicting definitions in system or dependent library headers.
2015-03-16free: instead of Curl_safefree()Daniel Stenberg
Since we just started make use of free(NULL) in order to simplify code, this change takes it a step further and: - converts lots of Curl_safefree() calls to good old free() - makes Curl_safefree() not check the pointer before free() The (new) rule of thumb is: if you really want a function call that frees a pointer and then assigns it to NULL, then use Curl_safefree(). But we will prefer just using free() from now on.
2015-01-01smb: Use endian functions for reading NBT and message size valuesSteve Holme
2015-01-01smb.c: Fixed compilation warningsSteve Holme
smb.c:780: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign smb.c:781: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign smb.c:804: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign
2014-12-31smb: Use endian functions for reading length and offset valuesSteve Holme
2014-12-30smb.c: Fixed compilation warningSteve Holme
smb.c:586: warning: conversion to 'short unsigned int' from 'int' may alter its value
2014-12-30smb: Use the connection's upload bufferBill Nagel
Use the connection's upload buffer instead of allocating our own send buffer.
2014-12-29smb: Close the connection after a failed client writeBill Nagel
2014-12-24smb: Use standard naming for setup connection functionSteve Holme
Renamed smb_setup() to smb_setup_connection() to follow more widely used function naming.
2014-12-21smb: use memcpy() instead of strncpy()Daniel Stenberg
... as it never copies the trailing zero anyway and always just the four bytes so let's not mislead anyone into thinking it is actually treated as a string. Coverity CID: 1260214
2014-12-14smb.c: Fixed code analysis warningSteve Holme
smb.c:320: warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Result may not be an expected value
2014-12-14smb: Use HAVE_PROCESS_H for process.h inclusionSteve Holme
Rather than testing against _WIN32 use the preferred HAVE_PROCESS_H pre-processor define when including process.h.
2014-12-14smb: Fixed unnecessary initialisation of struct member variablesSteve Holme
There is no need to set the 'state' and 'result' member variables to SMB_REQUESTING (0) and CURLE_OK (0) after the allocation via calloc() as calloc() initialises the contents to zero.
2014-12-13smb.c: Fixed line longer than 79 columnsSteve Holme
2014-12-13smb: Added state change functions to assist with debuggingSteve Holme
For debugging purposes, and as per other protocols within curl, added state change functions rather than changing the states directly.
2014-12-12smb: Disable SMB when 64-bit integers are not supportedSteve Holme
This fixes compilation issues with compilers that don't support 64-bit integers through long long or __int64.
2014-12-09smb: fix unused return code warningDaniel Stenberg
2014-12-08SMB: Fix a data size mismatch that broke SMB on big-endian platformsPatrick Monnerat
2014-12-07smb: Fixed Windows autoconf builds following commit eb88d778e7Steve Holme
As Windows based autoconf builds don't yet define USE_WIN32_CRYPTO either explicitly through --enable-win32-cypto or automatically on _WIN32 based platforms, subsequent builds broke with the following error message: "Can't compile NTLM support without a crypto library."
2014-12-07smb: Build with SSPI enabledBill Nagel
Build SMB/CIFS protocol support when SSPI is enabled.
2014-12-06smb: Fixed a problem with large file transfersSteve Holme
Fixed an issue with the message size calculation where the raw bytes from the buffer were interpreted as signed values rather than unsigned values. Reported-by: Gisle Vanem Assisted-by: Bill Nagel
2014-12-06smb: Moved the URL decoding into a separate functionSteve Holme
2014-12-06smb: Fixed URL encoded URLs not workingSteve Holme
2014-12-05SMB: Fix big endian problems. Make it OS/400 aware.Patrick Monnerat