]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix win32 directory permission restore problems
authorKern Sibbald <kern@sibbald.com>
Mon, 12 Jan 2004 21:56:07 +0000 (21:56 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 12 Jan 2004 21:56:07 +0000 (21:56 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1008 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/dird/restore.c
bacula/src/dird/ua_tree.c
bacula/src/filed/job.c
bacula/src/findlib/makepath.c
bacula/src/version.h

index 2034f73c261f99877e2a22a9141d1433012f5464..c15c6681a97cf08e74b6766606ce458866b4df84 100644 (file)
@@ -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?
index 47e6bd4db2c34206031ea43c9ac3a06dd15be1f6..21ad8c0a2b9877f63a53cb3425ad85f7173681aa 100644 (file)
@@ -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"),
index 089eaee403d8a096150f90d708eba3daa23f0373..0a87e265ecf157caf80296d624a91477aee1beaa 100644 (file)
@@ -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) {
index fb0b90ab112edbc7d6220b1da13c172954f6be9c..23796405bd665c26cbdc1c76ed5b69c4b1bcf59c 100644 (file)
@@ -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), 
index 6404d3a9c18edf0365a3942c2c7f1cce35399dc9..03c9b07fafa48ec1285a303974bac6a6806e6cf7 100644 (file)
@@ -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);
index cd5136cf57a442feeafb9322ba6e2a6721015e1e..244a2b30527dc7627a33a3c917a212648aa86156 100644 (file)
@@ -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