summaryrefslogtreecommitdiffstats
path: root/source3/rpcclient
Commit message (Collapse)AuthorAgeFilesLines
* rpcclient: Fix and enhance rpcclient outputRobin Hack2015-02-171-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11085 When rpcclient is called like: $ rpcclient -c "getdata . Osversion" at end of output is added one nonsense line OsVersion: Osversion: This patch removes this line and adds more human friendly ouput: OsMajor: num OsMinor: num OsBuild: num for OsVersion query. For OsVersionEx two more lines are added: OsMajor: num OsMinor: num OsBuild: num ServicePackMajor: num ServicePackMinor: num Signed-off-by: Robin Hack <hack.robin@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* samba: pass down size_t instead of int to add_string_to_array().Günther Deschner2014-11-171-2/+3
| | | | | | | | | | 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): Mon Nov 17 19:53:22 CET 2014 on sn-devel-104
* fsrvp: define FSRVP_E_SHADOWCOPYSET_ID_MISMATCHDavid Disseldorp2014-11-141-1/+5
| | | | | | | | This was recently added to the [MS-FSRVP] specification with the errata http://msdn.microsoft.com/en-us/library/dn785066.aspx#BKMK_FSRVP Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-rpcclient: Make sure current_nt_hash is initialized.Andreas Schneider2014-10-311-1/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: Remove unused domain copy stored in cli_stateStefan Metzmacher2014-10-171-1/+1
| | | | | | Change-Id: I7333140906bb3a487205b5760396dcc00a9f49b0 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-winbindd: Attempt to connect to NETLOGON over NCACN_IP_TCP if we canAndrew Bartlett2014-10-081-1/+1
| | | | | | | | | | | | This is very helpful in the trusted domain situation, as we may not have a two-way trust but we can use our domain trust account to set up a connection to NETLOGON Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Oct 8 12:48:15 CEST 2014 on sn-devel-104
* s3-rpc_client: Migrate to cli_rpc_pipe_open_generic_auth and remove ↵Andrew Bartlett2014-10-081-16/+3
| | | | | | | | | | cli_rpc_pipe_open_spnego Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Oct 8 03:36:52 CEST 2014 on sn-devel-104
* s3-rpc_client: Adapt cli_rpc_pipe_open_generic_auth to use enum ↵Andrew Bartlett2014-10-081-0/+1
| | | | | | | | | | | credentials_kerberos_state This allows us to pass this value in directly from the cli_credentials structure in winbindd, once we merge this with cli_rpc_pipe_open_spnego(). Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-rpc_client: Adapt cli_rpc_pipe_open_spnego to use enum ↵Andrew Bartlett2014-10-081-5/+6
| | | | | | | | | | | | credentials_kerberos_state This allows us to pass this value in directly from the cli_credentials structure in winbindd. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-rpc_client: return info3 in rpccli_netlogon_password_logon().Günther Deschner2014-07-151-1/+4
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Pair-Programmed-With: Andreas Schneider <asn@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* idl:drsuapi: Manage all possible lengths of drsuapi_DsBindInfoSamuel Cabrero2014-07-071-0/+4
| | | | | | | Signed-off-by: Samuel Cabrero <scabrero@zentyal.com> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
* Allow FSRVP access generic HRESULT error message descriptionsNoel Power2014-04-021-0/+8
| | | | | | | | | | | | FSRVP can possibly return any HRESULT error in addition to it's own specific errors. This change searches the HRESULT errors for a description if the error doesn't match any of the known FSRVP ones. Also removed some errors defined in fsrvp.idl (now that they are defined in hresult.h) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* rpcclient: abort shadow-copy set on commit failureDavid Disseldorp2014-04-011-3/+26
| | | | | | | | | | | Use similar behaviour to the diskshadow.exe FSRVP client, which aborts the shadow-copy set if it receives a failed commit response. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Apr 1 00:54:06 CEST 2014 on sn-devel-104
* rpcclient: append a trailing slash to FSRVP request UNCsDavid Disseldorp2014-03-311-6/+22
| | | | | | | | | | | | | | | | | | | The Windows Server 2012 FSRVP server exhibits strange behaviour when exposing hidden shadow copy shares. If the hidden share UNC in the AddToShadowCopySet request includes a trailing backslash (e.g. "\\server\share$\"), then the new shadow-copy share will also be hidden (e.g. "\\server\share$@{ShadowCopy.ShadowCopyId}$"). However, if the UNC does not include a trailing backslash, which until now was rpcclient's default behaviour, then the exposed shadow-copy share is not hidden. Thanks to the MS Open Specifications team for helping me track down this one. bug: https://bugzilla.samba.org/show_bug.cgi?id=10521 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:rpcclient: fix build without HAVE_IPV6Gregor Beck2014-03-311-5/+14
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* For FSRVP use textual error messages instead of hex error codesNoel Power2014-03-081-2/+50
| | | | | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Mar 8 03:52:44 CET 2014 on sn-devel-104
* s3:rpcclient: make use of dcerpc_binding_get_string_option("host")Stefan Metzmacher2014-02-131-2/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:rpcclient: make use of dcerpc_binding_set_abstract_syntax() in cmd_epmapper.cStefan Metzmacher2014-02-131-1/+7
| | | | | | | We should not use dcerpc_binding internals. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:rpcclient: make use of dcerpc_binding_[g|s]et_*() in rpcclient.cStefan Metzmacher2014-02-131-9/+18
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:rpcclient: make use of dcerpc_parse_binding() to create the bindingStefan Metzmacher2014-02-131-7/+12
| | | | | | | This makes sure the binding is talloc'ed. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:rpcclient: initialize struct dcerpc_binding completelyStefan Metzmacher2014-02-111-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:rpcclient: add witness commandGregor Beck2014-02-112-0/+506
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:rpcclient: remove unused code from cmd_lsa_get_username()Stefan Metzmacher2014-01-161-10/+0
| | | | | | | lsa_GetUserName() doesn't require a policy handle. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:rpcclient: add support for DCERPC_AUTH_LEVEL_CONNECTStefan Metzmacher2014-01-161-12/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:rpc_client: make cli_rpc_pipe_open_schannel() more flexibleStefan Metzmacher2014-01-071-6/+7
| | | | | | | | | | It expects a messaging_context now and returns a netlogon_creds_cli_context. This way we can finally avoid having a rpc_pipe_client->netlogon_creds. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: make use of rpccli_netlogon_password_logon() in the 'samlogon' cmdStefan Metzmacher2014-01-071-3/+8
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: remove optional auth_level parameter of the 'samlogon' cmdStefan Metzmacher2014-01-071-7/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: give errors and clean up correctly after failing to obtain secretGarming Sam2014-01-071-0/+6
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: make use of rpccli_{create,setup}_netlogon_creds()Stefan Metzmacher2014-01-071-18/+41
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: make use of trust_pw_change()Stefan Metzmacher2014-01-071-5/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: make use of rpcclient_netlogon_creds instead of ↵Stefan Metzmacher2014-01-071-5/+17
| | | | | | | cli->netlogon_creds Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: remove unused rpccli_netlogon_setup_creds() from ↵Stefan Metzmacher2014-01-071-20/+1
| | | | | | | | | cmd_netlogon_database_redo() rpccli_netlogon_setup_creds() is already called in the main do_cmd() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: add rpcclient_netlogon_credsStefan Metzmacher2014-01-072-0/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: add rpcclient_msg_ctxStefan Metzmacher2014-01-072-0/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpc_client: make use of the new netlogon_creds_cli_contextStefan Metzmacher2014-01-071-8/+49
| | | | | | | | | | | | | | | This exchanges rpc_pipe_client->dc with rpc_pipe_client->netlogon_creds and lets the secure channel session state be stored in node local database. This is 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>
* s3:rpcclient: close the connection if setting up the netlogon secure channel ↵Stefan Metzmacher2013-12-231-0/+5
| | | | | | | | | fails This is based on a patch from Garming Sam <garming@catalyst.net.nz>. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2013-4408:s3:Ensure LookupRids() replies arrays are range checked.Jeremy Allison2013-12-091-0/+8
| | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Karolin Seeger <kseeger@samba.org> Autobuild-Date(master): Mon Dec 9 09:00:41 CET 2013 on sn-devel-104
* CVE-2013-4408:s3:Ensure LookupNames replies arrays are range checked.Jeremy Allison2013-12-092-2/+62
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* CVE-2013-4408:s3:Ensure LookupSids replies arrays are range checked.Jeremy Allison2013-12-091-2/+5
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* rpcclient: fix output of lsalookupsids for sids of type DOMAINMichael Adam2013-11-131-3/+10
| | | | | | | For domain sids, don't print NAME\*unknown* but print NAME instead. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:rpcclient: fix a leaked talloc_stackframe in cmd_epmapperGregor Beck2013-11-041-5/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10241 Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:rpcclient: make use of rpcclient_cli_stateStefan Metzmacher2013-10-171-2/+2
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: introduce global rpcclient_cli_stateStefan Metzmacher2013-10-172-1/+5
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix bug #10100 - rpcclient crashes when sending the 'netshareenum 502' commandJeremy Allison2013-08-211-3/+7
| | | | | | | | | | | We are using the wrong variable for the returned count. Reported by <pisymbol@gmail.com>. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Aug 21 17:30:33 CEST 2013 on sn-devel-104
* s3:rpcclient: fix compiler warningsStefan Metzmacher2013-08-121-6/+7
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: try to use NETLOGON_NEG_SUPPORTS_AESStefan Metzmacher2013-08-102-2/+4
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: use talloc_stackframe() in do_cmd()Stefan Metzmacher2013-08-051-2/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-rpc_cli: pass down ndr_interface_table to ↵Günther Deschner2013-08-051-1/+1
| | | | | | | | | | cli_rpc_pipe_open_noauth_transport(). Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-rpc_cli: pass down ndr_interface_table to cli_rpc_pipe_open_noauth().Günther Deschner2013-08-053-4/+4
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-rpc_cli: pass down ndr_interface_table to cli_rpc_pipe_open_schannel().Günther Deschner2013-08-051-1/+1
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>