From: <ke...@us...> - 2008-01-30 12:59:29
|
Revision: 6345 http://bacula.svn.sourceforge.net/bacula/?rev=6345&view=rev Author: kerns Date: 2008-01-30 04:59:34 -0800 (Wed, 30 Jan 2008) Log Message: ----------- kes Apply patch from bug #1049 to prevent stripping the path on a symlink. kes Attempt to fix bug #1047 where stripping a path corrupts the heap. Waiting for feedback. kes Correct the Mount message not to suggest labeling a new tape when doing a restore. Submitted by email by John Stoffel. kes Attempt to work around gcc FORTIFY_SOURCE bug that crashes the FD by using casting. Reported in bug #1042. Modified Paths: -------------- trunk/bacula/src/dird/newvol.c trunk/bacula/src/filed/backup.c trunk/bacula/src/lib/parse_conf.c trunk/bacula/src/stored/acquire.c trunk/bacula/src/stored/askdir.c trunk/bacula/src/stored/bcopy.c trunk/bacula/src/stored/bextract.c trunk/bacula/src/stored/bls.c trunk/bacula/src/stored/bscan.c trunk/bacula/src/stored/btape.c trunk/bacula/src/stored/mount.c trunk/bacula/src/stored/protos.h trunk/bacula/src/version.h trunk/bacula/technotes-2.3 Modified: trunk/bacula/src/dird/newvol.c =================================================================== --- trunk/bacula/src/dird/newvol.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/dird/newvol.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2000-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. Modified: trunk/bacula/src/filed/backup.c =================================================================== --- trunk/bacula/src/filed/backup.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/filed/backup.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -1176,20 +1176,22 @@ /* * Strip path. If it doesn't succeed put it back. If * it does, and there is a different link string, - * attempt to strip the link. If it fails, but them + * attempt to strip the link. If it fails, back them * both back. + * Do not strip symlinks. * I.e. if either stripping fails don't strip anything. */ if (do_strip(ff_pkt->strip_path, ff_pkt->fname)) { - if (ff_pkt->fname != ff_pkt->link) { + /* Strip links but not symlinks */ + if (ff_pkt->type != FT_LNK && ff_pkt->fname != ff_pkt->link) { pm_strcpy(ff_pkt->link_save, ff_pkt->link); if (!do_strip(ff_pkt->strip_path, ff_pkt->link)) { - strcpy(ff_pkt->link, ff_pkt->link_save); - strcpy(ff_pkt->fname, ff_pkt->fname_save); + pm_strcpy(ff_pkt->link, ff_pkt->link_save); + pm_strcpy(ff_pkt->fname, ff_pkt->fname_save); } } } else { - strcpy(ff_pkt->fname, ff_pkt->fname_save); + pm_strcpy(ff_pkt->fname, ff_pkt->fname_save); } Dmsg2(200, "fname=%s stripped=%s\n", ff_pkt->fname_save, ff_pkt->fname); } @@ -1199,8 +1201,8 @@ if (!(ff_pkt->flags & FO_STRIPPATH) || ff_pkt->strip_path <= 0) { return; } - strcpy(ff_pkt->fname, ff_pkt->fname_save); - if (ff_pkt->fname != ff_pkt->link) { - strcpy(ff_pkt->link, ff_pkt->link_save); + pm_strcpy(ff_pkt->fname, ff_pkt->fname_save); + if (ff_pkt->type != FT_LNK && ff_pkt->fname != ff_pkt->link) { + pm_strcpy(ff_pkt->link, ff_pkt->link_save); } } Modified: trunk/bacula/src/lib/parse_conf.c =================================================================== --- trunk/bacula/src/lib/parse_conf.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/lib/parse_conf.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -201,7 +201,7 @@ int i; int rindex = type - r_first; - memset(&res_all, 0, res_all_size); + memset((char *)&res_all, 0, res_all_size); res_all.hdr.rcode = type; res_all.hdr.refcnt = 1; Modified: trunk/bacula/src/stored/acquire.c =================================================================== --- trunk/bacula/src/stored/acquire.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/acquire.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -263,7 +263,7 @@ /* Mount a specific volume and no other */ Dmsg0(200, "calling dir_ask_sysop\n"); - if (!dir_ask_sysop_to_mount_volume(dcr)) { + if (!dir_ask_sysop_to_mount_volume(dcr, ST_READ)) { goto get_out; /* error return */ } try_autochanger = true; /* permit using autochanger again */ Modified: trunk/bacula/src/stored/askdir.c =================================================================== --- trunk/bacula/src/stored/askdir.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/askdir.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2000-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. @@ -553,7 +553,7 @@ * Note, must create dev->errmsg on error return. * */ -bool dir_ask_sysop_to_mount_volume(DCR *dcr) +bool dir_ask_sysop_to_mount_volume(DCR *dcr, int mode) { int stat = W_TIMEOUT; DEVICE *dev = dcr->dev; @@ -582,11 +582,21 @@ * Otherwise skip it. */ if (!dev->poll && (stat == W_TIMEOUT || stat == W_MOUNT)) { - Jmsg(jcr, M_MOUNT, 0, _("Please mount Volume \"%s\" or label a new one for:\n" + char *msg; + if (mode == ST_APPEND) { + msg = _("Please mount Volume \"%s\" or label a new one for:\n" " Job: %s\n" " Storage: %s\n" " Pool: %s\n" - " Media type: %s\n"), + " Media type: %s\n"); + } else { + msg = _("Please mount Volume \"%s\" for:\n" + " Job: %s\n" + " Storage: %s\n" + " Pool: %s\n" + " Media type: %s\n"); + } + Jmsg(jcr, M_MOUNT, 0, msg, dcr->VolumeName, jcr->Job, dev->print_name(), Modified: trunk/bacula/src/stored/bcopy.c =================================================================== --- trunk/bacula/src/stored/bcopy.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/bcopy.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2002-2007 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. @@ -350,7 +350,7 @@ bool dir_send_job_status(JCR *jcr) {return 1;} -bool dir_ask_sysop_to_mount_volume(DCR *dcr) +bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/) { DEVICE *dev = dcr->dev; fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "), Modified: trunk/bacula/src/stored/bextract.c =================================================================== --- trunk/bacula/src/stored/bextract.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/bextract.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -1,16 +1,7 @@ /* - * - * Dumb program to extract files from a Bacula backup. - * - * Kern E. Sibbald, MM - * - * Version $Id$ - * - */ -/* Bacula® - The Network Backup Solution - Copyright (C) 2000-2006 Free Software Foundation Europe e.V. + Copyright (C) 2000-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. @@ -34,6 +25,15 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ft...@fs.... */ +/* + * + * Dumb program to extract files from a Bacula backup. + * + * Kern E. Sibbald, MM + * + * Version $Id$ + * + */ #include "bacula.h" #include "stored.h" @@ -276,15 +276,15 @@ if (is_win32_stream(attr->data_stream) && !have_win32_api()) { set_portable_backup(bfd); if (!processWin32BackupAPIBlock(bfd, data, length)) { - berrno be; - Emsg2(M_ERROR_TERM, 0, _("Write error on %s: %s\n"), - attr->ofname, be.bstrerror()); + berrno be; + Emsg2(M_ERROR_TERM, 0, _("Write error on %s: %s\n"), + attr->ofname, be.bstrerror()); return false; } } else if (bwrite(bfd, data, length) != (ssize_t)length) { berrno be; Emsg2(M_ERROR_TERM, 0, _("Write error on %s: %s\n"), - attr->ofname, be.bstrerror()); + attr->ofname, be.bstrerror()); return false; } @@ -497,7 +497,7 @@ bool dir_send_job_status(JCR *jcr) {return 1;} -bool dir_ask_sysop_to_mount_volume(DCR *dcr) +bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/) { DEVICE *dev = dcr->dev; fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "), Modified: trunk/bacula/src/stored/bls.c =================================================================== --- trunk/bacula/src/stored/bls.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/bls.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2000-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. @@ -454,7 +454,7 @@ int generate_job_event(JCR *jcr, const char *event) { return 1; } -bool dir_ask_sysop_to_mount_volume(DCR *dcr) +bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/) { DEVICE *dev = dcr->dev; fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "), Modified: trunk/bacula/src/stored/bscan.c =================================================================== --- trunk/bacula/src/stored/bscan.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/bscan.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -1292,7 +1292,7 @@ bool dir_send_job_status(JCR *jcr) {return 1;} int generate_job_event(JCR *jcr, const char *event) { return 1; } -bool dir_ask_sysop_to_mount_volume(DCR *dcr) +bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/) { DEVICE *dev = dcr->dev; Dmsg0(20, "Enter dir_ask_sysop_to_mount_volume\n"); Modified: trunk/bacula/src/stored/btape.c =================================================================== --- trunk/bacula/src/stored/btape.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/btape.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -2675,7 +2675,7 @@ return dcr->VolumeName[0] != 0; } -bool dir_ask_sysop_to_mount_volume(DCR *dcr) +bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /* mode */) { DEVICE *dev = dcr->dev; Dmsg0(20, "Enter dir_ask_sysop_to_mount_volume\n"); Modified: trunk/bacula/src/stored/mount.c =================================================================== --- trunk/bacula/src/stored/mount.c 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/mount.c 2008-01-30 12:59:34 UTC (rev 6345) @@ -86,7 +86,7 @@ if (!dev->poll && retry++ > 4) { /* Last ditch effort before giving up, force operator to respond */ dcr->VolCatInfo.Slot = 0; - if (!dir_ask_sysop_to_mount_volume(dcr)) { + if (!dir_ask_sysop_to_mount_volume(dcr, ST_APPEND)) { Jmsg(jcr, M_FATAL, 0, _("Too many errors trying to mount device %s.\n"), dev->print_name()); return false; @@ -162,7 +162,7 @@ Dmsg2(150, "Ask=%d autochanger=%d\n", ask, autochanger); release = true; /* release next time if we "recurse" */ - if (ask && !dir_ask_sysop_to_mount_volume(dcr)) { + if (ask && !dir_ask_sysop_to_mount_volume(dcr, ST_APPEND)) { Dmsg0(150, "Error return ask_sysop ...\n"); return false; /* error return */ } Modified: trunk/bacula/src/stored/protos.h =================================================================== --- trunk/bacula/src/stored/protos.h 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/stored/protos.h 2008-01-30 12:59:34 UTC (rev 6345) @@ -52,7 +52,7 @@ bool dir_find_next_appendable_volume(DCR *dcr); bool dir_update_volume_info(DCR *dcr, bool label, bool update_LastWritten); bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr); -bool dir_ask_sysop_to_mount_volume(DCR *dcr); +bool dir_ask_sysop_to_mount_volume(DCR *dcr, int mode); bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec); bool dir_send_job_status(JCR *jcr); bool dir_create_jobmedia_record(DCR *dcr); Modified: trunk/bacula/src/version.h =================================================================== --- trunk/bacula/src/version.h 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/src/version.h 2008-01-30 12:59:34 UTC (rev 6345) @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.3.8" -#define BDATE "28 January 2008" -#define LSMDATE "28Jan08" +#define BDATE "30 January 2008" +#define LSMDATE "30Jan08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ Modified: trunk/bacula/technotes-2.3 =================================================================== --- trunk/bacula/technotes-2.3 2008-01-30 10:59:09 UTC (rev 6344) +++ trunk/bacula/technotes-2.3 2008-01-30 12:59:34 UTC (rev 6345) @@ -1,6 +1,15 @@ Technical notes on version 2.3 General: +30Jan08 +kes Apply patch from bug #1049 to prevent stripping the path on a + symlink. +kes Attempt to fix bug #1047 where stripping a path corrupts the + heap. Waiting for feedback. +kes Correct the Mount message not to suggest labeling a new tape + when doing a restore. Submitted by email by John Stoffel. +kes Attempt to work around gcc FORTIFY_SOURCE bug that crashes the + FD by using casting. Reported in bug #1042. 28Jan08 kes A bit of crypto cleanup. More later. 25Jan08 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |