summaryrefslogtreecommitdiffstats
path: root/source3/libsmb
Commit message (Collapse)AuthorAgeFilesLines
* s3: libsmb: Change cli_disk_size() to use the ↵Jeremy Allison2014-06-071-0/+45
| | | | | | | | | | | | | trans2/SMB_FS_FULL_SIZE_INFORMATION call in preference to the old SMB1 call. Fallback to the old CORE protocol SMBdskattr if trans2/SMB_FS_FULL_SIZE_INFORMATION is not supported. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jun 7 05:41:44 CEST 2014 on sn-devel-104
* s3: libsmb: Make cli_smb2_dskattr() a 64-bit interface.Jeremy Allison2014-06-073-14/+10
| | | | | | | | Remove the fallback call from cli_dskattr() (now it's not called from external client code). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* s3: libsmb : Move users of cli_dskattr to a 64-bit interface cli_disk_free().Jeremy Allison2014-06-072-0/+27
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* s3/libsmb_xattr: use security_ace_equal instead of sec_ace_equalDavid Disseldorp2014-05-291-4/+5
| | | | | | | Both offer the same functionality, sec_ace_equal() will be removed. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3: libsmbclient: Work around bugs in SLES cifsd and Apple smbx SMB1 servers.Jeremy Allison2014-05-091-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>
* s3: client : correctly fill in the struct smb_create_returns from ↵Jeremy Allison2014-05-091-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>
* s3: client : Add extra return parameter to all client open calls.Jeremy Allison2014-05-096-19/+38
| | | | | | | | | | | | | | | 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>
* s3: client - rename 'struct smb2_create_returns' to 'struct ↵Jeremy Allison2014-05-092-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>
* s3-auth: Register ncalrpc_as_system gensec module.Andreas Schneider2014-04-241-1/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Remove uid_wrapper related code.Andreas Schneider2014-04-171-1/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib-util: rename memdup to smb_memdup and fix all callersBjörn Baumbach2014-04-161-2/+2
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
* libsmbclient: Wrap more function calls in talloc_stackframe() to protect ↵Andrew Bartlett2014-04-021-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
* libsmb: Provide a talloc_stackframe() to external users of libsmb_setget.cAndrew Bartlett2014-04-021-2/+15
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* auth/gensec: remove tevent_context argument from gensec_update()Stefan Metzmacher2014-03-271-3/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-kerberos: remove unused kdc_name from ↵Günther Deschner2014-03-071-4/+2
| | | | | | | | | | | | create_local_private_krb5_conf_for_domain(). Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Fri Mar 7 18:43:57 CET 2014 on sn-devel-104
* s3/libsmb: Free memdup'd local variableJose A. Rivera2014-02-221-0/+1
| | | | | | | | | | | | | | secrets_fetch_machine_password() sets pwd to point to memdup()'d (and thus malloc()'d) memory. This memory should be freed before we go out of scope. Change-Id: I07e575819c309fa5b85627dce2eb969bc720ce4e Coverity-Id: 1168001 Reviewed-by: Ira Cooper <ira@samba.org> Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Simo Sorce <idra@samba.org> Autobuild-Date(master): Sat Feb 22 00:58:23 CET 2014 on sn-devel-104
* s3-dsgetdcname: print IP address for LDAP ping.Günther Deschner2014-02-131-1/+3
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* param: rename lp function and variable from "cli_minprotocol" to ↵Garming Sam2014-02-073-3/+3
| | | | | | | | "client_min_protocol" Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from "cli_maxprotocol" to ↵Garming Sam2014-02-072-2/+2
| | | | | | | | "client_max_protocol" Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from 'piddir' to 'pid_directory'Garming Sam2014-02-071-1/+1
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from 'passwordserver' to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | 'password_server' Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: remove unused trust_pw_find_change_and_store_it()Stefan Metzmacher2014-01-071-81/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: add trust_pw_change()Stefan Metzmacher2014-01-071-0/+179
| | | | | | | | | This protects the password change using a domain specific g_lock, so multiple parts 'net rpc', 'rpcclient', 'winbindd', 'wbinfo --change-secret' even on multiple cluster nodes doesn't race anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: move source3/libsmb/cli_np_tstream.c to tstream_smbXcli_np.cStefan Metzmacher2014-01-072-1389/+0
| | | | | | | This code is generic enough to have it in the top level now. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: add a TSTREAM_CLI_NP_DESIRED_ACCESS define as collection of ↵Stefan Metzmacher2014-01-071-2/+14
| | | | | | | individual flags Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: add tstream_cli_np_ref as protection to talloc_free(smbXcli_conn)Stefan Metzmacher2014-01-071-0/+34
| | | | | | | This makes sure that we don't have dangling pointers. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: do not use cli_state internally within cli_np_tstreamGregor Beck2014-01-072-96/+124
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: let cli_np_tstream use smb1cli_readxGregor Beck2014-01-071-6/+9
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: let cli_np_tstream use smb1cli_writexGregor Beck2014-01-071-8/+9
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: let cli_np_tstream use smb1cli_closeGregor Beck2014-01-071-10/+29
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: let cli_np_tstream use smb1cli_transGregor Beck2014-01-071-14/+19
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: let cli_np_tstream use smb1cli_ntcreatexGregor Beck2014-01-071-11/+17
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb fix a compiler warningChristian Ambach2013-12-121-1/+1
| | | | | | | about a potentially uninitialized variable Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-libsmb: Fix a memory leak in get_pdc_ip().Andreas Schneider2013-12-061-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-libsmb: Fix scanf format in parse_ace().Andreas Schneider2013-11-151-3/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-libsmb: Use the right macro to set uint16_t attr.Andreas Schneider2013-11-151-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-client: smbclient shows no error if deleting a directory with del failedJeremy Allison2013-11-143-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
* libsmb: Fix CID 242665 Out-of-bounds accessVolker Lendecke2013-11-131-3/+7
| | | | | | | | | | | Coverity is confused by the dual-use of "pss" as an array of size 1. This is not strictly a bug here, but it is admittedly a small subtlety. It should fix a whole bunch of Coverity issues. Normally I would resist to change our code in response to a deficient static checker, but here I would vote for this compromise. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libsmb: Fix CID 241313 Array compared against 0Volker Lendecke2013-11-111-4/+2
| | | | | | | userinfo->passwrd is not a pointer, no point in checking for !=NULL Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* libsmb: Fix CID 1127343 Dead default in switchVolker Lendecke2013-11-111-2/+0
| | | | | | | We have checked sec_channel_type a few lines above already Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* s3:libsmb: SMBC_getatr() if no method worked, try all methods again on next ↵Gregor Beck2013-10-301-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>
* s3:libsmb: cli_qpathinfo3 use cli_qpathinfo2 for smb2Gregor Beck2013-10-301-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>
* s3:libsmb: SMBC_getatr use pathinfo3 for second tryGregor Beck2013-10-302-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>
* s3:libsmb: SMBC_getatr do not let ino undefined on successGregor Beck2013-10-301-0/+3
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: SMBC_getatr try pathinfo2 only onceGregor Beck2013-10-301-1/+2
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: add function cli_qpathinfo3()Gregor Beck2013-10-302-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>
* s3:libsmb: add function cli_qpathinfo_standard()Gregor Beck2013-10-302-0/+53
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: pass creation or birth time in cli_qpathinfo_basic()Gregor Beck2013-10-301-0/+1
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: call smbXcli_tcon_set_fs_attributes() directlyStefan Metzmacher2013-10-171-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
* s3:libsmb: remove unused cli_state->case_sensitiveStefan Metzmacher2013-10-171-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>