From: Kern Sibbald Date: Sun, 29 Mar 2009 08:01:30 +0000 (+0000) Subject: kes Correct bacula32.def entry point as specified by James. X-Git-Tag: Release-3.0.0~68 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=da762d065219726d4d76061b165346e494d32791;p=bacula%2Fbacula 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 --- 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/src/win32/lib/bacula32.def b/bacula/src/win32/lib/bacula32.def index d020257d10..6048d58506 100644 --- a/bacula/src/win32/lib/bacula32.def +++ b/bacula/src/win32/lib/bacula32.def @@ -68,7 +68,7 @@ utime ; plugins.o _Z10new_pluginv -_Z12load_pluginsPvS_PKcS1_ +_Z12load_pluginsPvS_PKcS1_PFbP6PluginE _Z14unload_pluginsv _Z19dbg_plugin_add_hookPFvP6PluginP6_iobufE 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