]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_server: Optionally skip "process_exists" when enumerating files
authorVolker Lendecke <vl@samba.org>
Wed, 2 May 2018 14:20:14 +0000 (16:20 +0200)
committerAnoop C S <anoopcs@samba.org>
Tue, 14 Apr 2026 08:57:30 +0000 (08:57 +0000)
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>
source3/rpc_server/srvsvc/srv_srvsvc_nt.c

index 0482dcc68edd4b1a804d3a5603d7c480bf682a9c..5a03daf5f0de7bebd303920231e4175e00573771 100644 (file)
@@ -105,7 +105,8 @@ static int enum_file_fn(struct file_id id,
 
        /* If the pid was not found delete the entry from connections.tdb */
 
-       if ( !process_exists(e->pid) ) {
+       if (lp_parm_bool(-1, "srvsvc", "file enum check stale", true) &&
+           !process_exists(e->pid) ) {
                return 0;
        }