summaryrefslogtreecommitdiff
path: root/source3/include/proto.h
AgeCommit message (Collapse)AuthorFilesLines
2026-02-15lib: Streamline finding a file's block device for quota codeVolker Lendecke1-2/+10
Use /proc/self/mountinfo to find the block device a file is mounted on for quotactl purposes. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20lib: Remove a function unused since 2016Volker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20srvsvc: Move valid_share_pathname() to where it's usedVolker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20smbd: Remove unused STR_TO_SMB_BIG_UINTVolker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-13s3:libsmb: Rework check_negative_conn_cache()Andreas Schneider1-1/+1
The name and results are confusing. Rename the function and use a bool that it is easier to understand. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Jan 13 17:00:06 UTC 2026 on atb-devel-224
2026-01-13s3:lib/util_sock: allow {before,after}_connect hooks to be passed to ↵Stefan Metzmacher1-1/+4
open_socket_out_send() async_connect_send() already has these hooks now open_socket_out_send() callers can pass them through. This will be useful for IPPROTO_SMBDIRECT sockets to setup things between the socket() and connect() syscalls. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jan 13 08:13:04 UTC 2026 on atb-devel-224
2026-01-12lib: Remove [set|drop]_effective_capability and enum smbd_capabilityVolker Lendecke1-2/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jan 12 10:39:38 UTC 2026 on atb-devel-224
2026-01-12lib: Add capability-specific functionsVolker Lendecke1-0/+2
This makes the one-attempt logic for dac_override simpler to understand. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2026-01-07smbd: Move utok_string() into smbdVolker Lendecke1-1/+0
Only used in chdir_current_service() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10lib: Introduce cp_smb_basename() helper functionVolker Lendecke1-0/+1
I always had to look up the sequence of NULLs and 0s. Save lines. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Nov 10 14:33:28 UTC 2025 on atb-devel-224
2025-11-10lib: Remove some unused code #ifdef'ed out for more than 10 yearsVolker Lendecke1-3/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-06-14smbd: Make safe_symlink_target_path() staticVolker Lendecke1-6/+0
Only used once Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2025-05-09smbd: Simplify synthetic_smb_fname_split()Volker Lendecke1-2/+1
Remove the "posix_path" parameter, all callers just passed in "false". Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri May 9 11:02:41 UTC 2025 on atb-devel-224
2025-04-18s3:libsmb: introduce smbsock_connect.hStefan Metzmacher1-47/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:libsmb: pass struct smb_transports to smbsock_any_connect()Stefan Metzmacher1-2/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:libsmb: pass struct smb_transports to smbsock_any_connect_send()Stefan Metzmacher1-1/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:libsmb: pass struct smb_transports to smbsock_connect()Stefan Metzmacher1-2/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:libsmb: pass struct smb_transports to smbsock_connect_send()Stefan Metzmacher1-2/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:libsmb: rework smbsock_connect_* to work on smb_transports internallyStefan Metzmacher1-0/+2
We try the first transport first and all others after 5msecs, but if one fails we start the next one. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:lib: remove unused open_socket_out_defer_send/recvStefan Metzmacher1-7/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:lib: pass 'protocol' to open_socket_out_send()Stefan Metzmacher1-0/+1
For now this is always explicitly IPPROTO_TCP, but that will change when we add support for IPPROTO_QUIC. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:lib: split out open_socket_in_protocol()Stefan Metzmacher1-0/+6
This will be useful if we want to listen on IPPROTO_QUIC sockets. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-03-05lib: Remove unused next_token()Volker Lendecke1-1/+0
Replaced by next_token_talloc() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-11-22smbd: Make filename_convert_dirfsp_nosymlink() publicVolker Lendecke1-0/+12
To be used directly in smb2_create.c Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-11-12smbd: Factor out filename_convert_dirfsp_rel()Volker Lendecke1-0/+9
Soon we'll have a caller that needs the last component as a relative file name. Make sure it does not have to call get_lcomp or so. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-07-31lib: Remove "token" parameter from set_namearrayVolker Lendecke1-2/+0
Not needed anymore Bug: https://bugzilla.samba.org/show_bug.cgi?id=15688 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-31lib: Factor out append_namearray from set_namearrayVolker Lendecke1-0/+4
We'll have to add to an existing namearray soon. This turns one talloc_array() into a set of reallocs. This is slower, but set_namearray is only used for smb.conf entries where we don't expect hundreds or more entries to add. I've done this to avoid array length calculations, but if it turns out to be too slow we can get smarter again. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15688 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-26s3/lib: return error from set_namearray()Ralph Boehme1-1/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-26smbd: return errors from token_contains_name()Ralph Boehme1-1/+2
Invalid names in "valid users", "invalid users", "read list", "write list", "veto files" and "hide files" are logged and ignored, but a failure to contact winbind or a DC from winbind, or a memory allocation failure, now all trigger a failure of the tree connect. Manually tested with smbclient with the following hack in winbindd: ---8<--- $ git di source3/winbindd/winbindd_cache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index c889489dbbbc..8ccf0a28e11a 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -1821,6 +1821,13 @@ NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain, ZERO_STRUCTP(sid); *type = SID_NAME_UNKNOWN; + if (strequal(name, "unknown")) { + return NT_STATUS_OK; + } + if (strequal(name, "iotimeout")) { + return NT_STATUS_IO_TIMEOUT; + } + status = wcache_name_to_sid(domain, domain_name, name, sid, type); if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { return status; ---8<--- veto files = ../unknown/file1/../slow/file2 $ bin/smbclient -U slow%x //localhost/test -c quit $ In the log: [2024/03/04 15:21:33.659356, 1, pid=977167, effective(0, 0), real(0, 0)] ../../source3/lib/util_namearray.c:128(token_contains_name) token_contains_name: lookup_name 'unknown' failed veto files = ../iotimeout/file1/../slow/file2 $ bin/smbclient -U slow%x //localhost/test -c quit tree connect failed: NT_STATUS_LOGON_FAILURE $ [2024/03/04 15:22:15.655811, 0, pid=977177, effective(0, 0), real(0, 0)] ../../source3/lib/util_namearray.c:131(token_contains_name) token_contains_name: lookup_name 'iotimeout' failed NT_STATUS_NO_SUCH_DOMAIN [2024/03/04 15:22:15.655846, 1, pid=977177, effective(0, 0), real(0, 0)] ../../source3/smbd/uid.c:381(change_to_user_impersonate) change_to_user_impersonate: SMB user slow (unix user slow) not permitted access to share test. [2024/03/04 15:22:15.655855, 0, pid=977177, effective(0, 0), real(0, 0)] ../../source3/smbd/smb2_service.c:689(make_connection_snum) make_connection_snum: Can't become connected user! Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-26s3-errormap: move map_nt_error_from_wbcErr() back into errormap.cRalph Boehme1-0/+2
This basically reverts commit 313db81ad3de6cf7759d6a0fc21ee32419b2e62b. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-26s3/lib: add per-user support to set_namearray()Ralph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-26smbd: move token_contains_name() to util_namearray.c and make it publicRalph Boehme1-0/+6
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-26s3/lib: modernize set_namearray()Ralph Boehme1-3/+3
No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-26s3/lib: remove name_compare_entry typedefRalph Boehme1-3/+6
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-07-04lib: Remove a few duplicate prototypesVolker Lendecke1-6/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-07-04lib: Remove unused strnrchr_mVolker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-06-28smbd: Simplify copy_stat_ex_timestampsVolker Lendecke1-1/+2
copy_stat_ex_timestamps doesn't need the fsp, it only needs the destination stat struct Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-05-22s3:lib: Remove obsolete name_to_fqdn()Andreas Schneider1-1/+0
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-01source3/smbd: Update timestamps after a successful SMB_VFS_FNTIMESAnoop C S1-0/+1
When an open file handle is used to change timestamps we fail to return updated values to clients until next open is issued. Unless we fill in the timestamps subsequent calls like GETINFO cannot see the latest value causing incorrect results. Therefore copy those timestamp values as soon as it is set on the backend. Signed-off-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-03-28lib: Give tallocmsg.c its own headerVolker Lendecke1-5/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-03-12smbd: Remove get_Protocol()Volker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-01-22smbd: add a directory argument to safe_symlink_target_path()Ralph Boehme1-0/+1
Existing caller passes NULL, no change in behaviour. Prepares for replacing symlink_target_below_conn() in open.c. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15549 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-01-22smbd: pass symlink target path to safe_symlink_target_path()Ralph Boehme1-0/+5
Moves creating the symlink target path via symlink_target_path() to the caller. This prepares for using this in non_widelink_open(), where it will replace symlink_target_below_conn() with the same functionality. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15549 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2023-12-21s3/lib: add log_panic_action()Ralph Boehme1-0/+1
Can be used to log a nice stack backtrace with full debug symbols by setting "panic action" to something like panic action = cd /home/slow/git/samba/master && /home/slow/git/samba/master/selftest/gdb_backtrace %d This is similar to log_stack_trace(), but that doesn't come with debug symbols. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-12-19smbd: Give source3/smbd/dir.c its own header fileVolker Lendecke1-1/+0
The prototypes were spread across 3 different files. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2023-12-19smbd: Remove unused srv_put_dos_date2()Volker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2023-12-19smbd: Introduce srv_put_dos_date2_ts()Volker Lendecke1-0/+1
All but one uses of srv_put_dos_date2() converted from struct timespec. Put that into a new routine. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2023-12-19lib: Remove duplicate prototypesVolker Lendecke1-3/+0
They also exist in lib/util/time.h Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2023-12-15VERSION: move COPYRIGHT_STARTUP_MESSAGE as SAMBA_COPYRIGHT_STRING into version.hStefan Metzmacher1-0/+1
We also prodive a samba_copyright_string() helper similar to samba_version_string(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15377 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Björn Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Dec 15 10:44:42 UTC 2023 on atb-devel-224
2023-11-15smbd: Move mask_match_search() to smb1_reply.cVolker Lendecke1-1/+0
Only called there. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>