From: Michal Rakowski Date: Mon, 20 Dec 2021 17:56:47 +0000 (+0100) Subject: Allow plugins to update plugin-specific files attributes X-Git-Tag: Beta-15.0.0~678 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=038afa3379740c531297131b0e2922a9c00c8573;p=thirdparty%2Fbacula.git Allow plugins to update plugin-specific files attributes --- diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index 7682bfa19..9fef5fb93 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -680,6 +680,10 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level) if (plug_func(plugin)->startBackupFile(jcr->plugin_ctx, &sp) != bRC_OK) { goto bail_out; } + + /* Set the flag if the plugin wants to update file's attributues */ + ff_pkt->stat_update = sp.stat_update; + if (sp.type == 0) { Jmsg1(jcr, M_FATAL, 0, _("Command plugin \"%s\": no type in startBackupFile packet.\n"), cmd); diff --git a/bacula/src/filed/fd_plugins.h b/bacula/src/filed/fd_plugins.h index e27e1fdff..23e1362c1 100644 --- a/bacula/src/filed/fd_plugins.h +++ b/bacula/src/filed/fd_plugins.h @@ -298,6 +298,7 @@ struct save_pkt { bool portable; /* set if data format is portable */ bool accurate_found; /* Found in accurate list (valid after check_changes()) */ bool do_dedup; /* True if we deal with a dedup storage system */ + bool stat_update; /* True if only file's metada needds to be updated */ char *cmd; /* command */ struct restore_object restore_obj; /* Info about restore object */ struct plugin_object plugin_obj; /* Plugin Object */