summaryrefslogtreecommitdiff
path: root/source3/rpcclient
AgeCommit message (Collapse)AuthorFilesLines
2026-03-10rpcclient: Print current_users for share info level 2Volker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Shweta Sodani <ssodani@redhat.com> Reviewed-by: Xavi Hernandez <xhernandez@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org>
2026-02-15lib: Remove very little used wrapper conv_str_u64()Volker Lendecke1-2/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10s3: talloc_destroy() -> TALLOC_FREE()Volker Lendecke2-6/+6
Sweeping change, I know. Should not change compiled code in most cases, the compiler should be smart enough to elide the assignment right before a return. In the cases where this is not right before the return, TALLOC_FREE() is safer as it makes use-after-free crash. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-06-16libsmb: Remove "source3/libsmb/libsmb.h"Volker Lendecke4-4/+4
libsmb.h added ads_status.h and cli_smb2_fnum.h. Only few users need either. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-18s3:libsmb: introduce smbsock_connect.hStefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:libsmb: pass struct smb_transports to cli_full_connection_creds()Stefan Metzmacher2-2/+7
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-02-17s3:rpc_client: Use cli_rpc_pipe_reopen_np_noauth() for OpenPolicy fallbackStefan Metzmacher1-24/+24
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15680 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-01-13s3:rpcclient: use GENSEC_FEATURE_NO_DELEGATION for trust credentialsStefan Metzmacher1-0/+5
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2024-12-17rpcclient: Fix Coverity ID 1508978 Use of 32-bit time_tVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2024-12-05s3:cli_pipe: pass target_service to cli_rpc_pipe_open_with_creds()Stefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-12-02rpcclient: Fix Coverity ID 1509018 Use of 32-bit time_tVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-09-29s3:rpc_client: pass remote_{name,sockaddr} to ↵Stefan Metzmacher1-0/+2
rpccli_setup_netlogon_creds[_locked]() We shouldd not rely on cli_state to be a valid pointer (at least not when NCACN_IP_TCP is used...) Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-09-26s3:rpcclient: make use of dcerpc_binding_handle_get_transport()Stefan Metzmacher1-2/+6
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26s3:rpc_client: remember rpc_pipe_client->print_usernameStefan Metzmacher1-2/+1
This is ugly, but it's less ugly than doing it deep inside of cli_spoolss.c and other code. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26s3:rpcclient: make use of dcerpc_binding_handle_auth_info()Stefan Metzmacher1-5/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26s3:rpcclient/cli_drsuapi: make use of dcerpc_binding_handle_auth_session_key()Stefan Metzmacher1-7/+8
Note we only need to call this once per connection, not after each request... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-09-26s3:rpc_client: make use of dcerpc_binding_handle_transport_session_key()Stefan Metzmacher2-10/+20
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-07-26s3:lib: Merge library trusts_util into library adsPavel Filipenský1-1/+1
Function trust_pw_change() originally from library trustis_util was updated to call functionality from ads library. This would introduce circular dependency between the two libraries. To avoid it, trusts_util is merged into ads. BUG: https://bugzilla.samba.org/show_bug.cgi?id=6750 Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-05s3:rpcclient: Initialize spoolss_DriverDirectoryInfo infoPavel Filipenský1-1/+1
Error: UNINIT (CWE-457): samba-4.20.0rc2/source3/rpcclient/cmd_spoolss.c:1530: var_decl: Declaring variable "info" without initializer. samba-4.20.0rc2/source3/rpcclient/cmd_spoolss.c:1578: uninit_use_in_call: Using uninitialized value "info" when calling "display_printdriverdir_1". 1576| 1577| if (W_ERROR_IS_OK(result)) { 1578|-> display_printdriverdir_1(&info.info1); 1579| } 1580| Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-04-29s3:libsmb: Pass memory context to cli_full_connection_creds()Andreas Schneider2-15/+21
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-04-09s3:rpc_client: Implement createtrustdomex3 commandAndreas Schneider1-0/+124
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-09s3:rpc_client: Implement createtrustdomex2 commandAndreas Schneider1-0/+124
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-21s3:rpcclient: Use dcerpc_lsa_open_policy_fallback() in cmd_lsarpc.cAndreas Schneider1-102/+367
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-11-21s3:rpcclient: Remove trailing white spaces from cmd_lsarpc.cAndreas Schneider1-58/+76
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-11-20s3-rpcclient: add winreg_enumval commandGünther Deschner1-5/+139
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13s3:rpcclient: Do not pass uninitialized pointer to printf() (CID 1476170)Joseph Sutton1-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-23s3:rpcclient: Use lpcfg_set_cmdline()Pavel Kalugin1-2/+6
Signed-off-by: Pavel Kalugin <pkalugin@inno.tech> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-07-21CVE-2023-34968: mdssvc: introduce an allocating wrapper to sl_pack()Ralph Boehme1-28/+4
sl_pack_alloc() does the buffer allocation that previously all callers of sl_pack() did themselves. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15388 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-07-21CVE-2023-34968: rpcclient: remove response blob allocationRalph Boehme1-16/+0
This is alreay done by NDR for us. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15388 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-03-31librpc/ndr: Unimplement DRSUAPI_COMPRESSION_TYPE_XPRESS and renameAndrew Bartlett1-1/+1
DRSUAPI_COMPRESSION_TYPE_XPRESS is not MS-XCA nor is it implemented by lzexpress_compress(), so disconnect from that algorithm. This avoids someone fixing lzxpress_compress() to work for DRSUAPI and breaking claims support. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-10-25s3:rpcclient: Pass salt down to init_samr_CryptPasswordAES()Andreas Schneider1-0/+8
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15206 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
2022-10-14s3/rpcclient: Duplicate string returned from poptGetArgNoel Power1-1/+1
popt1.19 fixes a leak that exposes a use as free, make sure we duplicate return of poptGetArg if poptFreeContext is called before we use it. ==4407== Invalid read of size 1 ==4407== at 0x146263: main (rpcclient.c:1262) ==4407== Address 0x7b67cd0 is 0 bytes inside a block of size 10 free'd ==4407== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B2E8B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x5B2F5D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x146227: main (rpcclient.c:1251) ==4407== Block was alloc'd at ==4407== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B302EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x1461BC: main (rpcclient.c:1219) ==4407== ==4407== Invalid read of size 1 ==4407== at 0x14627D: main (rpcclient.c:1263) ==4407== Address 0x7b67cd0 is 0 bytes inside a block of size 10 free'd ==4407== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B2E8B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x5B2F5D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x146227: main (rpcclient.c:1251) ==4407== Block was alloc'd at ==4407== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B302EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x1461BC: main (rpcclient.c:1219) ==4407== ==4407== Invalid read of size 1 ==4407== at 0x4849782: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x4980E1C: talloc_strdup (talloc.c:2470) ==4407== by 0x488CD96: dcerpc_parse_binding (binding.c:320) ==4407== by 0x1462B1: main (rpcclient.c:1267) ==4407== Address 0x7b67cd0 is 0 bytes inside a block of size 10 free'd ==4407== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B2E8B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x5B2F5D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x146227: main (rpcclient.c:1251) ==4407== Block was alloc'd at ==4407== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B302EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x1461BC: main (rpcclient.c:1219) ==4407== ==4407== Invalid read of size 1 ==4407== at 0x4849794: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x4980E1C: talloc_strdup (talloc.c:2470) ==4407== by 0x488CD96: dcerpc_parse_binding (binding.c:320) ==4407== by 0x1462B1: main (rpcclient.c:1267) ==4407== Address 0x7b67cd1 is 1 bytes inside a block of size 10 free'd ==4407== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B2E8B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x5B2F5D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x146227: main (rpcclient.c:1251) ==4407== Block was alloc'd at ==4407== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B302EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x1461BC: main (rpcclient.c:1219) ==4407== ==4407== Invalid read of size 8 ==4407== at 0x484D3AE: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x4980DC2: __talloc_strlendup (talloc.c:2457) ==4407== by 0x4980E32: talloc_strdup (talloc.c:2470) ==4407== by 0x488CD96: dcerpc_parse_binding (binding.c:320) ==4407== by 0x1462B1: main (rpcclient.c:1267) ==4407== Address 0x7b67cd0 is 0 bytes inside a block of size 10 free'd ==4407== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B2E8B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x5B2F5D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x146227: main (rpcclient.c:1251) ==4407== Block was alloc'd at ==4407== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B302EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x1461BC: main (rpcclient.c:1219) ==4407== ==4407== Invalid read of size 1 ==4407== at 0x484D430: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x4980DC2: __talloc_strlendup (talloc.c:2457) ==4407== by 0x4980E32: talloc_strdup (talloc.c:2470) ==4407== by 0x488CD96: dcerpc_parse_binding (binding.c:320) ==4407== by 0x1462B1: main (rpcclient.c:1267) ==4407== Address 0x7b67cd8 is 8 bytes inside a block of size 10 free'd ==4407== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B2E8B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x5B2F5D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x146227: main (rpcclient.c:1251) ==4407== Block was alloc'd at ==4407== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==4407== by 0x5B302EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==4407== by 0x1461BC: main (rpcclient.c:1219) BUG: https://bugzilla.samba.org/show_bug.cgi?id=15205 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-07-28s3:rpcclient: Implement cmd chpasswd4Andreas Schneider1-0/+50
Manually tested against Windows Server 2022. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28s3:rpcclient: Implement setuserinfo2 level 31Andreas Schneider1-0/+14
Manually tested against Windows Server 2022. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28s3:rpcclient: Encrypt the password buffers only if really neededAndreas Schneider1-8/+21
If we are in FIPS mode certain ciphers like RC4 are not available, so we should make sure we do not call them. We will add AES support in the next patch. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-18s3:rpcclient: Goto done in cmd_samr_setuserinfo_int()Andreas Schneider1-8/+14
We need to free the frame or we will run into: smb_panic (why=0x7fa8c511aa88 "Frame not freed in order.") BUG: https://bugzilla.samba.org/show_bug.cgi?id=15124 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jul 18 21:21:59 UTC 2022 on sn-devel-184
2022-03-07s3:rpcclient: Fix crash in rpcclientPavel Filipenský1-2/+2
rpcclient SERVER -c 'dfsenum 5' dumps core Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Mar 7 00:00:32 UTC 2022 on sn-devel-184
2022-03-06s3:rpcclient: Fix trailing whitespace in cmd_dfs.cPavel Filipenský1-7/+7
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-01-10rpcclient: Fix ncacn_ip_tcp:<ip-address>Volker Lendecke1-17/+4
inet_pton expects "struct in_addr" or "struct in6_addr" as destination pointer. It does not fill in a struct sockaddr_storage. interpret_string_addr() takes care of this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jan 10 11:47:34 UTC 2022 on sn-devel-184
2021-12-02s3:rpc_client: Add remote name and socket to cli_rpc_pipe_open_bind_schannel()Andreas Schneider1-0/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14767 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-12-02s3:rpc_client: Pass remote name and socket to cli_rpc_pipe_open_with_creds()Günther Deschner1-1/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14767 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-12-02s3:rpc_client: Pass remote name and socket to ↵Günther Deschner1-0/+38
cli_rpc_pipe_open_noauth_transport() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14767 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-12-02s3:rpcclient: Remove trailing white spaces in rpcclient.cAndreas Schneider1-5/+5
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14767 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-11-09CVE-2020-25717: s3:rpcclient: start with authoritative = 1Stefan Metzmacher1-1/+1
This is not strictly needed, but makes it easier to audit that we don't miss important places. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14556 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-09-10rpcclient: don't ignore unknown optionsRalph Boehme1-0/+6
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-08-24rpcclient: Add unixinfo commandsVolker Lendecke3-0/+145
The unixinfo pipe might go away in the future, but right now we have it around. This code is simple and can go away again when unixinfo dies. 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 24 18:22:56 UTC 2021 on sn-devel-184
2021-08-06rpcclient: Align integer typesVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-05-25s3:rpcclient: Document command of witness protocolPavel Filipenský1-5/+5
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2021-05-20s3:rpcclient: Migrate rpcclient to new cmdline option parserAndreas Schneider3-31/+29
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-05-20s3:rpcclient: Pass cli_credentials to process_cmd()Andreas Schneider1-8/+11
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>