/*
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.
/*
* 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);
}
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);
}
}
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;
/* 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 */
/*
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.
* 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;
* 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(),
/*
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.
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: "),
-/*
- *
- * 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.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ *
+ * Dumb program to extract files from a Bacula backup.
+ *
+ * Kern E. Sibbald, MM
+ *
+ * Version $Id$
+ *
+ */
#include "bacula.h"
#include "stored.h"
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;
}
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: "),
/*
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.
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: "),
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");
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");
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;
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 */
}
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);
#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 */
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