vfs_aio_pthread: don't crash without a pthreadpool
authorStefan Metzmacher <metze@samba.org>
Tue, 2 May 2023 13:15:16 +0000 (15:15 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 21 Jun 2023 23:24:37 +0000 (23:24 +0000)
During 'samba-tool ntacl sysvolreset' and similar.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/modules/vfs_aio_pthread.c

index 5d051b4f7da67c9abd406131aff74eeeba4f8466..428ae5f2a4cae01fc97f1774d32b44b6b7198b77 100644 (file)
@@ -468,6 +468,13 @@ static int aio_pthread_openat_fn(vfs_handle_struct *handle,
                return -1;
        }
 
+       if (fsp->conn->sconn->pool == NULL) {
+               /*
+                * a threadpool is required for async support
+                */
+               aio_allow_open = false;
+       }
+
        if (fsp->conn->sconn->client->server_multi_channel_enabled) {
                /*
                 * This module is not compatible with multi channel yet.