From: Radosław Korzeniewski Date: Tue, 16 Mar 2021 10:58:37 +0000 (+0100) Subject: Fix ff_pkt->plug_meta handling. X-Git-Tag: Release-11.3.2~678 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52a656652d659bcf71ef78af4a7fa54e8815fc8e;p=thirdparty%2Fbacula.git Fix ff_pkt->plug_meta handling. The ff_pkt->plug_meta was not cleared after use so the next pass gets garbage failing the job. --- diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index 4964fe10e..b5779fa0b 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -712,7 +712,8 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level) pm_strcpy(fname, sp.fname); pm_strcpy(link, sp.link); - if (sp.plug_meta) { + ff_pkt->plug_meta = NULL; + if (sp.plug_meta){ /* File has some metadata assigned to it */ ff_pkt->plug_meta = sp.plug_meta; } diff --git a/bacula/src/filed/fd_plugins.h b/bacula/src/filed/fd_plugins.h index ce55aa462..232e958b6 100644 --- a/bacula/src/filed/fd_plugins.h +++ b/bacula/src/filed/fd_plugins.h @@ -274,7 +274,7 @@ class plugin_metadata: public SMARTALLOC { /* * This packet is used for file save info transfer. -*/ + */ struct save_pkt { int32_t pkt_size; /* size of this packet */ char *fname; /* Full path and filename */ @@ -299,7 +299,7 @@ struct save_pkt { /* * This packet is used for file restore info transfer. -*/ + */ struct restore_pkt { int32_t pkt_size; /* size of this packet */ bplugin_mode_t plugin_mode; /* Not used anymore, don't remove */ @@ -323,7 +323,7 @@ struct restore_pkt { /* * This packet is used for file restore info transfer. -*/ + */ struct restore_filelist_pkt { int32_t pkt_size; /* size of this packet */ bplugin_mode_t plugin_mode; /* Not used anymore, don't remove */