From bd1445445344d4daafa86fd0419770ab8b8acfd0 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 29 Mar 2009 08:01:30 +0000 Subject: [PATCH] kes Correct bacula32.def entry point as specified by James. kes Add code to FD plugin driver to make a copy of the plugin filename to be saved to avoid save_file from zaping it. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8635 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/release-3-status.txt | 1 + bacula/src/filed/fd_plugins.c | 16 ++++++++++++---- bacula/technotes | 4 ++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/bacula/release-3-status.txt b/bacula/release-3-status.txt index e801d08dc8..6074d1fa2f 100644 --- a/bacula/release-3-status.txt +++ b/bacula/release-3-status.txt @@ -24,6 +24,7 @@ Code to be completed before 3.0.0 is released: - is file deleted (at end of job) - Pass accurate flag to Plugin (* this works) * code implemented not yet intgrated into Exchange plugin +4. Possibly change VirtualFull to use same input and output pool. New features implemented: - Accurate Backup diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index e484da73f2..ec6ce7449a 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -214,6 +214,8 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level) char *cmd = ff_pkt->top_fname; struct save_pkt sp; bEvent event; + POOL_MEM fname(PM_FNAME); + POOL_MEM link(PM_FNAME); if (!plugin_list || !jcr->plugin_ctx_list) { return 1; /* Return if no plugins loaded */ @@ -277,15 +279,21 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level) } jcr->plugin_sp = &sp; ff_pkt = jcr->ff; - ff_pkt->fname = sp.fname; - ff_pkt->link = sp.link; + /* + * Copy fname and link because save_file() zaps them. This + * avoids zaping the plugin's strings. + */ + pm_strcpy(fname, sp.fname); + pm_strcpy(link, sp.link); + ff_pkt->fname = fname.c_str(); + ff_pkt->link = link.c_str(); ff_pkt->type = sp.type; memcpy(&ff_pkt->statp, &sp.statp, sizeof(ff_pkt->statp)); - Dmsg1(dbglvl, "Save_file: file=%s\n", ff_pkt->fname); + Dmsg1(dbglvl, "Save_file: file=%s\n", fname.c_str()); save_file(jcr, ff_pkt, true); bRC rc = plug_func(plugin)->endBackupFile(jcr->plugin_ctx); if (rc == bRC_More || rc == bRC_OK) { - accurate_mark_file_as_seen(jcr, ff_pkt->fname); + accurate_mark_file_as_seen(jcr, fname.c_str()); } if (rc == bRC_More) { continue; diff --git a/bacula/technotes b/bacula/technotes index 413b37f035..bcafdbb229 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -1,6 +1,10 @@ Technical notes for current SVN General: +29Mar09 +kes Correct bacula32.def entry point as specified by James. +kes Add code to FD plugin driver to make a copy of the plugin + filename to be saved to avoid save_file from zaping it. 28Mar09 kes Directly mark all files saved by plugin as being seen for Accurate. kes Add checks on the plugin version and the plugin license. Currently -- 2.39.5