From: Kern Sibbald Date: Sat, 20 Dec 2008 10:03:36 +0000 (+0000) Subject: 20Dec08 X-Git-Tag: Release-7.0.0~3599 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2c0d947649e0b821b9de8b3a0b3b06cb22d1ef30;p=bacula%2Fbacula 20Dec08 kes Correct typo in Win32 Makefile editing kes Correct typos in debug output. kes Improved error detection in creating bsrs. kes Add debug code to Win32 restore 19Dec08 kes Fix Win32 build. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8196 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 5ca2141e3d..8a88516bb1 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -1364,20 +1364,25 @@ bool create_restore_bootstrap_file(JCR *jcr) rx.JobIds = (char *)""; rx.bsr->JobId = jcr->previous_jr.JobId; ua = new_ua_context(jcr); - complete_bsr(ua, rx.bsr); + if (!complete_bsr(ua, rx.bsr)) { + goto bail_out; + } rx.bsr->fi = new_findex(); rx.bsr->fi->findex = 1; rx.bsr->fi->findex2 = jcr->previous_jr.JobFiles; jcr->ExpectedFiles = write_bsr_file(ua, rx); if (jcr->ExpectedFiles == 0) { - free_ua_context(ua); - free_bsr(rx.bsr); - return false; + goto bail_out; } free_ua_context(ua); free_bsr(rx.bsr); jcr->needs_sd = true; return true; + +bail_out: + free_ua_context(ua); + free_bsr(rx.bsr); + return false; } /* TODO: redirect command ouput to job log */ diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index e258fce8ad..62dc2d22ed 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1437,7 +1437,7 @@ static int backup_cmd(JCR *jcr) } dir->fsend(OKbackup); - Dmsg1(110, "bfiled>dird: %s", dir->msg); + Dmsg1(110, "filed>dird: %s", dir->msg); /* * Send Append Open Session to Storage daemon @@ -1629,7 +1629,7 @@ static int verify_cmd(JCR *jcr) generate_plugin_event(jcr, bEventLevel, (void *)jcr->get_JobLevel()); generate_plugin_event(jcr, bEventStartVerifyJob); - Dmsg1(110, "bfiled>dird: %s", dir->msg); + Dmsg1(110, "filed>dird: %s", dir->msg); switch (jcr->get_JobLevel()) { case L_VERIFY_INIT: @@ -1647,7 +1647,7 @@ static int verify_cmd(JCR *jcr) * Send Close session command to Storage daemon */ sd->fsend(read_close, jcr->Ticket); - Dmsg1(130, "bfiled>stored: %s", sd->msg); + Dmsg1(130, "filed>stored: %s", sd->msg); /* ****FIXME**** check response */ bget_msg(sd); /* get OK */ @@ -1725,7 +1725,7 @@ static int restore_cmd(JCR *jcr) jcr->prefix_links = prefix_links; dir->fsend(OKrestore); - Dmsg1(110, "bfiled>dird: %s", dir->msg); + Dmsg1(110, "filed>dird: %s", dir->msg); jcr->set_JobType(JT_RESTORE); @@ -1756,7 +1756,7 @@ static int restore_cmd(JCR *jcr) * Send Close session command to Storage daemon */ sd->fsend(read_close, jcr->Ticket); - Dmsg1(130, "bfiled>stored: %s", sd->msg); + Dmsg1(130, "filed>stored: %s", sd->msg); bget_msg(sd); /* get OK */ @@ -1797,12 +1797,12 @@ static int open_sd_read_session(JCR *jcr) * Get ticket number */ if (bget_msg(sd) >= 0) { - Dmsg1(110, "bfiledmsg); + Dmsg1(110, "filedmsg); if (sscanf(sd->msg, OK_open, &jcr->Ticket) != 1) { Jmsg(jcr, M_FATAL, 0, _("Bad response to SD read open: %s\n"), sd->msg); return 0; } - Dmsg1(110, "bfiled: got Ticket=%d\n", jcr->Ticket); + Dmsg1(110, "filed: got Ticket=%d\n", jcr->Ticket); } else { Jmsg(jcr, M_FATAL, 0, _("Bad response from stored to read open command\n")); return 0; diff --git a/bacula/src/findlib/bfile.c b/bacula/src/findlib/bfile.c index f7a65f0b2b..03597b4cd6 100644 --- a/bacula/src/findlib/bfile.c +++ b/bacula/src/findlib/bfile.c @@ -473,13 +473,16 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) free_pool_memory(win32_fname); return bfd->mode == BF_CLOSED ? -1 : 1; } - Dmsg0(50, "=== NOT plugin\n"); + Dmsg0(50, "=== NO plugin\n"); - if (!(p_CreateFileA || p_CreateFileW)) + if (!(p_CreateFileA || p_CreateFileW)) { + Dmsg0(50, "No CreateFileA and no CreateFileW!!!!!\n"); return 0; + } - if (p_CreateFileW && p_MultiByteToWideChar) + if (p_CreateFileW && p_MultiByteToWideChar) { make_win32_path_UTF8_2_wchar(&win32_fname_wchar, fname); + } if (flags & O_CREAT) { /* Create */ if (bfd->use_backup_api) { @@ -492,6 +495,7 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) if (p_CreateFileW && p_MultiByteToWideChar) { // unicode open for create write + Dmsg1(100, "Create CreateFileW=%s\n", win32_fname); bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar, dwaccess, /* Requested access */ 0, /* Shared mode */ @@ -501,6 +505,7 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) NULL); /* TemplateFile */ } else { // ascii open + Dmsg1(100, "Create CreateFileA=%s\n", win32_fname); bfd->fh = p_CreateFileA(win32_fname, dwaccess, /* Requested access */ 0, /* Shared mode */ @@ -523,6 +528,7 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) if (p_CreateFileW && p_MultiByteToWideChar) { // unicode open for open existing write + Dmsg1(100, "Write only CreateFileW=%s\n", win32_fname); bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar, dwaccess, /* Requested access */ 0, /* Shared mode */ @@ -532,6 +538,7 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) NULL); /* TemplateFile */ } else { // ascii open + Dmsg1(100, "Write only CreateFileA=%s\n", win32_fname); bfd->fh = p_CreateFileA(win32_fname, dwaccess, /* Requested access */ 0, /* Shared mode */ @@ -558,6 +565,7 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) if (p_CreateFileW && p_MultiByteToWideChar) { // unicode open for open existing read + Dmsg1(100, "Read CreateFileW=%s\n", win32_fname); bfd->fh = p_CreateFileW((LPCWSTR)win32_fname_wchar, dwaccess, /* Requested access */ dwshare, /* Share modes */ @@ -567,6 +575,7 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) NULL); /* TemplateFile */ } else { // ascii open + Dmsg1(100, "Read CreateFileA=%s\n", win32_fname); bfd->fh = p_CreateFileA(win32_fname, dwaccess, /* Requested access */ dwshare, /* Share modes */ diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index 1371bbc05f..24a25f32d8 100644 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -889,7 +889,7 @@ d_msg(const char *file, int line, int level, const char *fmt,...) if (trace) { if (!trace_fd) { char fn[200]; - bsnprintf(fn, sizeof(fn), "%s/%s.trace", working_directory ? working_directory : ".", my_name); + bsnprintf(fn, sizeof(fn), "%s/%s.trace", working_directory ? working_directory : "./", my_name); trace_fd = fopen(fn, "a+b"); } if (trace_fd) { diff --git a/bacula/src/stored/parse_bsr.c b/bacula/src/stored/parse_bsr.c index b2790e7f6a..3798435217 100644 --- a/bacula/src/stored/parse_bsr.c +++ b/bacula/src/stored/parse_bsr.c @@ -1,14 +1,7 @@ -/* - * Parse a Bootstrap Records (used for restores) - * - * Kern Sibbald, June MMII - * - * Version $Id$ - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2002-2006 Free Software Foundation Europe e.V. + Copyright (C) 2002-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -32,6 +25,13 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * Parse a Bootstrap Records (used for restores) + * + * Kern Sibbald, June MMII + * + * Version $Id$ + */ #include "bacula.h" diff --git a/bacula/src/version.h b/bacula/src/version.h index 68dfa653bf..11feae3fe4 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.5.24" -#define BDATE "16 December 2008" -#define LSMDATE "16Dec08" +#define VERSION "2.5.25" +#define BDATE "20 December 2008" +#define LSMDATE "20Dec08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index b57b9ecaaa..a2b6607762 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -10,7 +10,13 @@ filepattern (restore with regex in bsr) mixed priorities General: +20Dec08 +kes Correct typo in Win32 Makefile editing +kes Correct typos in debug output. +kes Improved error detection in creating bsrs. +kes Add debug code to Win32 restore 19Dec08 +kes Fix Win32 build. ebl Cleanup director VolParam struct 18Dec08 ebl Replace File:Block in BSR by Address to fix #1190