The Samba-Bugzilla – Attachment 16435 Details for
Bug 14634
s3:modules:vfs_virusfilter: Recent talloc changes cause infinite start-up failure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch which fixes the problem. Working through CI on gitlab.com right now.
0001-s3-modules-vfs_virusfilter-Recent-talloc-changes-cau.patch (text/plain), 4.17 KB, created by
Trever Adams
on 2021-02-06 20:01:19 UTC
(
hide
)
Description:
Patch which fixes the problem. Working through CI on gitlab.com right now.
Filename:
MIME Type:
Creator:
Trever Adams
Created:
2021-02-06 20:01:19 UTC
Size:
4.17 KB
patch
obsolete
>From 823ee5e6348f99bdf4cb86c8f6c8ac0ba499a50a Mon Sep 17 00:00:00 2001 >From: "Trever L. Adams" <trever.adams@gmail.com> >Date: Sat, 30 Jan 2021 14:17:03 -0700 >Subject: [PATCH] s3:modules:vfs_virusfilter: Recent talloc changes cause > infinite start-up failure > >Recent talloc changes cause the current check for failure to allocate to be incorrectly triggered. > >This patch checks to see if the original parameter to be checked for NULL if the talloc returns NULL. This allows for rapid passing in the case of correct parameters. In the valid case where come parameters are NULL, it takes a bit longer, but does not incorrectly fail. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14634 >RN: Fix failure of vfs_virusfilter starting due to talloc changes > >Signed-off-by: Trever L. Adams <trever.adams@gmail.com> >--- > source3/modules/vfs_virusfilter.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > >diff --git a/source3/modules/vfs_virusfilter.c b/source3/modules/vfs_virusfilter.c >index e0712b99b42..68c92c6661e 100644 >--- a/source3/modules/vfs_virusfilter.c >+++ b/source3/modules/vfs_virusfilter.c >@@ -268,7 +268,8 @@ static int virusfilter_vfs_connect( > infected_file_command = lp_parm_const_string( > snum, "virusfilter", "infected file command", NULL); > config->infected_file_command = talloc_strdup(config, infected_file_command); >- if (config->infected_file_command == NULL) { >+ if (config->infected_file_command == NULL >+ && infected_file_command != NULL) { > DBG_ERR("virusfilter-vfs: out of memory!\n"); > return -1; > } >@@ -276,7 +277,8 @@ static int virusfilter_vfs_connect( > scan_error_command = lp_parm_const_string( > snum, "virusfilter", "scan error command", NULL); > config->scan_error_command = talloc_strdup(config, scan_error_command); >- if (config->scan_error_command == NULL) { >+ if (config->scan_error_command == NULL >+ && scan_error_command != NULL) { > DBG_ERR("virusfilter-vfs: out of memory!\n"); > return -1; > } >@@ -291,7 +293,7 @@ static int virusfilter_vfs_connect( > snum, "virusfilter", "quarantine directory", > tmp ? tmp : "/tmp/.quarantine"); > config->quarantine_dir = talloc_strdup(config, quarantine_dir); >- if (config->quarantine_dir == NULL) { >+ if (config->quarantine_dir == NULL && quarantine_dir != NULL) { > DBG_ERR("virusfilter-vfs: out of memory!\n"); > return -1; > } >@@ -312,7 +314,7 @@ static int virusfilter_vfs_connect( > snum, "virusfilter", "quarantine prefix", > VIRUSFILTER_DEFAULT_QUARANTINE_PREFIX); > config->quarantine_prefix = talloc_strdup(config, quarantine_prefix); >- if (config->quarantine_prefix == NULL) { >+ if (config->quarantine_prefix == NULL && quarantine_prefix != NULL) { > DBG_ERR("virusfilter-vfs: out of memory!\n"); > return -1; > } >@@ -321,7 +323,7 @@ static int virusfilter_vfs_connect( > snum, "virusfilter", "quarantine suffix", > VIRUSFILTER_DEFAULT_QUARANTINE_SUFFIX); > config->quarantine_suffix = talloc_strdup(config, quarantine_suffix); >- if (config->quarantine_suffix == NULL) { >+ if (config->quarantine_suffix == NULL && quarantine_suffix != NULL) { > DBG_ERR("virusfilter-vfs: out of memory!\n"); > return -1; > } >@@ -359,7 +361,7 @@ static int virusfilter_vfs_connect( > snum, "virusfilter", "rename prefix", > VIRUSFILTER_DEFAULT_RENAME_PREFIX); > config->rename_prefix = talloc_strdup(config, rename_prefix); >- if (config->rename_prefix == NULL) { >+ if (config->rename_prefix == NULL && rename_prefix != NULL) { > DBG_ERR("virusfilter-vfs: out of memory!\n"); > return -1; > } >@@ -368,7 +370,7 @@ static int virusfilter_vfs_connect( > snum, "virusfilter", "rename suffix", > VIRUSFILTER_DEFAULT_RENAME_SUFFIX); > config->rename_suffix = talloc_strdup(config, rename_suffix); >- if (config->rename_suffix == NULL) { >+ if (config->rename_suffix == NULL && rename_suffix != NULL) { > DBG_ERR("virusfilter-vfs: out of memory!\n"); > return -1; > } >@@ -411,7 +413,7 @@ static int virusfilter_vfs_connect( > socket_path = lp_parm_const_string( > snum, "virusfilter", "socket path", NULL); > config->socket_path = talloc_strdup(config, socket_path); >- if (config->socket_path == NULL) { >+ if (config->socket_path == NULL && socket_path != NULL) { > DBG_ERR("virusfilter-vfs: out of memory!\n"); > return -1; > } >-- >2.29.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14634
:
16435
|
16475
|
16482