summaryrefslogtreecommitdiff
path: root/source3/libsmb
AgeCommit message (Collapse)AuthorFilesLines
2014-12-08s3-libsmb: Duplicate the memory before we free it.Andreas Schneider1-3/+6
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10279 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit 8c41795c81d85114e383e694ba7421e95bacb912)
2014-12-08s3-libsmb: Set the netbios_name in use_ccache case too.Andreas Schneider1-0/+9
If we do not set the netbios_name we are not able to connect to a Windows DC. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10279 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit 206f25d815024248214f076fd60c35862e9de8a1)
2014-11-09s3: libsmbclient - smb2. MacOSX 10 SMB2 server doesn't set ↵Jeremy Allison1-0/+14
STATUS_NO_MORE_FILES when handed a non-wildcard path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Steve French <smfrench@gmail.com> Tested-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Steve French <sfrench@samba.org> Autobuild-Date(master): Thu Oct 23 20:44:31 CEST 2014 on sn-devel-104 (cherry picked from commit 95bf43bc6a0b6a4a47b8a556eee3b78446ea4123) Bug: https://bugzilla.samba.org/show_bug.cgi?id=10904 smbclient loops doing a directory listing against Mac OS X 10 server with a non-wildcard path.
2014-09-01s3:libsmb: Set a max charge for SMB2 connectionsRoss Lagerwall1-0/+5
Set a max charge for SMB2 connections so that larger request sizes can be used and more requests can be in flight. Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Aug 21 17:31:11 CEST 2014 on sn-devel-104 Bug: https://bugzilla.samba.org/show_bug.cgi?id=10778 libsmbclient with SMB2 doesn't pipeline or use large blocks
2014-09-01Fixed a memory leak in cli_set_mntpoint().Har Gagan Sahai1-2/+4
Fixes bug #10759 - Memory leak in libsmbclient in cli_set_mntpoint function https://bugzilla.samba.org/show_bug.cgi?id=10759 Signed-off-by: Har Gagan Sahai <SHarGagan@novell.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Aug 13 04:36:50 CEST 2014 on sn-devel-104
2014-07-15libsmb: Provide a talloc_stackframe() to external users of libsmb_setget.cAndrew Bartlett1-2/+15
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit bc5bd4010e8fedf19047ed6f7a793cd373f9f14f) The last 3 patches address bug #8449 (simple use case results in "no talloc stackframe around, leaking memory" error).
2014-07-15libsmbclient: Wrap more function calls in talloc_stackframe() to protect ↵Andrew Bartlett1-0/+17
against talloc_tos() calls BUG: https://bugzilla.samba.org/show_bug.cgi?id=8449 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 2 02:36:08 CEST 2014 on sn-devel-104 (cherry picked from commit 014342746f5af1aaaf1c2f8b44098c3a944e4f0a)
2014-06-23Merge tag 'samba-4.1.9' into v4-1-testKarolin Seeger1-2/+2
samba: tag release samba-4.1.9
2014-06-22s3: smbd - fix processing of packets with invalid DOS charset conversions.Jeremy Allison1-2/+2
Bug 10654 - Segmentation fault in smbd_marshall_dir_entry()'s SMB_FIND_FILE_UNIX handler https://bugzilla.samba.org/show_bug.cgi?id=10654 Signed-off-by: Jeremy Allison <jra@samba.org> CVE-2014-3493
2014-06-10s3: libsmbclient: Work around bugs in SLES cifsd and Apple smbx SMB1 servers.Jeremy Allison1-1/+21
SLES's cifsd and Apple's smbx do not correctly handle FILE_NON_DIRECTORY_FILE which prevents recursive copies in gvfs from working correctly [1] since GVFS tries to open the directory, expecting ENOTDIR, but it suceeds and appears as a zero byte file. This fix adds code to the cli_open() open code that checks if CreateOptions was requested with FILE_NON_DIRECTORY_FILE set, and if the attributes returned include FILE_ATTRIBUTE_DIRECTORY we synchronously close the file handle just opened, and return NT_STATUS_FILE_IS_A_DIRECTORY to the caller. Depends on the previous API update to cli_ntcreate() to add returned attributes. Fixes bug #10587 - Opening directories on SLES's cifsd and Apple's smbx succeeds. https://bugzilla.samba.org/show_bug.cgi?id=10587 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit b2ce2441a35ed68c39791168217d159352b5143c)
2014-06-10s3: client : correctly fill in the struct smb_create_returns from ↵Jeremy Allison1-5/+27
cli_ntcreate(), cli_ntcreate_recv(), cli_nttrans_create() and cli_nttrans_create_recv(). This completes the update of the create API to return all the data returned by the server on open. We can now use this data to detect buggy servers without an extra round trip. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 3d8ba9b34e34c1f3e0c1c231d6b772994b45eeaf)
2014-06-10s3: client : Add extra return parameter to all client open calls.Jeremy Allison7-20/+39
Add a return parameter of struct smb_create_returns *cr to cli_ntcreate() cli_ntcreate_recv() cli_nttrans_create() cli_nttrans_create_recv() Always pass in NULL for now. This fixes the create API to always fully return the data the server has given back to us on the open file to the caller. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 69e24b4e8bc607806453ab137efda6d6bf74fb12)
2014-06-10s3: client - rename 'struct smb2_create_returns' to 'struct ↵Jeremy Allison2-3/+3
smb_create_returns' so we can use this in SMB1 create returns as well. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 2900dfa5b928ef237e72ac4e15481e083d61750a)
2014-05-20lib-util: rename memdup to smb_memdup and fix all callers (bug #10556)Björn Baumbach1-2/+2
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit fae7e5d771d1c69bded1189b23335647023fa0f7) Conflicts: ctdb/lib/util/util.h Also renamed memdup() in source3/locking/brlock.c
2014-04-04s3:libsmb: SMBC_getatr() if no method worked, try all methods again on next ↵Gregor Beck1-3/+5
attempt Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> The last 10 patches address bug #10230 - (lib)smbclient fails with NetApp. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10230
2014-04-04s3:libsmb: cli_qpathinfo3 use cli_qpathinfo2 for smb2Gregor Beck1-1/+7
cli_qpathinfo3 only works (and is only needed as fallback so far) for smb1. Use cli_qpathinfo2 in the smb2 case to make it universally usable. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-04s3:libsmb: SMBC_getatr use pathinfo3 for second tryGregor Beck2-0/+14
The pathinfo2 call might fail against NetApp because it is sending broken packages. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-04s3:libsmb: SMBC_getatr do not let ino undefined on successGregor Beck1-0/+3
Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-04s3:libsmb: SMBC_getatr try pathinfo2 only onceGregor Beck1-1/+2
Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-04s3:libsmb: add function cli_qpathinfo3()Gregor Beck2-0/+61
This is a reimplemantation of cli_qpathinfo2 without the use of info level SMB_QFILEINFO_ALL_INFO which leads to broken responses from NetApp. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-04s3:libsmb: add function cli_qpathinfo_standard()Gregor Beck2-0/+53
Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-04s3:libsmb: pass creation or birth time in cli_qpathinfo_basic()Gregor Beck1-0/+1
Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-10s3:libsmb: call smbXcli_tcon_set_fs_attributes() directlyStefan Metzmacher1-4/+8
We should try to set all attributes we got and not just FILE_CASE_SENSITIVE_SEARCH. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Oct 17 19:02:03 CEST 2013 on sn-devel-104 (cherry picked from commit 2474455b7f924ae19ea8897d5e506076f7e77419)
2014-03-10s3:libsmb: remove unused cli_state->case_sensitiveStefan Metzmacher1-3/+6
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 307abd61df586baac6cb0bef4272c633c526a7bf)
2014-03-10s3:libsmb: remove unused cli_state->dfsrootStefan Metzmacher1-6/+0
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit e20c66d78099bcf5d965bd9d59669fe393481517)
2014-03-10s3:libsmb: add SMB2/3 support to cli_dfs_get_referral()Stefan Metzmacher1-17/+56
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit c5c717fe3157224a8aba48a30bace889e7956d31)
2014-03-10s3/libsmb: make use of smbXcli_tcon_is_dfs_share()Stefan Metzmacher2-3/+26
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 37f0e3722cea3ff433d2c95d697e38693c676ae0)
2014-03-10s3/libsmb: Use smbXcli_conn_dfs_supported instead of test on CAP_DFSLuk Claes3-3/+3
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Luk Claes <luk@debian.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 114e33717df8b49239ac08399a379a8363d33b85)
2014-03-10s3:libsmb: don't pass down FLAG_CASELESS_PATHNAMES and FLAGS2_DFS_PATHNAMES ↵Stefan Metzmacher2-43/+0
anymore They're now handled at the smbXcli_conn and smbXcli_tcon layer. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 451b11251f7f3a517f94c5d57dab327a30bab52f)
2014-03-10s3:libsmb: call smbXcli_tcon_{get,set}_fs_attributes() from ↵Stefan Metzmacher1-0/+17
cli_set_case_sensitive() Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 226dde2879ff8b4b366bf3d9f44f59e7fdc343c0)
2014-03-10s3:libsmb: make use of smb1cli_tcon_set_values()Stefan Metzmacher1-2/+17
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit a2b38e0bc94d329963cdad76e6861d3234ede8d4)
2014-03-10s3/libsmb: Use smbXcli_conn_use_unicode instead of smb1 specific testLuk Claes1-1/+1
Signed-off-by: Luk Claes <luk@debian.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit d9d5744bc3dd7e18ac6dc23917d903d5e991ab8d)
2013-11-26s3-libsmb: Fix scanf format in parse_ace().Andreas Schneider1-3/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 1214e3345c655a4c7dc98c69c4e018e47558f639)
2013-11-26s3-libsmb: Use the right macro to set uint16_t attr.Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit f8ab594d0253920cefc441587a55fddb688be550)
2013-11-22s3-client: smbclient shows no error if deleting a directory with del failedJeremy Allison3-4/+28
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260 In SMB1 the server filters by attribute requested, in SMB2 there is no attribute sent. Emulate this on the client to provide the same ABI to callers. In SMB1 the server returns NT_STATUS_NO_SUCH_FILE if FindFirst finds no files. Emulate this on the client. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Nov 14 21:23:07 CET 2013 on sn-devel-104 (cherry picked from commit 4ee4a7e96e71cee27c30d23610a7f83d968a8ba0)
2013-09-19s3: libsmb SMB2 wrapper layer. cli_smb2_get_ea_list_path() failed to close ↵Jeremy Allison1-0/+4
file on exit. Found at SNIA SDC plugfest. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit cdc280deb1e6f99ec9eae05d75bc1104448662ef) Fix bug #10149 - cli_smb2_get_ea_list_path() failed to close file on exit.
2013-09-18s3: libsmb : The short name length is only a one byte field.Jeremy Allison1-1/+1
The next byte is "undefined" and some vendors set this to 0xff (discovered in SNIA SDC lab tests). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Sep 17 12:27:18 CEST 2013 on sn-devel-104 (cherry picked from commit 1c41feb7893ae4a4f42c035f3c83f8b2950b7816) Fix bug #10145 - Samba SMB2 client code reads the wrong short name length in a directory listing reply. Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Wed Sep 18 11:15:35 CEST 2013 on sn-devel-104
2013-09-06Optimization. Don't do the retry logic if sitename_fetch() returned NULL, we ↵Jeremy Allison1-1/+5
already did a NULL query. Bug 5917 - Samba does not work on site with Read Only Domain Controller Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Sep 4 01:19:05 CEST 2013 on sn-devel-104 (cherry picked from commit bdab6f9431715fbfd28f8cc0dfb4dde2966f22f3)
2013-09-06Move the retry logic when site_name is passed in a NULL or "" to the wrapper ↵Jeremy Allison1-4/+21
function. Bug 5917 - Samba does not work on site with Read Only Domain Controller Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org> (cherry picked from commit 68e7b1c9446c7d1274b0fb85b59b90ac1a7f6041)
2013-09-06Move the manipulation of site_name into the caller function dsgetdcname().Jeremy Allison1-15/+19
Leave dsgetdcname_internal() only using const char *site_name. Bug 5917 - Samba does not work on site with Read Only Domain Controller Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org> (cherry picked from commit 181c11066bd53b07015a199f56eb71182e89ff71)
2013-09-06Refactor dsgetdcname to be called via a wrapper function.Jeremy Allison1-5/+26
Bug 5917 - Samba does not work on site with Read Only Domain Controller Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org> (cherry picked from commit 66006be7ef703b2935334633d27641050cee5f58)
2013-09-06dsgetdcname_cache_fetch() doesn't use the site_name parameter so don't pass it.Jeremy Allison1-2/+1
Bug 5917 - Samba does not work on site with Read Only Domain Controller Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org> (cherry picked from commit dd12bfbcbf359c1642cc2e968aec62ae904aad5d)
2013-08-30As SMB3 has transport level encryption, allow smbclient -e to force encryted ↵Jeremy Allison1-1/+17
SMB3 transport. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 81e1058e20bcfc1efab2b39dd7642d8dbbe0cb3b)
2013-08-30libsmb: Fix a bunch of Coverity IDsVolker Lendecke1-20/+20
(fnum != -1) is always true, even if fnum=-1 was initialized. fnum is a uint16, and the comparison first casts this to 65535, which is always != -1. Also change the initialization to make it clearer what is happening here. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Aug 20 00:52:36 CEST 2013 on sn-devel-104 (cherry picked from commit 4f96d5753ffe6c446c46676ba31cd2a3722890a0)
2013-08-30s3:libsmb: call smb2cli_logoff() from cli_ulogoff()Stefan Metzmacher1-0/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Aug 15 10:53:21 CEST 2013 on sn-devel-104 (cherry picked from commit b706ca6e55aa76d4da901c69d991969602facc3b)
2013-08-30s3:libsmb: make cli_ulogoff_send/recv staticStefan Metzmacher2-6/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 1d7bdfc4feac35d92b003c3c78f502897ecc5d4e)
2013-08-30s3:libsmb: call smb2cli_tdis() from cli_tdis()Stefan Metzmacher1-0/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e6be68fb5e4dc528f7365f3413b9b66090992f42)
2013-08-30s3:libsmb: only set tcon to invalid in smb2cli_tdis*Stefan Metzmacher1-1/+2
This matches the behavior of cli_tdis*. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit d732e9aab3bbad3ea97f8b120e57b41152aaee3b)
2013-08-30s3:libsmb: make cli_tdis_send/recv staticStefan Metzmacher2-6/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 80d4f64352c0ddacb9ee15d2b48a42a0b7929501)
2013-08-30s3:libsmb: add support for SMB2 in cli_writeall()Stefan Metzmacher1-2/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit ccf7b3719121e03ed06d15b9af5373eecba3e828)