From: Volker Lendecke Date: Fri, 1 Sep 2023 11:21:09 +0000 (+0200) Subject: smbd: is_in_path() deals with a NULL namelist X-Git-Tag: tevent-0.16.0~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a77c6b5939585f73746c8eb6db7b7c103a65f5be;p=thirdparty%2Fsamba.git smbd: is_in_path() deals with a NULL namelist Don't need to check in the callers Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_virusfilter.c b/source3/modules/vfs_virusfilter.c index b24cc0ea9a9..ea1886d85c8 100644 --- a/source3/modules/vfs_virusfilter.c +++ b/source3/modules/vfs_virusfilter.c @@ -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; diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 358131058cc..14434ba6832 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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; }