From: Kern Sibbald Date: Mon, 12 Jan 2004 21:56:07 +0000 (+0000) Subject: Fix win32 directory permission restore problems X-Git-Tag: Release-1.34.0~165 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=18b2b415e3df7fdde73d01651224ac8f3a212d5a;p=bacula%2Fbacula Fix win32 directory permission restore problems git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1008 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 2034f73c26..c15c6681a9 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -28,6 +28,7 @@ Documentation to do: (any release a little bit at a time) - Create a man page for each binary (Debian package requirement). Testing to do: (painful) +- Test drive polling! - that ALL console command line options work and are always implemented - blocksize recognition code. - Test if rewind at end of tape waits for tape to rewind. @@ -56,24 +57,18 @@ For 1.33 Testing/Documentation: - Add subsections to the Disaster Recovery index section. For 1.33 +- When a file is set for restore, walk back up the chain of + directories, setting them to be restored. +- Figure out a way to set restore on a directory without recursively + decending. (recurse off?). - Add level to estimate command. - Check time/dates printed during restore when using Win32 API. -- Possibly remove the "|| ap == NULL" on lines 123 and 207 of lib/var.c, - which creates compile problems on alpha systems. - var.c:123: no match for `va_list & == long int' -- Check "restore" 3 (JobId), then it asks for Storage resource. Does - it verify that the correct volume is chosen? - Volume "add"ed to Pool gets recycled in first use. VolBytes=0 - Get rid of 0 dates in LastWritten, ... -- Make Bacula "poll a drive". - Fix "llist jobid=xx" where no fileset or client exists. -- Release SQLite 2.8.8 +- Release SQLite 2.8.9 - If a tape is recycled while it is mounted, Stanislav Tvrudy must do an additional mount to deblock the job. -- Notes for final checking of Nic's code: - Could I get you to double check the switch () statements in the - job_check_maxwaittime and job_check_maxruntime functions in - src/dird/job.c? - From Johan Decock: bscan: sql_update.c:65 UPDATE File SET MD5='Ij+5kwN6TFIxK+8l8+/I+A' WHERE FileId=0 bscan: bscan.c:1074 Could not add MD5/SHA1 to File record. ERR=sql_update.c:65 Update problem: affected_rows=0 @@ -1080,3 +1075,13 @@ Done: (see kernsdone for more) +---------+------------+---------------------+-----------+ but perhaps it should fill already used Volumes first, and use Append volumes before Purged, or Recycled, ... +- Possibly remove the "|| ap == NULL" on lines 123 and 207 of lib/var.c, + which creates compile problems on alpha systems. + var.c:123: no match for `va_list & == long int' +- Check "restore" 3 (JobId), then it asks for Storage resource. Does + it verify that the correct volume is chosen? +- Make Bacula "poll a drive". +- Notes for final checking of Nic's code: + Could I get you to double check the switch () statements in the + job_check_maxwaittime and job_check_maxruntime functions in + src/dird/job.c? diff --git a/bacula/src/dird/restore.c b/bacula/src/dird/restore.c index 47e6bd4db2..21ad8c0a2b 100644 --- a/bacula/src/dird/restore.c +++ b/bacula/src/dird/restore.c @@ -329,7 +329,7 @@ End time: %s\n\ Files Restored: %s\n\ Bytes Restored: %s\n\ Rate: %.1f KB/s\n\ -Non-fatal FD Errors: %d\n\ +FD Errors: %d\n\ FD termination status: %s\n\ SD termination status: %s\n\ Termination: %s\n\n"), diff --git a/bacula/src/dird/ua_tree.c b/bacula/src/dird/ua_tree.c index 089eaee403..0a87e265ec 100644 --- a/bacula/src/dird/ua_tree.c +++ b/bacula/src/dird/ua_tree.c @@ -234,9 +234,11 @@ static int markcmd(UAContext *ua, TREE_CTX *tree) bsendmsg(ua, _("No files marked.\n")); return 1; } - for (node = tree->node->child; node; node=node->sibling) { - if (fnmatch(ua->argk[1], node->fname, 0) == 0) { - count += set_extract(ua, node, tree, true); + for (int i=1; i < ua->argc; i++) { + for (node = tree->node->child; node; node=node->sibling) { + if (fnmatch(ua->argk[i], node->fname, 0) == 0) { + count += set_extract(ua, node, tree, true); + } } } if (count == 0) { @@ -494,9 +496,11 @@ static int unmarkcmd(UAContext *ua, TREE_CTX *tree) bsendmsg(ua, _("No files unmarked.\n")); return 1; } - for (node = tree->node->child; node; node=node->sibling) { - if (fnmatch(ua->argk[1], node->fname, 0) == 0) { - count += set_extract(ua, node, tree, false); + for (int i=1; i < ua->argc; i++) { + for (node = tree->node->child; node; node=node->sibling) { + if (fnmatch(ua->argk[i], node->fname, 0) == 0) { + count += set_extract(ua, node, tree, false); + } } } if (count == 0) { diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index fb0b90ab11..23796405bd 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1035,6 +1035,9 @@ static int restore_cmd(JCR *jcr) bail_out: + if (jcr->Errors) { + set_jcr_job_status(jcr, JS_ErrorTerminated); + } /* Send termination status back to Dir */ bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles, edit_uint64(jcr->ReadBytes, ed1), diff --git a/bacula/src/findlib/makepath.c b/bacula/src/findlib/makepath.c index 6404d3a9c1..03c9b07faf 100644 --- a/bacula/src/findlib/makepath.c +++ b/bacula/src/findlib/makepath.c @@ -200,6 +200,12 @@ make_path( re_protect = 0; } +#ifdef HAVE_CYGWIN + /* Because of silly Win32 security, we allow everything */ + tmp_mode = S_IRWXUGO; + re_protect = 0; +#endif + /* If we can record the current working directory, we may be able to do the chdir optimization. */ cwd.do_chdir = !save_cwd(&cwd); @@ -312,7 +318,7 @@ make_path( #endif ) { - Jmsg(jcr, M_ERROR, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"), + Jmsg(jcr, M_WARNING, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"), quote(dirpath), strerror(errno)); } } @@ -326,7 +332,7 @@ make_path( Dmsg1(300, "Final chmod mode=%o\n", mode); } if ((mode & ~S_IRWXUGO) && chmod(basename_dir, mode)) { - Jmsg(jcr, M_ERROR, 0, _("Cannot change permissions of %s: ERR=%s\n"), + Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"), quote(dirpath), strerror(errno)); } @@ -341,8 +347,8 @@ make_path( *(p->dirname_end) = '\0'; Dmsg2(300, "Reset parent mode=%o dir=%s\n", parent_mode, dirpath); if (chmod(dirpath, parent_mode)) { - Jmsg(jcr, M_ERROR, 0, _("Cannot change permissions of %s: ERR=%s\n"), - quote (dirpath), strerror(errno)); + Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"), + quote(dirpath), strerror(errno)); } } } else { @@ -369,11 +375,11 @@ make_path( && errno != EPERM #endif ) { - Jmsg(jcr, M_ERROR, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"), + Jmsg(jcr, M_WARNING, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"), quote(dirpath), strerror(errno)); } if (chmod(dirpath, mode)) { - Jmsg(jcr, M_ERROR, 0, _("Cannot change permissions of %s: ERR=%s\n"), + Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"), quote(dirpath), strerror(errno)); } Dmsg2(300, "pathexists chmod mode=%o dir=%s\n", mode, dirpath); diff --git a/bacula/src/version.h b/bacula/src/version.h index cd5136cf57..244a2b3052 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -2,8 +2,8 @@ #undef VERSION #define VERSION "1.33" #define VSTRING "1" -#define BDATE "11 Jan 2004" -#define LSMDATE "11Jan04" +#define BDATE "12 Jan 2004" +#define LSMDATE "12Jan04" /* Debug flags */ #undef DEBUG