]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix ff_pkt->plug_meta handling.
authorRadosław Korzeniewski <radoslaw@korzeniewski.net>
Tue, 16 Mar 2021 10:58:37 +0000 (11:58 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:00 +0000 (09:03 +0100)
The ff_pkt->plug_meta was not cleared after use so the
next pass gets garbage failing the job.

bacula/src/filed/fd_plugins.c
bacula/src/filed/fd_plugins.h

index 4964fe10e1f7f25499d2eb1013599cc3d537a478..b5779fa0b64e38149bc49e0414aaa04038e27144 100644 (file)
@@ -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;
             }
index ce55aa4626d5cabcff290aaa367976d47fe6f83a..232e958b6582154013fc35977964f53e0e32edec 100644 (file)
@@ -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 */