]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix uninitialized stack variable + seg fault in label + PoolId in InChanger clear
authorKern Sibbald <kern@sibbald.com>
Thu, 10 Jun 2004 09:45:41 +0000 (09:45 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 10 Jun 2004 09:45:41 +0000 (09:45 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1406 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/cats/sql_update.c
bacula/src/dird/ua_label.c
bacula/src/findlib/bfile.c
bacula/src/findlib/bfile.h
bacula/src/lib/edit.c
bacula/src/stored/append.c
bacula/src/stored/bls.c
bacula/src/version.h

index 79772520f6a8309695fe44a072f2d072710d14a9..e2ead7b6f037aba49266b6005f8b6883cee982a2 100644 (file)
@@ -1,5 +1,18 @@
                  Kern's ToDo List
-                  08 June 2004
+                  10 June 2004
+
+1.34.4 Items to do:
+- Implement SIGHUP in Dir
+- Implement fast tree insert (doubly linked list?)
+- Implement "label slots=1,2... pool=yyy barcodes"
+- Do tape alerts -- see tapealert.txt
+- When restore started from console, report jobid.
+- Feedback while the tree is being built.    
+- On Win95
+   The error I when I installed 1.34.2 clients:
+   The BACULA-FD file is  
+   linked to missing export KERNEL32.DLL:GetFileAttributesExA.
+
 
 Documentation to do: (any release a little bit at a time)
 - Document query file format.
@@ -39,28 +52,15 @@ For 1.33 Testing/Documentation:
 - If you use restore replace=never, the directory attributes for
   non-existent directories will not be restored properly.
 
-1.34 Cleanup
+Wish list:  
 - Add multiple-media-types.txt
 - look at mxt-changer.html
 - Document a get out of jail procedure if everything breaks if you lost/broke
   the Catalog.
-
-1.34.3 Items:
-- Add regression of btape "fill" 
-
-For version 1.35:
-- Implement "label slots=1,2... pool=yyy barcodes"
 - Make ? do a help command (no return needed).
-- Do tape alerts -- see tapealert.txt
 - Implement restore directory.
 - Add All Local Partitions = yes to new style saves.
 - Document streams and how to implement them.
-- On Win95
-   The error I when I installed 1.34.2 clients:
-    The BACULA-FD file is  
-    linked to missing export KERNEL32.DLL:GetFileAttributesExA.
-- When restore started from console, report jobid.
-- Feedback while the tree is being built.    
 - Possibly implement "Ensure Full Backup = yes" looks for a failed full backup
   and upgrades the current backup if one exists.
 - Check that barcode reading and update slots scan works.
@@ -1034,7 +1034,7 @@ Block Position: 0
 ====
 
 
-=== Done in 1.35
+=== Done in 1.34.3
 - To pass Include 1 or two letter commands
   I Name           Include name - first record
   B Name           Base name - repeat
@@ -1059,3 +1059,5 @@ Block Position: 0
   F Number         Number of filenames to follow
   <file-name>
   ...
+- Add regression of btape "fill" 
+
index 7ffad52f60b035d794697a9a7ee725ecf17b8f97..a5364644a06290b05c0fe18dbac0ef6caa5f90cb 100644 (file)
@@ -334,7 +334,7 @@ db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
 
 /* 
  * If we have a non-zero InChanger, ensure that no other Media
- *  record in this Pool has InChanger set on the same Slot.
+ *  record has InChanger set on the same Slot.
  *
  * This routine assumes the database is already locked.
  */
@@ -342,8 +342,8 @@ void
 db_make_inchanger_unique(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr) 
 {
    if (mr->InChanger != 0 && mr->Slot != 0) {
-      Mmsg(&mdb->cmd, "UPDATE Media SET InChanger=0 WHERE PoolId=%u "
-           "AND Slot=%d AND MediaId!=%u", mr->PoolId, mr->Slot, mr->MediaId);
+      Mmsg(&mdb->cmd, "UPDATE Media SET InChanger=0 WHERE "
+           "Slot=%d AND MediaId!=%u", mr->Slot, mr->MediaId);
       Dmsg1(400, "%s\n", mdb->cmd);
       UPDATE_DB(jcr, mdb, mdb->cmd);
    }
index 8c3cd474ff817a12ea019b94e4ccfca61d730f45..1043855b054e653c66333d9e6d9952566283ad05 100644 (file)
@@ -547,6 +547,9 @@ bool is_volume_name_legal(UAContext *ua, char *name)
    return 1;
 }
 
+/*
+ * NOTE! This routine opens the SD socket but leaves it open
+ */
 static int send_label_request(UAContext *ua, MEDIA_DBR *mr, MEDIA_DBR *omr, 
                              POOL_DBR *pr, int relabel, bool media_record_exists)
 {
@@ -583,7 +586,6 @@ static int send_label_request(UAContext *ua, MEDIA_DBR *mr, MEDIA_DBR *omr,
         ok = TRUE;
       } 
    }
-   close_sd_bsock(ua);
    unbash_spaces(mr->VolumeName);
    unbash_spaces(mr->MediaType);
    unbash_spaces(pr->Name);
@@ -754,7 +756,7 @@ static vol_list_t *get_vol_list_from_SD(UAContext *ua, bool scan)
       } else {
         vl->VolName = NULL;
       }
-      Dmsg2(100, "Add slot=%d Vol=%s to list.\n", vl->Slot, NPRT(vl->VolName));
+      Dmsg2(100, "Add slot=%d Vol=%s to SD list.\n", vl->Slot, NPRT(vl->VolName));
       if (!vol_list) {
         vl->next = vol_list;
         vol_list = vl;
index 292c002044464615701f473a579c63a84893d7c4..2ca9bd033787b48f0d27801b9a719c17f9dea1f7 100644 (file)
@@ -101,6 +101,7 @@ extern "C" HANDLE get_osfhandle(int fd);
 
 void binit(BFILE *bfd)
 {
+   memset(bfd, 0, sizeof(BFILE));
    bfd->fid = -1;
    bfd->mode = BF_CLOSED;
    bfd->use_backup_api = have_win32_api();
@@ -412,6 +413,7 @@ off_t blseek(BFILE *bfd, off_t offset, int whence)
  */
 void binit(BFILE *bfd)
 {
+   memset(bfd, 0, sizeof(BFILE));
    bfd->fid = -1;
 }
 
index 0e25f7de5ade068ceed29e4dc00abfd18663aaec..390df8e2b84e47e434dfdb9f153b5992762d21c1 100644 (file)
 #ifndef __BFILE_H
 #define __BFILE_H
 
+/*  =======================================================
+ *
+ *   W I N D O W S 
+ *
+ *  =======================================================
+ */
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
 
 #include <windows.h>
@@ -57,6 +63,13 @@ HANDLE bget_handle(BFILE *bfd);
 
 #else   /* Linux/Unix systems */
 
+/*  =======================================================
+ *
+ *   U N I X 
+ *
+ *  =======================================================
+ */
+
 /* Basic low level I/O file packet */
 struct BFILE {
    int fid;                           /* file id on Unix */
index d1ca7fefbfdeee04912cd07c901cc7818a4eedd5..b6271e6b1cc314490aee6845a6c341a1e7887b1c 100644 (file)
@@ -374,7 +374,7 @@ char *add_commas(char *val, char *buf)
 }
 
 #ifdef TEST_PROGRAM
-void d_msg(char*, int, int, char*, ...)
+void d_msg(const char*, int, int, const char*, ...)
 {}
 int main(int argc, char *argv[])
 {
@@ -390,7 +390,7 @@ int main(int argc, char *argv[])
         continue;
       }
       edit_utime(val, outval);
-      printf("in=%s val=%lld outval=%s\n", str[i], val, outval);
+      printf("in=%s val=%" lld " outval=%s\n", str[i], val, outval);
    }
 }
 #endif
index cffb98a4ad744ad5e1ee916d1555785d03dd3131..407073143698951f5bda6715939fe8d488a64ddf 100644 (file)
@@ -71,6 +71,7 @@ int do_append_data(JCR *jcr)
    }
    dev = dcr->dev;
    block = dcr->block;
+   memset(&rec, 0, sizeof(rec));
 
    Dmsg1(20, "Begin append device=%s\n", dev_name(dev));
 
index 5096907bcaa88e1713f25e66cefc86c51d2067e5..6ac0380bc22b9d9d603e9f3f6c303f887983d0bf 100644 (file)
@@ -352,13 +352,20 @@ static int record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
    if (rec->Stream == STREAM_UNIX_ATTRIBUTES || 
        rec->Stream == STREAM_UNIX_ATTRIBUTES_EX) {
 
+      if (verbose > 1) {
+         char *rtype = "Attributes";
+         Pmsg5(-1, "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n",
+              rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
+      }
       if (!unpack_attributes_record(jcr, rec->Stream, rec->data, attr)) {
-         Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
+        if (!forge_on) {
+            Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
+        }
       }
 
       if (attr->file_index != rec->FileIndex) {
-         Emsg2(M_ERROR_TERM, 0, _("Record header file index %ld not equal record index %ld\n"),
-           rec->FileIndex, attr->file_index);
+         Emsg2(forge_on?M_WARNING:M_ERROR_TERM, 0, _("Record header file index %ld not equal record index %ld\n"),
+              rec->FileIndex, attr->file_index);
       }
 
       attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
@@ -401,6 +408,10 @@ static void get_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sess
    }
    Dmsg5(10, "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n",
         rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
+   if (verbose) {
+      Pmsg5(-1, "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n",
+           rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
+   }
 }
 
 
index cc881883c569cb5f3e58ed2a8b88fc9ada874b23..a27bd1a7f92f3fcc473be9a4a8f615b2fbb54413 100644 (file)
@@ -1,6 +1,6 @@
 /* */
 #undef  VERSION
-#define VERSION "1.34.3"
+#define VERSION "1.34.4"
 #define VSTRING "1"
 #define BDATE   "09 June 2004"
 #define LSMDATE "09Jun04"