From ba1143328e361e50965be84f0a12a209d0cc71d3 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 26 Sep 2006 19:13:21 +0000 Subject: [PATCH] kes Enhance error message when restoring without bootstrap file. kes Check restored size only for regular files. kes Store Python job level in job record in Dir. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3506 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 5 +++-- bacula/src/dird/pythondir.c | 1 + bacula/src/dird/restore.c | 4 +++- bacula/src/findlib/attribs.c | 2 +- bacula/technotes-1.39 | 3 +++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 3ffb0aed3d..a1b5931462 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -39,8 +39,6 @@ Document: Priority: For 1.39: -- Make sure that the restore options don't permit "seeing" other - Client's job data. -- mostly fixed. - Implement Python event for backing up/restoring a file. - Change dbcheck to tell users to use native tools for fixing broken databases, and to ensure they have the proper indexes. @@ -1691,4 +1689,7 @@ Block Position: 0 is not permitted. - When reading through parts on the DVD, the DVD is mounted and unmounted for each part. +- Make sure that the restore options don't permit "seeing" other + Client's job data. +- Restore of a raw drive should not try to check the volume size. diff --git a/bacula/src/dird/pythondir.c b/bacula/src/dird/pythondir.c index a4138f2b4a..55e092e347 100644 --- a/bacula/src/dird/pythondir.c +++ b/bacula/src/dird/pythondir.c @@ -285,6 +285,7 @@ int job_setattr(PyObject *self, char *attrname, PyObject *value) if (strcmp(strval, joblevels[i].level_name) == 0) { if (joblevels[i].job_type == jcr->JobType) { jcr->JobLevel = joblevels[i].level; + jcr->jr.JobLevel = jcr->JobLevel; return 0; } } diff --git a/bacula/src/dird/restore.c b/bacula/src/dird/restore.c index 49b412c5aa..a5e310888e 100644 --- a/bacula/src/dird/restore.c +++ b/bacula/src/dird/restore.c @@ -70,7 +70,9 @@ bool do_restore(JCR *jcr) Dmsg1(20, "RestoreJobId=%d\n", jcr->job->RestoreJobId); if (!jcr->RestoreBootstrap) { - Jmsg0(jcr, M_FATAL, 0, _("Cannot restore without bootstrap file.\n")); + Jmsg0(jcr, M_FATAL, 0, _("Cannot restore without a bootstrap file.\n" + "You probably ran a restore job directly. All restore jobs must\n" + "be run using the restore command.\n")); restore_cleanup(jcr, JS_ErrorTerminated); return false; } diff --git a/bacula/src/findlib/attribs.c b/bacula/src/findlib/attribs.c index 4c71cc679e..ce8fc960fc 100755 --- a/bacula/src/findlib/attribs.c +++ b/bacula/src/findlib/attribs.c @@ -390,7 +390,7 @@ bool set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd) char ec1[50], ec2[50]; fsize = blseek(ofd, 0, SEEK_END); bclose(ofd); /* first close file */ - if (fsize > 0 && fsize != (off_t)attr->statp.st_size) { + if (attr->type == FT_REG && fsize > 0 && fsize != (off_t)attr->statp.st_size) { Jmsg3(jcr, M_ERROR, 0, _("File size of restored file %s not correct. Original %s, restored %s.\n"), attr->ofname, edit_uint64(attr->statp.st_size, ec1), edit_uint64(fsize, ec2)); diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 5e98be19f3..a9d910f150 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -2,6 +2,9 @@ General: 26Sep06 +kes Enhance error message when restoring without bootstrap file. +kes Check restored size only for regular files. +kes Store Python job level in job record in Dir. kes Add back code to open tape device nonblocking, but if rewind fails release file descriptor. kes Modify acquire.c to first try autoloading the device. Also, ask operator -- 2.39.5