]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: is_in_path() deals with a NULL namelist
authorVolker Lendecke <vl@samba.org>
Fri, 1 Sep 2023 11:21:09 +0000 (13:21 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 10 Oct 2023 23:23:40 +0000 (23:23 +0000)
Don't need to check in the callers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_virusfilter.c
source3/smbd/open.c

index b24cc0ea9a9aeb5e3c4664289a754265fdd29b98..ea1886d85c839eb49107926a34b2cf0b4219a547 100644 (file)
@@ -1495,9 +1495,7 @@ static int virusfilter_vfs_close(
                return close_result;
        }
 
-       if (config->exclude_files && is_in_path(fname,
-           config->exclude_files, false))
-       {
+       if (is_in_path(fname, config->exclude_files, false)) {
                DBG_INFO("Not scanned: exclude files: %s/%s\n",
                         cwd_fname, fname);
                return close_result;
index 358131058ccbf9a117d650e716ce8b0ff7d5f747..14434ba6832d3bee2b92f8103f0f2cf5f12d5463 100644 (file)
@@ -1670,9 +1670,9 @@ static NTSTATUS open_file(
        fsp->fsp_flags.modified = false;
        fsp->sent_oplock_break = NO_BREAK_SENT;
        fsp->fsp_flags.is_directory = false;
-       if (conn->aio_write_behind_list &&
-           is_in_path(smb_fname->base_name, conn->aio_write_behind_list,
-                      posix_open ? true: conn->case_sensitive)) {
+       if (is_in_path(smb_fname->base_name,
+                      conn->aio_write_behind_list,
+                      posix_open ? true : conn->case_sensitive)) {
                fsp->fsp_flags.aio_write_behind = true;
        }