summaryrefslogtreecommitdiff
path: root/source3/rpc_server
AgeCommit message (Collapse)AuthorFilesLines
2026-04-14s3:srvsvc: guard lp_killservice() in _srvsvc_NetShareDel() with ↵Jeremy Allison1-1/+3
connections_snum_used check _srvsvc_NetShareDel() unconditionally calls lp_killservice() to destroy the service after deleting a share via RPC. If any active connection is still using this service number, the destroyed service can cause a NULL pointer dereference on subsequent requests. Guard the call with connections_snum_used() so the service is only freed when no connections are using it. The periodic load_usershare_shares() sweep will clean up the stale service once all connections have disconnected. 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/rpc_server: Add worker status smbcontrol message supportNoel Power2-1/+102
Add information about the number of connections a rpc_worker process is handling and when each connection was initiated. command smbcontrol 55063 rpc-dump-worker-status will output data like below: rpcd_spoolss pid 55063: num connections = 2 num_association_groups = 2 last client connection 2026/03/18 06:51:04.482192 last client disconnection 2026/03/18 06:51:00.304951 active connections: [1] endpoint=ncacn_np:[\pipe\spoolss] client addr=192.168.32.175 server=priu0002 connected at 2026/03/18 06:51:04.482192 [2] endpoint=ncacn_np:[\pipe\spoolss] client addr=192.168.33.232 server=priu0002 connected at 2026/03/18 06:47:08.466157 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Tue Apr 14 12:12:07 UTC 2026 on atb-devel-224
2026-04-14rpc_server: Only allocate fsp when counting file locksShwetha Acharya1-10/+10
Avoids creating fsp, which is not needed unless we are going to count the brlocks. Also uses early continue and removes num_locks variable by assigning the result directly. Signed-off-by: Shwetha Acharya <Shwetha.K.Acharya@ibm.com> Reviewed-by: Xavi Hernandez <xhernandez@redhat.com> Reviewed-by: Shweta Sodani <ssodani@redhat.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Tue Apr 14 10:02:29 UTC 2026 on atb-devel-224
2026-04-14rpc_server: Optionally skip "process_exists" when enumerating filesVolker Lendecke1-1/+2
If you want to skip the potentially expensive process_exists calls when enumerating millions of files, set srvsvc : file enum check stale = false in your [global] section of your smb.conf Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Xavi Hernandez <xhernandez@redhat.com> Reviewed-by: Shweta Sodani <ssodani@redhat.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-04-14rpc_server: Optionally skip counting byte range locks when enumerating filesRalph Wuerthner1-6/+11
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Xavi Hernandez <xhernandez@redhat.com> Reviewed-by: Shweta Sodani <ssodani@redhat.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-04-07s3:rpc_server: make epmdb.tdb non readable for othersShwetha Acharya2-2/+2
Signed-off-by: Shwetha Acharya <Shwetha.K.Acharya@ibm.com> Reviewed-by: Xavi Hernandez <xhernandez@redhat.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-13rpc: Don't offer spoolss RPC with "disable spoolss = yes"Volker Lendecke1-0/+5
Bug: https://bugzilla.samba.org/show_bug.cgi?id=16019 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Mar 13 09:00:05 UTC 2026 on atb-devel-224
2026-03-01fss_srv: Use create_conn_struct_chdir()Volker Lendecke1-9/+12
This is the last user of the non-chdir create_conn_struct_tos(). While I don't fully understand the code, this is an RPC server that *should* not care about the current working directory. There are some tests for this in the rpc.fsrvp group of tests, so I don't think this breaks too badly. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01dfssrv: Call create_conn_struct_chdir()Volker Lendecke1-30/+31
This is inside an rpc server, where we don't depend on an implicit current working directory. We don't need the "jump back to old cwd" that create_conn_struct_tos_cwd() provided. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01srvsvc: Call create_conn_struct_chdir()Volker Lendecke1-14/+16
This is inside an rpc server, where we don't depend on an implicit current working directory. We don't need the "jump back to old cwd" that create_conn_struct_tos_cwd() provided. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01eventlog: Use create_conn_struct_chdir()Volker Lendecke1-19/+20
I did not find any use of cwd-dependent calls in this code, the eventlog tdb's are all relative to state_path(), which is absolute. As this is in a rpc server we don't have to preserve any cwd. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01mdssvc: Use create_conn_struct_chdir()Volker Lendecke2-21/+10
Simplify mdssvc by using create_conn_struct_chdir()'s destructor plus the vfs_ChDir_shareroot call. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01smbd: Leave sconn->ev_ctx as NULL for internal fake connectionsVolker Lendecke1-1/+0
These connection_structs are only there to access files like msdfs symlinks or printer driver files. They will never participate in async processing like sending out events or getting delayed for oplocks. Any such use is a bug, because if you look at create_conn_struct_tos() we create an event context that we will never poll on, so events posted there will never finish. Leave the ev_ctx NULL so that we get an early crash instead of running into problems later. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01mdssvc: Align an integer typeVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01smbd: Add vfs_ChDir_shareroot() wrapperVolker Lendecke1-14/+8
Clarify where we just change to the root of the export. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01rpc_server: Move dfs helper routines to srv_dfs_nt.cVolker Lendecke2-1/+501
This makes it clear that these callers of create_conn_struct_tos_cwd() don't really need to chdir() back to whatever cwd the process was in before. RPC servers don't really have a concept of "implicit" current working directory that is assumed to be the root dir of the current share. 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-0/+33
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-12lib: Remove explicitly dropping capabilities before execVolker Lendecke1-6/+0
These calls are not necessary: When setting capabilities, we always remove them from the inheritable set, so they will inevitably be removed at exec-time. Also, these groups of calls were never updated for DAC_OVERRIDE, which would have posed a pretty severe problem. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2026-01-07smbd: Simplify callers of messaging_send()Volker Lendecke1-1/+2
It deals fine with a NULL argument Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-07smbd: Remove the one-line conn_free() wrapper functionVolker Lendecke1-1/+1
In case there's more things to do here we should put it into the destructor. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-12-16mdssvc: make a copy of the elasticsearch:default_fieldsRalph Boehme1-4/+6
lp_parm_const_string() returns a pointer to loadparm state that is not stable across loadparm reloads and hence may later point at random garbage. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15959 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): Tue Dec 16 18:58:07 UTC 2025 on atb-devel-224
2025-11-19mdssvc: support a wider range of years [0000,9999] in $time.isoRalph Boehme2-4/+19
Most importantly use strtoll to allow negative numbers and use a filed width with %Y in strftime() to parse years with less then four digits. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15947 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Wed Nov 19 01:59:34 UTC 2025 on atb-devel-224
2025-11-14s3:mdssvc: Remove support for tracker sparql supportAndreas Schneider10-1637/+0
This only support v2 of tracker sparql which is only avilable on the Ubuntu 20.04 runner. All newer distributions provide only tracker sparql v3. Also the tevent glib stopped working on Fedora 43. Time to remove it. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-11-10lib: Introduce cp_smb_basename() helper functionVolker Lendecke1-6/+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-10dfs_server: Modernize DEBUGsVolker Lendecke1-14/+20
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10dfs_server: Use talloc_asprintf_strlower_m()Volker Lendecke1-6/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10samr_server: Remove an obsolete and confusing commentVolker Lendecke1-15/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10s3: talloc_destroy() -> TALLOC_FREE()Volker Lendecke1-1/+1
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-10-20mdssvc: add support for parsing date rangesRalph Boehme1-0/+7
Example: InRange(kMDItemContentCreationDate,$time.iso(2024-12-31T23:00:00Z),$time.iso(2025-12-31T23:00:00Z)) BUG: https://bugzilla.samba.org/show_bug.cgi?id=15930 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Oct 20 10:59:03 UTC 2025 on atb-devel-224
2025-10-20mdssvc: add a test for parsing Spotlight date rangesRalph Boehme1-0/+3
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15930 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-10-20mdssvc: reduce a log level to DEBUGRalph Boehme1-1/+1
The expression InRange(*,$time.iso(2024-12-31T23:00:00Z),$time.iso(2025-12-31T23:00:00Z)) in a Spotlight query produces the following log message: map_fts: Mapping fts [757378800] unexpected op [~] However, when elasticsearch:ignore unknown attribute = yes is set, the parser will ignore the failed expression and continue parsing given the expression is part of a larger expression like "subexpression1 OR subexpression2". Avoid spamming the log and reduce the loglevel when we hit this case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15930 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-10-10s3/rpc_server: fix "log file = %m"Ralph Boehme2-0/+6
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-10-10mdssvc: implement elasticsearch:default_fieldsRalph Boehme2-8/+22
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15927 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-10-10mdssvc: fix filtering by share path prefixRalph Boehme4-77/+73
To correctly filter by share path, use a filter with a prefix match. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15927 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-10-10mdssvc: fix running test command manuallyRalph Boehme1-1/+8
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15927 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-10-08mdssvc: call mangle_reset_cache()Ralph Boehme1-0/+3
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15931 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): Wed Oct 8 07:54:48 UTC 2025 on atb-devel-224
2025-09-26s3/rpc_server/samr: fix CID 1509008 - time_t truncationXavi Hernandez1-11/+15
The call to get_time_t_max() doesn't work as expected when time_t is a 64-bits type and the returned value is stored into a 32-bits unsigned integer. Truncating a 64-bits constant to a 32-bits number won't return, in general, the same value we would get if time_t were a 32-bits type. It's unsafe and could even return small numbers very far from the intended maximum. This patch completely avoids the need to use get_time_t_max() by assuming that when pwd_max_age is 0 or -1, it means no maximum age is defined, so the password never expires and we don't need to do any comparison. A small adjustment has also been made to avoid calling pdb_get_account_policy() if it's not necessary. Signed-off-by: Xavi Hernandez <xhernandez@gmail.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Fri Sep 26 05:23:30 UTC 2025 on atb-devel-224
2025-09-11rpc_server: Remove the source4 implementation of wkssvcStefan Metzmacher1-29/+0
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-09-11wkssvc3: Return RNG_ERROR where source4 does itVolker Lendecke1-0/+8
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2025-09-11wkssvc3: Return ACCESS_DENIED where source4 does itVolker Lendecke1-0/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2025-09-11samr: Fix CID 1035506: close slave fd (REASOURCE_LEAK)Shachar Sharon1-3/+9
In the case of (unlikely) failure of dup2 on one of the standard file descriptors, close 'slave' fd upon return. Signed-off-by: Shachar Sharon <ssharon@redhat.com> Reviewed-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): Thu Sep 11 13:29:37 UTC 2025 on atb-devel-224
2025-08-15s3/rpc_server/dfs: fix creating a DFS linkRalph Boehme1-1/+3
If there's no existing link, get_referred_path() returns NT_STATUS_OBJECT_PATH_NOT_FOUND. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-08-05s3:netlogon: IPA DC is the PDC as well - allow ROLE_IPA_DC in ↵Pavel Filipenský1-1/+4
_netr_DsRGetForestTrustInformation() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15891 Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-06-16libsmb: Remove "source3/libsmb/libsmb.h"Volker Lendecke1-1/+2
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-06-14rpc_server: Remove a leftover from before str_list_add_printf()Volker Lendecke1-5/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2025-04-28s3:rpc_server: make sure we can bind to the same port on all ip addressesStefan Metzmacher1-33/+81
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15851 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-04-18s3:libsmb: pass struct smb_transports to cli_full_connection_creds()Stefan Metzmacher1-1/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-02s3:rpc_server/srvsvc: use brl_get_locks_readonly() instead of brl_get_locks()Ralph Boehme1-3/+9
No need to keep the record locked longer then needed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15767 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2025-02-22libcli/auth: let NTLMv2_RESPONSE_verify_netlogon_creds() return the ↵Stefan Metzmacher1-1/+3
computer_name This will be used to implement the MS-NRPC 3.5.4.5.1.2 RODC server cachability validation. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-22s3:rpc_server/netlogon: let _netr_NTLMv2_RESPONSE_verify() generate ↵Stefan Metzmacher1-0/+225
trust_forest_domain_info array MS-NRPC 3.5.4.5.1.1 Pass-through domain name validation, requires to pass information about the trust topology to NTLMv2_RESPONSE_verify_netlogon_creds()... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>