]> git.sur5r.net Git - bacula/bacula/commitdiff
Final changes
authorKern Sibbald <kern@sibbald.com>
Wed, 29 Oct 2003 15:08:41 +0000 (15:08 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 29 Oct 2003 15:08:41 +0000 (15:08 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@789 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ChangeLog
bacula/kernstodo
bacula/src/dird/backup.c
bacula/src/dird/bacula-dir.conf.in
bacula/src/filed/filed.c
bacula/src/filed/win32/bin/README.txt
bacula/src/lib/cram-md5.c
bacula/src/lib/daemon.c
bacula/src/lib/message.c
bacula/src/stored/acquire.c
bacula/src/version.h

index 98bb658ab883ec852cec2a57ee3b19d1b70e87e8..9b85652fdd549a98736a9cb5f37f819790dcc055 100644 (file)
@@ -1,5 +1,9 @@
 
-2003-10-26 Version 1.32c 26Oct03
+2003-10-29 Version 1.32c 29Oct03
+29Oct03
+- Add code to ensure that fds 0,1, and 2 are defined by dup'ing them
+  to /dev/null if necessary.  Mostly for Windows that does not have them.
+- Error check dir_create_jobmedia_record() 2 places in acquire.c
 26Oct03
 - More doc fixes.
 - Make message buffer longer for a status message that was    
index f161f4a27c1198451476ed36a92e7c9bb1fc6c30..ae98c6cda25e7e728e2d666d2d311c2044f0bdd1 100644 (file)
@@ -36,8 +36,43 @@ For 1.33 Testing/Documentation:
 - Add an item to the FAQ about running jobs in different timezones.
                 
 For 1.32c
+- Add Volume name to "I cannot write on this volume because"
 
 For 1.33
+- Write your PID file and chwon root:wheel before drop.
+- Make sure there is no symlink in a file before creating a
+  file (attack).
+- Look at mktemp or mkstemp(3).
+    mktemp and mkstemp create files with predictable names too.  That's
+    not the vulnerability.  The vulnerability is in creating files without
+    using the O_EXCL flag, which means "only create this file if it doesn't
+    exist, including if the file is a dangling symlink."
+
+    It is *NOT* enough to do the equivalent of
+
+      if doesn't exist $filename
+       then create $filename
+
+    because between the test and the create another process could have
+    gotten the CPU and created the file.  You must use atomic functions
+    (those that don't get interrupted by other processes) and O_EXCL is
+    the only way for this particular example.
+- Keep last 5 or 10 completed jobs and show them in a similar
+  list.
+- Make a Running Jobs: output similar to current Scheduled Jobs:
+- Use ioctl() fsf if it exists. Figure out where we are from
+  the mt_status command. Use slow fsf only if other does
+  not work.
+- Add flag to write only one EOF mark on the tape.
+- Mount a tape that is not right for the job (wrong # files on tape)
+  Bacula asks for another tape, fix problems with first tape and
+  say "mount". All works OK, but status shows:
+   Device /dev/nst0 open but no Bacula volume is mounted.
+       Total Bytes=1,153,820,213 Blocks=17,888 Bytes/block=64,502
+       Positioned at File=9 Block=3,951
+   Full Backup job Rufus.2003-10-26_16.45.31 using Volume "DLT-24Oct03" on device /dev/nst0
+       Files=21,003 Bytes=253,954,408 Bytes/sec=2,919,016
+       FDReadSeqNo=192,134 in_msg=129830 out_msg=5 fd=7
 - Automatically create pools, but instead of looking for what
   in in Job records, walk through the pool resources.
 - Check and double check tree code, why does it take so long?
index 2f32d18ce75ae9486c1b6c6529742983f24df156..6fe03e85507db022e8f9575ed25dc8a5240d1058 100644 (file)
@@ -338,8 +338,12 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since, FILESET_DBR *fsr
         VolCount = db_get_job_volume_parameters(jcr, jcr->db, jcr->JobId,
                    &VolParams);
         if (VolCount == 0) {
-            Jmsg(jcr, M_ERROR, 0, _("Could not get Job Volume Parameters. ERR=%s\n"),
-                db_strerror(jcr->db));
+            Jmsg(jcr, M_ERROR, 0, _("Could not get Job Volume Parameters to "      
+                 "update Bootstrap file. ERR=%s\n"), db_strerror(jcr->db));
+            if (jcr->SDJobFiles != 0) {
+               set_jcr_job_status(jcr, JS_ErrorTerminated);
+            }
+
         }
         for (int i=0; i < VolCount; i++) {
            /* Write the record */
index be3f7e3626921a12f634064dfb3f2c21559d54c6..9c00dfbdb4b009ef4497becd9f4e286264b1a771 100644 (file)
@@ -185,7 +185,7 @@ Messages {
 #
 # WARNING! the following will create a file that you must cycle from
 #          time to time as it will grow indefinitely. However, it will
-#          also keep all your messages if the scroll off the console.
+#          also keep all your messages if they scroll off the console.
 #
   append = "@working_dir@/log" = all, !skipped
 }
index 4ad2c704d25120d04c8bb966b358f3410462a2af..1c321e7d7bab7181d98d6cf621485db91a2e8831 100644 (file)
@@ -103,50 +103,50 @@ int main (int argc, char *argv[])
 
    while ((ch = getopt(argc, argv, "c:d:fg:istu:v?")) != -1) {
       switch (ch) {
-         case 'c':                    /* configuration file */
-           if (configfile != NULL) {
-              free(configfile);
-           }
-           configfile = bstrdup(optarg);
-           break;
-
-         case 'd':                    /* debug level */
-           debug_level = atoi(optarg);
-           if (debug_level <= 0) {
-              debug_level = 1; 
-           }
-           break;
-
-         case 'f':                    /* run in foreground */
-           foreground = TRUE;
-           break;
-
-         case 'g':                    /* set group */
-           gid = optarg;
-           break;
-
-         case 'i':
-           inetd_request = TRUE;
-           break;
-         case 's':
-           no_signals = TRUE;
-           break;
-
-         case 't':
-           test_config = TRUE;
-           break;
-
-         case 'u':                    /* set userid */
-           uid = optarg;
-           break;
-
-         case 'v':                    /* verbose */
-           verbose++;
-           break;
-
-         case '?':
-        default:
-           usage();
+      case 'c':                    /* configuration file */
+        if (configfile != NULL) {
+           free(configfile);
+        }
+        configfile = bstrdup(optarg);
+        break;
+
+      case 'd':                    /* debug level */
+        debug_level = atoi(optarg);
+        if (debug_level <= 0) {
+           debug_level = 1; 
+        }
+        break;
+
+      case 'f':                    /* run in foreground */
+        foreground = TRUE;
+        break;
+
+      case 'g':                    /* set group */
+        gid = optarg;
+        break;
+
+      case 'i':
+        inetd_request = TRUE;
+        break;
+      case 's':
+        no_signals = TRUE;
+        break;
+
+      case 't':
+        test_config = TRUE;
+        break;
+
+      case 'u':                    /* set userid */
+        uid = optarg;
+        break;
+
+      case 'v':                    /* verbose */
+        verbose++;
+        break;
+
+      case '?':
+      default:
+        usage();
 
       }  
    }
index 08ab12edd8d6b3f7626c0545c8e69c492de0eda8..cefbf6b158b8b6347a64c6fbf688912a1ff3677e 100644 (file)
@@ -3,7 +3,7 @@
 
 
 This is the binary distribution of Bacula for Win32
-systems (Win95, Win98, WinMe, WinNT, and Win2000).
+systems (Win95, Win98, WinMe, WinXP, WinNT, and Win2000).
 
 INSTALLATION
 
@@ -13,7 +13,7 @@ To install it, please UnZip (or detar) the distribution
 file into your root directory on drive c:\  then follow
 the instructions in the online manual viewable by any
 Internet Browser (Netscape, Microsoft Internet Explorer).
-See  http://www.bacula.net/htm-manual
+See  http://www.bacula.org/rel-manual/index.html
 or get the source release
 
 Bacula (tm) is released under the GPL license (given below).
@@ -41,4 +41,3 @@ cygwin can be found at http://www.cygwin.com
    MA 02111-1307, USA.
 
  */
-
index 948892dc24f9310906c598f66b298d4c8f648839..be1ed8db4c529b3446719b58932b7a502ef53b8a 100644 (file)
@@ -96,6 +96,7 @@ int cram_md5_get_auth(BSOCK *bs, char *password, int ssl_need)
    if (sscanf(mp_chr(bs->msg), "auth cram-md5 %s ssl=%d\n", chal, &ssl_has) != 2) {
       ssl_has = BNET_SSL_NONE;
       if (sscanf(mp_chr(bs->msg), "auth cram-md5 %s\n", chal) != 1) {
+         bnet_fsend(bs, "1999 Authorization failed.\n");
          Dmsg1(100, "Cannot scan challenge: %s\n", bs->msg);
         bmicrosleep(5, 0);
         return 0;
index b5ced0cb795e48cdd239d24a2fbdcdaa4db56120..d56287bdbdcfb9e1324ec7cf224d719d80aaaac3 100644 (file)
@@ -57,17 +57,10 @@ daemon_start()
    setsid();
 
    /* In the PRODUCTION system, we close ALL
-    * file descriptors. It is useful
-    * for debugging to leave the STDOUT ane STDERR open.
+    * file descriptors except stdin, stdout, and stderr.
     */
-   for (i=sysconf(_SC_OPEN_MAX)-1; i >=0; i--) {
-#ifdef DEBUG
-      if (i != STDOUT_FILENO && i != STDERR_FILENO) {
-        close(i);
-      }
-#else 
+   for (i=sysconf(_SC_OPEN_MAX)-1; i >= 3; i--) {
       close(i);
-#endif
    }
 
    /* Move to root directory. For debug we stay
index dc7c4723ff7fc8897c6199a84035c89734ffb685..98c03a86b5ea74c4903f4b66502839dbea80a0be 100755 (executable)
@@ -158,12 +158,29 @@ void
 init_msg(JCR *jcr, MSGS *msg)
 {
    DEST *d, *dnew, *temp_chain = NULL;
+   int i, fd;
+
+   /*
+    * Make sure we have fd's 0, 1, 2 open
+    *  If we don't do this one of our sockets may open
+    *  there and if we then use stdout, it could
+    *  send total garbage to our socket.
+    *
+    */
+   fd = open("/dev/null", O_RDONLY, 0644);
+   if (fd > 2) {
+      close(fd);
+   } else {
+      for(i=1; fd + i <= 2; i++) {
+        dup2(fd, fd+i);
+      }
+   }
+
 
    /*
     * If msg is NULL, initialize global chain for STDOUT and syslog
     */
    if (msg == NULL) {
-      int i;
       daemon_msgs = (MSGS *)malloc(sizeof(MSGS));
       memset(daemon_msgs, 0, sizeof(MSGS));
       for (i=1; i<=M_MAX; i++) {
index 940b0171f2ee86fa8830a101f295f5aa8507f66e..44e00b6bd7397ff1c76b306b08f6ccad263e81ae 100644 (file)
@@ -294,7 +294,10 @@ int release_device(JCR *jcr, DEVICE *dev)
         /* If we are the only writer, write EOF after job */
         if (dev->state & ST_LABEL) {
             Dmsg0(100, "dir_create_jobmedia_record. Release\n");
-           dir_create_jobmedia_record(jcr);
+           if (!dir_create_jobmedia_record(jcr)) {
+               Jmsg(jcr, M_ERROR, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+              jcr->VolCatInfo.VolCatName, jcr->Job);
+           }
            if (dev_can_write(dev)) {
               weof_dev(dev, 1);
            }
@@ -311,14 +314,17 @@ int release_device(JCR *jcr, DEVICE *dev)
         }
       } else if (dev->state & ST_LABEL) {
          Dmsg0(100, "dir_create_jobmedia_record. Release\n");
-        dir_create_jobmedia_record(jcr);
+        if (!dir_create_jobmedia_record(jcr)) {
+            Jmsg(jcr, M_ERROR, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
+              jcr->VolCatInfo.VolCatName, jcr->Job);
+        }
          Dmsg0(200, "dir_update_vol_info. Release1\n");
         dev->VolCatInfo.VolCatFiles = dev->file;   /* set number of files */
         dev->VolCatInfo.VolCatJobs++;              /* increment number of jobs */
         dir_update_volume_info(jcr, &dev->VolCatInfo, 0); /* send Volume info to Director */
       }
    } else {
-      Jmsg2(jcr, M_ERROR, 0, _("BAD ERROR: release_device %s, Volume %s not in use.\n"), 
+      Jmsg2(jcr, M_ERROR, 0, _("BAD ERROR: release_device %s, Volume \"%s\" not in use.\n"), 
            dev_name(dev), NPRT(jcr->VolumeName));
    }
    detach_jcr_from_device(dev, jcr);
index c4109aae2c3a821e9a61e1c0c5c1c8b4f4329a45..c138161f4a93abb3076cd2e0f00abf433dbf336c 100644 (file)
@@ -2,8 +2,8 @@
 #undef  VERSION
 #define VERSION "1.32c"
 #define VSTRING "1"
-#define BDATE   "26 Oct 2003"
-#define LSMDATE "26Oct03"
+#define BDATE   "29 Oct 2003"
+#define LSMDATE "20Oct03"
 
 /* Debug flags */
 #undef  DEBUG