summaryrefslogtreecommitdiff
path: root/source3/client
AgeCommit message (Collapse)AuthorFilesLines
2025-11-06s3:client: Use a long living memory context for cli_cm_open()Andreas Schneider1-1/+1
This will fix memory leaks with a later commit. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Pass down a talloc context to do_cd()Andreas Schneider1-6/+11
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Pass a talloc context down to cmd_*() functionsAndreas Schneider3-89/+89
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Pass down a talloc context to process_command_string()Andreas Schneider1-4/+6
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Pass down a talloc context to do_tar_op()Andreas Schneider1-3/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Pass down a talloc context to do_message_op()Andreas Schneider1-3/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Pass down a talloc context to do_host_query()Andreas Schneider1-4/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Pass down a talloc context to process()Andreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Use a stackframe in process_command_string()Andreas Schneider1-7/+9
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Only allocate the stackframe once in process_stdin()Andreas Schneider1-6/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Do not call exit() in cmd_quit()Andreas Schneider1-4/+19
We want to go through deallocation in the main function. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Always goto out (destructor) in do_cd()Andreas Schneider1-6/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-06s3:client: Make cmd_iosize() staticAndreas Schneider2-2/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-10-24s3:client: Use talloc to avoid memory leaks in smbspoolAndreas Schneider1-4/+2
The function uri_unescape_alloc() is called by main() which has a talloc stackframe. Direct leak of 13 byte(s) in 1 object(s) allocated from: #0 0x7fc31351b9a0 in strdup (/lib64/libasan.so.8+0x11b9a0) (BuildId: 388ee9ac193f74c177c6f52988d2d0dab110de41) #1 0x7fc3129cfb50 in smb_xstrdup ../../lib/util/util.c:760 #2 0x0000002059f8 in uri_unescape_alloc ../../source3/client/smbspool.c:888 #3 0x00000020752a in main ../../source3/client/smbspool.c:347 #4 0x7fc30f62b2fa in __libc_start_call_main (/lib64/libc.so.6+0x2b2fa) (BuildId: 8523b213e7586a93ab00f6dd476418b1e521e62c) #5 0x7ffd8bb806be ([stack]+0x3b6be) Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Fri Oct 24 07:42:37 UTC 2025 on atb-devel-224
2025-08-08smbclient: fix handling errors from do_put in mputRalph Boehme1-1/+9
Pair-Programmed-With: Anoop C S <anoopcs@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Aug 8 11:59:33 UTC 2025 on atb-devel-224
2025-06-18s3:client: make use of smbXcli_conn_monitor_once()Stefan Metzmacher1-3/+6
This makes it possible to run checks based on a tevent_context in future. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-06-16libsmb: Remove "source3/libsmb/libsmb.h"Volker Lendecke3-3/+6
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 Metzmacher2-0/+2
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_cm_connect() and cli_cm_open()Stefan Metzmacher1-5/+17
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:smbspool: pass struct smb_transports to smb_connect()Stefan Metzmacher1-7/+9
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:smbspool: pass struct smb_transports to smb_complete_connection()Stefan Metzmacher1-6/+6
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_start_connection()Stefan Metzmacher1-1/+2
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_connect_nb()Stefan Metzmacher1-1/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-03-05smbclient3: Replacing Echos in the cli status check with TCP status check.Felix Bussmann1-35/+4
Replacing the echoes, which were being sent every 5 seconds by the client for a CLI status check, with a method that checks the status of the file descriptor instead, for a POLLHUP, POLLRDHUP, or a timeout. Signed-off-by: Felix Bussmann <feb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Wed Mar 5 16:21:34 UTC 2025 on atb-devel-224
2025-02-27smbclient: report kilobytes per second as kB/s, not kb/sDouglas Bagnall1-2/+2
https://bugzilla.samba.org/show_bug.cgi?id=11023 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2024-11-06s3:client:clitar: s/the the/to the/ in commentDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-09-27s3:client: Improve error message on cli_setatr() failureAndreas Schneider1-2/+8
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Sep 27 07:54:34 UTC 2024 on atb-devel-224
2024-08-20libsmb: Convert cli_RNetShareEnum() to NTSTATUSVolker Lendecke1-5/+5
Avoid a call to cli_nt_error() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-08-06smbclient: Modernize a d_printfVolker Lendecke1-1/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-08-06smbclient: Use cli_chmod instead of cli_posix_chmodVolker Lendecke1-6/+1
Skip the smb1-only SERVER_HAS_UNIX_CIFS(), chmod now also does SMB2 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2024-05-14smbspool: let kerberos_ccache_is_valid() use smb_force_krb5_cc_default_name()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-05-14smbspool_krb5_wrapper: let kerberos_get_default_ccache() use ↵Stefan Metzmacher1-1/+2
smb_force_krb5_cc_default_name() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-05-14smbspool_krb5_wrapper: remove unused includesStefan Metzmacher1-4/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-05-07s3:client: avoid cli_credentials_get_password() to check for a specified ↵Stefan Metzmacher1-2/+2
password Using cli_credentials_get_password_obtained() is more lightweight as it avoids a possible password prompt. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-04-29s3:libsmb: Pass a memory context to cli_start_connection()Andreas Schneider1-2/+8
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-04-29s3:libsmb: Pass memory context to cli_connect_nb()Andreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-04-16lib: Give lib/util/util_file.c its own header fileVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2023-10-26s3/libsmb: reuse smbXcli_conn_have_posix()Ralph Boehme1-1/+1
We already store the negotiated POSIX state in smbXcli_connection and there we only store it if the server actually supports the version we requested. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2023-10-25s3:client: Call gfree_all() before exit in smbspoolAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-25s3:client: Call gfree_all() before exit in smbclientAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13s3:client: Correctly call setgroups() (CID 1449449)Joseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-12smbclient: Always ask for SMB311 posix in negprotVolker Lendecke1-1/+6
This does not mean that we're actually using it (yet). We just probe whether the server is willing to do it. Enable the posix cli command for smb311 posix extensions. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-09-25libsmb: Remove a call to SMBC_errno()Volker Lendecke1-2/+3
This involves converting cli_printjob_del() to NTSTATUS and thus touches a few callers. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-09-25smbclient: Save lines with talloc_asprintf_addbuf()Volker Lendecke1-40/+14
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-09-25smbclient: Add mkfifo commandVolker Lendecke1-0/+59
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-09-14s3:client: Use lpcfg_set_cmdline()Andreas Schneider1-5/+11
This lp_set_cmdline() leaks memory and we want to get rid of it. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Kalugin <pkalugin@inno.tech> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-22smbclient: Don't give up in allinfo if getting advanced info failsVolker Lendecke1-10/+17
Getting streams might fail, but further down getting reparse info might succeed. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-08-10smbclient3: Get all reparse data for allinfoVolker Lendecke1-10/+29
If we hit a reparse point in point, it might be something but a symlink. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Aug 10 14:36:40 UTC 2023 on atb-devel-224
2023-08-08s3:client: Remove unnecessary newline from logging messageJoseph Sutton1-1/+1
time_to_asc() adds a trailing newline of its own. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-08s3:client: Add missing newlines to logging messagesJoseph Sutton1-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>