summaryrefslogtreecommitdiffstats
path: root/libcli
Commit message (Collapse)AuthorAgeFilesLines
* libcli/smb: add smb_signing_is_desired()Stefan Metzmacher2014-04-162-0/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Do not install smbclient4 and nmblookup4Jeroen Dekkers2014-04-151-1/+2
| | | | | | | | | | Change-Id: I2d91d9c9faa2df084321d10fbdc948acbd2bb735 Signed-off-by: Jeroen Dekkers <jeroen@dekkers.ch> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Tue Apr 15 03:25:13 CEST 2014 on sn-devel-104
* Typo: s/preceeded/preceded/Jelmer Vernooij2014-04-141-3/+3
| | | | | | | | | | | Caught by lintian, the Debian package linter :) Change-Id: Ia7162ea8c2b1845155345526b66d71ae64f15227 Reviewed-on: https://gerrit.samba.org/216 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Mon Apr 14 03:51:15 CEST 2014 on sn-devel-104
* Add error codes and message descriptions for NTSTATUSNoel Power2014-04-022-0/+4238
| | | | | | | | | | | Error codes and descriptions were autogenerated from [MS-ERREF] see http://msdn.microsoft.com/en-us/library/cc704588.aspx Additionally some missing error descriptions for existing errors were identified and generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Use correct error code value for NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGENoel Power2014-04-021-1/+1
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Add autogenerated HRESULT error codes and descriptions from MS_ERREFNoel Power2014-04-023-2/+14741
| | | | | | | | | | | | error codes & string descriptions are generated from http://msdn.microsoft.com/en-us/library/cc704587.aspx, additionally there is a function to return the error description from the error code, this function will also try to determine the error description associated with a W_ERROR code translated as a HRESULT. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/lsarpc: add struct trustAuthInOutBlob; forward declarationStefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: s/encrypt/do_encryptStefan Metzmacher2014-04-021-6/+6
| | | | | | | This avoids compiler warnings. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/security: s/remove/remove_ace/Stefan Metzmacher2014-04-021-3/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: reuse tstream_smbXcli_np_disconnect_send/recv as helperStefan Metzmacher2014-03-251-60/+14
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: add tstream_smbXcli_np_disconnect_cleanup() to handle ↵Stefan Metzmacher2014-03-251-0/+58
| | | | | | | | | | | | talloc_free(req) If the tevent_req of tstream_smbXcli_np_disconnect_* is explicitly or implicitly free'ed, we need to make sure we still deliver the close request to the server! Otherwise the SMB signing sequence gets out of sync. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: make TSTREAM_SMBXCLI_NP_MAX_BUF_SIZE publicStefan Metzmacher2014-03-252-20/+20
| | | | | | | | This should be used to negotiate the may fragment size of DCERPC connections. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: keep references to smbXcli_{conn,session,tcon} in tstream_smbXcli_npStefan Metzmacher2014-03-251-9/+53
| | | | | | | | This fixes some valgrind errors when the smbXcli_tcon disappears before the smbXcli_conn. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbreadline: switch to new-style readline typedefGustavo Zacarias2014-03-131-1/+1
| | | | | | | | | | | | | | | | | | Function, CPFunction, CPPFunction and VFunction typedefs are considered old-style (deprecated) starting from readline 4.2 (circa 2001). Compatibility typedefs have been in place up to readline 6.2 but were removed with the 6.3 release thus causing builds to break. Switch to the new-style specific prototyped typedef. Return value is unused so the callback should still be void (see readline/input.c around line 456 in version 6.3). Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Mar 13 00:21:47 CET 2014 on sn-devel-104
* libcli/smb: add SMB_BUFFER_SIZE_MIN/MAX definesStefan Metzmacher2014-03-051-0/+8
| | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Add warning about flow control changing macros in ntstatus.hAndrew Bartlett2014-03-051-0/+8
| | | | | | Change-Id: I49fec82e55b6bc59d5c0f157df90005f7d891c66 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli: Overflow array index read possible, in auth code.Ira Cooper2014-02-241-1/+1
| | | | | | | | | | | Changed the if condtion to detect when we'd improperly overflow. Coverity-Id: 1167990 Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ira Cooper <ira@samba.org> Autobuild-Date(master): Mon Feb 24 11:56:38 CET 2014 on sn-devel-104
* Revert "libcli: Overflow array index read possible, in auth code."Ira Cooper2014-02-241-2/+2
| | | | | | This reverts commit 538cbfe0e90b7c7ed0f8421b323cac4dacd83f04. Signed-off-by: Ira Cooper <ira@samba.org>
* libcli: Overflow array index read possible, in auth code.Ira Cooper2014-02-241-2/+2
| | | | | | | | | | | | The values have to be signed here to allow for the values to go negative, to prevent the overflow. Coverity-Id: 1167990 Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ira Cooper <ira@samba.org> Autobuild-Date(master): Mon Feb 24 07:23:03 CET 2014 on sn-devel-104
* libcli: use DBWRAP_LOCK_ORDER_NONE when opening schannel_store.tdbMichael Adam2014-02-071-1/+2
| | | | | | | Make lack of lock order checking more visible. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add dbwrap_flags argument to dbwrap_local_open()Michael Adam2014-02-072-2/+3
| | | | | | | | To be consistent with db_open() and prepare for future possible extensions. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/auth: reject computer_name longer than 15 charsStefan Metzmacher2014-01-221-0/+8
| | | | | | | | This matches Windows, it seems they use a fixed size field to store netlogon_creds_CredentialState. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: don't alter the computer_name in cluster mode.Stefan Metzmacher2014-01-221-19/+3
| | | | | | | This breaks NTLMv2 authentication. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: add netlogon_creds_cli_set_global_db()Stefan Metzmacher2014-01-222-0/+12
| | | | | | | This can be used to inject a db_context from dbwrap_ctdb. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli: Fix the comment for the address.Andreas Schneider2014-01-171-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* libcli/smb: make use of tevent_req_set_cleanup_fn()Stefan Metzmacher2014-01-171-10/+16
| | | | | | | This is more better than a custom tevent_req destructor. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* samba:python - Py_RETURN_NONE remove compatibility code for releases < 2.4Matthias Dieter Wallnöfer2014-01-091-4/+0
| | | | | | | | | http://www.python.org/doc//current/c-api/none.html Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date(master): Thu Jan 9 16:27:47 CET 2014 on sn-devel-104
* libcli/auth: fix usage of an uninitialized variable in ↵Stefan Metzmacher2014-01-081-2/+2
| | | | | | | | | | netlogon_creds_cli_check_caps() If status is RPC_PROCNUM_OUT_OF_RANGE, result might be uninitialized. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* libcli/auth: remove unused netlogon_creds_cli_context_copy()Stefan Metzmacher2014-01-072-51/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: make use of real options in netlogon_creds_cli_context_global()Stefan Metzmacher2014-01-071-15/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: use unique key_name values in netlogon_creds_cli_context_common()Stefan Metzmacher2014-01-071-10/+48
| | | | | | | | | | | | | | | | | Until all callers are fixed to pass the same 'server_computer' value, we try to calculate a server_netbios_name and use this as unique identifier for a specific domain controller. Otherwise winbind would use 'hostname.example.com' while 'net rpc testjoin' would use 'HOSTNAME', which leads to 2 records in netlogon_creds_cli.tdb for the same domain controller. Once all callers are fixed we can think about reverting this commit. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: add netlogon_creds_cli* infrastructureStefan Metzmacher2014-01-073-0/+2738
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides an abstraction to hide netlogon_creds_CredentialState, which is stored in a node local tdb. Where the global state (netlogon_creds_CredentialState) between client and server was only kept in memory (on the client side), we now use the abstracted netlogon_creds_cli_context. We now use a node specific computer name in order to establish individual netlogon sessions per node. If the caller wants to use some netlogon calls with credential chain (struct netr_Authenticator), netlogon_creds_cli_lock*() is used to get the current netlogon_creds_CredentialState in a g_lock'ed fashion, a talloc_free() will release the lock. The locking is needed as there might be more than one process (multiple winbindd child, cmdline tools) which want to talk to a specific domain controller. The usage of netlogon_creds_CredentialState needs to be serialized as it uses sequence numbers. LogonSamLogonEx doesn't use the credential chain, but for some operations it needs the global session in order to de/encrypt individual fields. It uses the lockless netlogon_creds_cli_get() and netlogon_creds_cli_validate() functions, which just make sure the session hasn't changed between get and validate. This is prepares the proper fix for a large number of bugs: https://bugzilla.samba.org/show_bug.cgi?id=6563 https://bugzilla.samba.org/show_bug.cgi?id=7944 https://bugzilla.samba.org/show_bug.cgi?id=7945 https://bugzilla.samba.org/show_bug.cgi?id=7568 https://bugzilla.samba.org/show_bug.cgi?id=8599 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/smb: s/tstream_cli_np/tstream_smbXcli_npStefan Metzmacher2014-01-072-224/+226
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/smb: s/TSTREAM_CLI_NP/TSTREAM_SMBXCLI_NPStefan Metzmacher2014-01-071-11/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/smb: move source3/libsmb/cli_np_tstream.c to tstream_smbXcli_np.cStefan Metzmacher2014-01-073-0/+1389
| | | | | | | 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>
* libcli/smb: add smb1cli_readx*Gregor Beck2014-01-073-0/+238
| | | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/smb: add smb1cli_writex*Gregor Beck2014-01-073-0/+312
| | | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/smb: add smb1cli_close*Gregor Beck2014-01-073-0/+206
| | | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/smb: add smb1cli_ntcreatex*Gregor Beck2014-01-073-0/+405
| | | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/smb: move some *TRANSACT_* flags to smb_constants.hStefan Metzmacher2014-01-071-0/+34
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/smb: move some FILE_* flags to smb_constants.hStefan Metzmacher2014-01-071-0/+50
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* auth/gensec: move libcli/auth/schannel_sign.c into schannel.cStefan Metzmacher2014-01-073-419/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: try to use the current timestamp creds->sequenceStefan Metzmacher2013-12-241-0/+22
| | | | | | | | | | | | | | | If the last usage of netlogon_creds_client_authenticator() is in the past try to use the current timestamp and increment more than just 2. If we use netlogon_creds_client_authenticator() a lot within a second, we increment keep incrementing by 2. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Dec 24 13:18:18 CET 2013 on sn-devel-104
* libcli/auth: remove bogus comment regarding replay attacksStefan Metzmacher2013-12-241-2/+0
| | | | | | | | | creds->sequence (timestamp) is the value that is used to increment the internal state, it's not a real sequence number. The sequence comes from adding all timestamps of the whole session. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libcli/auth: set the return_authenticator->timestamp = 0Stefan Metzmacher2013-12-241-1/+1
| | | | | | | This is what windows returns, the value is ignored by the client anyway. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* secacl: Slightly simplify make_sec_aclVolker Lendecke2013-12-141-3/+6
| | | | | | | | | | This avoids a complex if-expression 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): Sat Dec 14 00:10:21 CET 2013 on sn-devel-104
* secacl: Fix a memleak in an error pathVolker Lendecke2013-12-131-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* secacl: Don't use talloc_zeroVolker Lendecke2013-12-131-1/+4
| | | | | | | We initialize all but one field anyway Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* secacl: Fix whitespaceVolker Lendecke2013-12-131-11/+11
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: fix compiler warningsChristian Ambach2013-12-121-0/+1
| | | | | | | about missing prototypes Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>