summaryrefslogtreecommitdiff
path: root/source3/param
AgeCommit message (Collapse)AuthorFilesLines
13 dayss3:loadparm: return NULL upon memalloc failure in lp_idmap_backendHEADmasterShachar Sharon1-1/+1
Return NULL instead of valid-but-misleading cast from 'false' to pointer. Signed-off-by: Shachar Sharon <ssharon@redhat.com> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Thu Apr 23 20:53:10 UTC 2026 on atb-devel-224
2026-04-15s3:loadparm: fix NULL pointer dereference in volume_label()Jeremy Allison1-0/+3
volume_label() calls lp_servicename() as a fallback when lp_volume() returns an empty string. lp_servicename() is a FN_LOCAL_SUBSTITUTED_STRING that falls back to sDefault.szService when the service is invalid. Since sDefault.szService is initialized to NULL and is never set by init_globals(), the substitution returns NULL, and the subsequent strlen() call crashes with a segmentation fault. Add a NULL guard so volume_label() returns an empty string instead of crashing. Remove knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14978 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Mulder <dmulder@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 15 00:07:12 UTC 2026 on atb-devel-224
2026-04-14s3:loadparm: guard free_service_byindex() in lp_servicenumber() with ↵Jeremy Allison1-0/+18
snum_in_use check lp_servicenumber() calls free_service_byindex() to destroy usershare services when usershare_exists() returns false or when the usershare file has been modified. This is unsafe because active connections may still hold the service number — the destroyed service leaves a NULL ServicePtrs[] entry that causes a NULL pointer dereference when the connection subsequently calls lp_servicename() or similar functions. The crash path is: get_referred_path() -> lp_servicenumber() -> usershare_exists() fails (e.g. EACCES) -> free_service_byindex() destroys service -> later request on same connection -> volume_label() -> lp_servicename() -> FN_LOCAL_SUBSTITUTED_STRING falls back to sDefault.szService (NULL) -> strlen(NULL) -> SIGSEGV Guard both free_service_byindex() call sites with the snum_in_use callback registered in the previous commit. When the service is in use by an active connection, skip the destruction and let the periodic load_usershare_shares() mark-and-sweep handle cleanup safely via its conn_snum_used() check. When snum_in_use is NULL (non-smbd programs), the original behaviour is preserved — services are freed immediately since no connections can exist. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14978 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>
2026-04-14s3:loadparm: add lp_register_snum_in_use_fn() callback registrationJeremy Allison2-0/+17
Add a mechanism for smbd to register a callback that checks whether a service number is currently in use by any active connection. This will be used by subsequent commits to guard free_service_byindex() calls in lp_servicenumber() and other sites that currently destroy services without checking if they are in use, which can leave active connections holding stale service numbers that lead to NULL pointer dereferences. The callback is registered by smbd during smbd_process() startup via connections_snum_used. Non-smbd programs (testparm, net, etc.) leave the callback as NULL, meaning no connections exist and it is always safe to free services. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14978 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>
2026-03-01lib: Remove the "getwd cache"Volker Lendecke1-1/+0
No longer needed Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15param: Simplify check_ad_dc_required_mods()Volker Lendecke1-10/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20lib: Move a variable declaration closer to its useVolker Lendecke1-1/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20loadparm: Simplify canonicalize_servicename()Volker Lendecke1-7/+2
We have strlower_talloc() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20loadparm: Modernize DEBUGsVolker Lendecke1-5/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-15loadparm: add "kdc require canonicalization"Douglas Bagnall1-0/+1
Has no effect yet. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2026-01-15loadparm: Add ‘krb5 acceptor report canonical client name’ optionJennifer Sutton1-0/+1
It is enabled by default, and does nothing as of yet. Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2026-01-07lib: Add timespec_equal()Volker Lendecke1-3/+4
I've just gotten the !=0 vs ==0 wrong. Make comparing timespecs for equality more intuitive. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-20loadparm: add "kdc name match implicit dollar without canonicalization"Douglas Bagnall1-0/+2
This does nothing yet. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-11-13config: add kdc always include pacGary Lockyer1-0/+1
This option over-rides the PA-PAC-REQUEST received from the client. When enabled (the default) a PAC will always be included in the response. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-11-04Remove previous himmelblau integration attemptDavid Mulder1-7/+0
This was a project attempting to integrate Himmelblau into Samba, but it has been abandoned. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Tue Nov 4 09:09:40 UTC 2025 on atb-devel-224
2025-10-10config: add certificate backdating compensationGary Lockyer1-0/+1
When preforming certificate based kerberos authentication (PKINIT) with "strong certificate binding enforcement = compatibility"", for WEAK mappings the certificate issue date must be after the date the user record was created. This parameter relaxes that constraint by allowing the certificate to have been issued up to the specified number of minutes before the user record was created. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-10-10config: add strong certificate binding enforcementGary Lockyer1-0/+2
This parameter controls the enforcement of Windows Certificate bindings as outlined in "KB5014754: Certificate-based authentication changes on Windows domain controllers", when preforming certificate based kerberos authentication (PKINIT) Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-09-11rpc_server: Remove the source4 implementation of wkssvcStefan Metzmacher1-1/+5
This was pretty much a stub anyway Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Sep 11 15:16:17 UTC 2025 on atb-devel-224
2025-08-22param: Add "client smb encryption over quic"Volker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-08-22smbd: Don't request SMB-level encryption over trusted quicVolker Lendecke1-1/+12
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-08-22smbd: Add the "server smb encryption over quic" parameterVolker Lendecke1-0/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-08-22smbd: Pass smbXsrv_connection to lp_server_smb_encrypt()Volker Lendecke2-1/+9
We'll modify the value of "server smb encrypt" when we have a trusted quic transport Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-05-09smbd: Remove the "posix_pathnames" global variableVolker Lendecke2-23/+0
This was only set from the smb1 trans2 call negotiating smb1 unix extensions. This means for none of the callers in cmd_vfs and pysmbd this could ever have been set to "true". The only real caller is init_smb1_request(), and there we have the originating xconn with its flags available for direct query. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2025-04-18docs-xml/smbdotconf: change 'smb ports' into a synonym for 'server smb ↵Stefan Metzmacher1-1/+0
transport' Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18docs-xml/smbdotconf: add 'server smb transport' optionStefan Metzmacher1-0/+1
In the next commits 'smb ports' will become just a synonym for 'server smb transport'... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18docs-xml/smbdotconf: add 'client smb transports' optionStefan Metzmacher1-0/+1
This will replace the use of 'smb ports' for source4 clients. In future it will be used for all smb client connections and it will allow to add other transports as 'quic' or 'smbdirect. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-03-27loadparm: move log message to a higher log levelBjoern Jacke1-1/+1
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-03-07docs-xml: enable SMB3 Unix Extensions by defaultRalph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Mar 7 20:06:31 UTC 2025 on atb-devel-224
2025-03-07s3/param: remove widelinks check and warning for SMB3 UNIX ExtensionsRalph Boehme1-7/+1
SMB3 POSIX clients won't be able to create real symlinks, so we can relax these checks. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-02-22docs-xml/smbdotconf: add ft_scanner to 'server service'Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-01-13docs-xml/smbdotconf: add "client use krb5 netlogon" optionStefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-01-10param: Add API to load registry without share infoVinit Agnihotri2-0/+12
As number of shares increases loading entire registry configuration along with share information becomes very costly operation. Since we may not require share information all time, we can optimise this by using API just loading configuration without any share info. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15780 Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: John Mulligan <jmulligan@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2024-11-11param: Remove parameter "cldap port"Volker Lendecke1-2/+0
This was not used consistently across all of our code base, and I don't see a reason why this should ever not be port 389. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-11-05smbd: add option "smb3 directory leases"Ralph Boehme2-1/+26
By default enabled on non-clustered Samba, disabled on clustered Samba, the reason being the expected additional load caused by forcing strict rename to be enabled. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2024-10-25smbd: convert fsp->posix_flags to fsp->fsp_flags.posix_openRalph Boehme1-1/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Oct 25 11:50:01 UTC 2024 on atb-devel-224
2024-10-23Isolate hsm auth value from the cacheDavid Mulder1-0/+3
Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2024-10-23Add lp Rust bindingsDavid Mulder1-0/+4
Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2024-08-21docs-xml: add 'vfs mkdir use tmp name' optionStefan Metzmacher1-0/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15693 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-07-31loadparm: Add lp_wi_scan_share_parametricsVolker Lendecke2-0/+32
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-31loadparm: Factor out lp_wi_scan_parametricsVolker Lendecke1-6/+19
We'll scan share parametrics soon as well. 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-02s3:param: Check return value of strlower_m() (CID 1598446)Jo Sutton1-1/+5
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Martin Schwenke <martin@meltin.net>
2024-05-22docs-xml: Add smb.conf option 'dns hostname'Andreas Schneider2-0/+36
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@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>
2024-04-15smbdotconf: Enable "winbind debug traceid" by defaultPavel Filipenský1-0/+2
The traceid debug header field is a useful feature, let's make it default. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15631 Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org> Autobuild-Date(master): Mon Apr 15 18:47:41 UTC 2024 on atb-devel-224
2023-12-21s3:param: Remove unnecessary use of discard_const_p()Joseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-27smbd: bring back "smb3 unix extensions" optionRalph Boehme1-1/+7
This basically reverts commit b3cae8dcf192f65031f143e5bb9135c895611d98 with a few important differences: * SMB3 UNIX extensions are always built, but disabled by default at runtime. * They are globally enabled in the fileserver test environment. * It's now a per-share option, so admins can selectively disable them on a per-share basis. This allows clients to detect early that a share doesn't support user mount requested POSIX and fail appropiately, passing the failure to the requesting application (mount command). Signed-off-by: Ralph Boehme <slow@samba.org>
2023-11-20Use python.h from libreplaceAndreas Schneider2-2/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-25lib:param: Set a memory context for the globals if not initialized yetAndreas Schneider1-1/+2
Typically once the smb.conf starts to be loaded, loadparm_s3_init_globals() will be called and a memory context for strings on the static Globals will be created. But we might call lpcfg_set_cmdline() before we load the smb.conf file, so we (via a helper pointer) call loadparm_s3_init_globals() to get that initialisation done earlier, ensuring that all allocations on Globals is done on a memory context that we can later TALLOC_FREE() before exit(). Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-25s3:param: Make init_globals() publicAndreas Schneider2-3/+8
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-25s3:param: Use the memory context we just created instead of tosAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>