]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Make sure valid argument passed to str_to_utime() where Arno
authorKern Sibbald <kern@sibbald.com>
Tue, 12 Sep 2006 18:54:42 +0000 (18:54 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 12 Sep 2006 18:54:42 +0000 (18:54 +0000)
     had a seg fault.
kes  Apply Richard Mortimer's patch for bcopy, bextract, and bscan.
     I.e. part of two different patches.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3459 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/lib/btime.c
bacula/src/stored/bcopy.c
bacula/src/stored/bextract.c
bacula/src/stored/bscan.c
bacula/src/version.h
bacula/technotes-1.39

index a3b8cab7f369109be036f6b9def9fe19730e2a41..09954f15acf636576bdc486e5607f1c1aa15fc6a 100644 (file)
@@ -66,6 +66,8 @@ For 1.39:
   .move transfer device=xxx fromslot=yyy toslot=zzz
 
 Low priority:
+- Check to see if jcr->stime is lost during rescheduling of
+  jobs in jobq.c
 - Fix re-read of last block to check if job has actually written
   a block, and check if block was written by a different job
   (i.e. multiple simultaneous jobs writing).
@@ -1684,4 +1686,3 @@ Block Position: 0
     > to the slots keyword, you can apply the enable/disable to any or all volumes.
 - Restricted consoles start in the Default catalog even if it
   is not permitted.
-
index 7011b74a9dda4f83560f9f95c1b3952c75be1a68..0c9facb30d25041581e723365a501dcc7f490b0b 100644 (file)
@@ -105,6 +105,11 @@ utime_t str_to_utime(char *str)
    struct tm tm;
    time_t ttime;
 
+   /* Check for bad argument */
+   if (!str || *str == 0) {
+      return 0;
+   }
+
    if (sscanf(str, "%d-%d-%d %d:%d:%d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
                                         &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
       return 0;
index 9a11c37a3a7b66ef76bc4ffacd78e66ec73c474e..930003ebd77a8287bfedaf5fbb5fd604b4b4f8c4 100644 (file)
@@ -149,6 +149,7 @@ int main (int argc, char *argv[])
    parse_config(configfile);
 
    /* Setup and acquire input device for reading */
+   Dmsg0(100, "About to setup input jcr\n");
    in_jcr = setup_jcr("bcopy", argv[0], bsr, iVolumeName, 1); /* read device */
    if (!in_jcr) {
       exit(1);
@@ -160,6 +161,7 @@ int main (int argc, char *argv[])
    }
 
    /* Setup output device for writing */
+   Dmsg0(100, "About to setup output jcr\n");
    out_jcr = setup_jcr("bcopy", argv[1], bsr, oVolumeName, 0); /* no acquire */
    if (!out_jcr) {
       exit(1);
@@ -168,6 +170,7 @@ int main (int argc, char *argv[])
    if (!out_dev) {
       exit(1);
    }
+   Dmsg0(100, "About to acquire device for writing\n");
    /* For we must now acquire the device for writing */
    lock_device(out_dev);
    if (out_dev->open(out_jcr->dcr, OPEN_READ_WRITE) < 0) {
@@ -274,7 +277,6 @@ static bool record_cb(DCR *in_dcr, DEV_RECORD *rec)
 
 
 /* Dummies to replace askdir.c */
-bool    dir_get_volume_info(DCR *dcr, enum get_vol_info_rw  writing) { return 1;}
 bool    dir_find_next_appendable_volume(DCR *dcr) { return 1;}
 bool    dir_update_volume_info(DCR *dcr, bool relabel) { return 1; }
 bool    dir_create_jobmedia_record(DCR *dcr) { return 1; }
@@ -292,3 +294,12 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
    getchar();
    return true;
 }
+
+bool dir_get_volume_info(DCR *dcr, enum get_vol_info_rw  writing)
+{
+   Dmsg0(100, "Fake dir_get_volume_info\n");
+   bstrncpy(dcr->VolCatInfo.VolCatName, dcr->VolumeName, sizeof(dcr->VolCatInfo.VolCatName));
+   dcr->VolCatInfo.VolCatParts = find_num_dvd_parts(dcr);
+   Dmsg2(500, "Vol=%s num_parts=%d\n", dcr->VolCatInfo.VolCatName, dcr->VolCatInfo.VolCatParts);
+   return 1;
+}
index e64fe471362946cf814f15d7ff78286580fae83c..9c7c0de1b7cd2b3a043e30eca5a879881c38f034 100644 (file)
@@ -458,7 +458,6 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
 }
 
 /* Dummies to replace askdir.c */
-bool    dir_get_volume_info(DCR *dcr, enum get_vol_info_rw  writing) { return 1;}
 bool    dir_find_next_appendable_volume(DCR *dcr) { return 1;}
 bool    dir_update_volume_info(DCR *dcr, bool relabel) { return 1; }
 bool    dir_create_jobmedia_record(DCR *dcr) { return 1; }
@@ -476,3 +475,12 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
    getchar();
    return true;
 }
+
+bool dir_get_volume_info(DCR *dcr, enum get_vol_info_rw  writing)
+{
+   Dmsg0(100, "Fake dir_get_volume_info\n");
+   bstrncpy(dcr->VolCatInfo.VolCatName, dcr->VolumeName, sizeof(dcr->VolCatInfo.VolCatName));
+   dcr->VolCatInfo.VolCatParts = find_num_dvd_parts(dcr);
+   Dmsg2(500, "Vol=%s num_parts=%d\n", dcr->VolCatInfo.VolCatName, dcr->VolCatInfo.VolCatParts);
+   return 1;
+}
index 7b4061554a04d8bd728e6a0a1f4c7fbe158da6ab..85e6c1589999237efd678bbab5034835730c3256 100644 (file)
@@ -1249,7 +1249,6 @@ static JCR *create_jcr(JOB_DBR *jr, DEV_RECORD *rec, uint32_t JobId)
 }
 
 /* Dummies to replace askdir.c */
-bool    dir_get_volume_info(DCR *dcr, enum get_vol_info_rw  writing) { return 1;}
 bool    dir_find_next_appendable_volume(DCR *dcr) { return 1;}
 bool    dir_update_volume_info(DCR *dcr, bool relabel) { return 1; }
 bool    dir_create_jobmedia_record(DCR *dcr) { return 1; }
@@ -1269,3 +1268,12 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
    getchar();
    return true;
 }
+
+bool dir_get_volume_info(DCR *dcr, enum get_vol_info_rw  writing)
+{
+   Dmsg0(100, "Fake dir_get_volume_info\n");
+   bstrncpy(dcr->VolCatInfo.VolCatName, dcr->VolumeName, sizeof(dcr->VolCatInfo.VolCatName));
+   dcr->VolCatInfo.VolCatParts = find_num_dvd_parts(dcr);
+   Dmsg2(500, "Vol=%s num_parts=%d\n", dcr->VolCatInfo.VolCatName, dcr->VolCatInfo.VolCatParts);
+   return 1;
+}
index a5da7b5a1a88fec3ce2845c294776db064c81866..b2b8a8ebc873ec82f128f249671b8ef1a407a911 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.23"
-#define BDATE   "10 September 2006"
-#define LSMDATE "10Sep06"
+#define BDATE   "12 September 2006"
+#define LSMDATE "12Sep06"
 #define BYEAR "2006"       /* year for copyright messages in progs */
 
 /* Debug flags */
index 811d2e2bdd3b49dbe59f4dbddd8bcea3b06d8ebd..2c334df639d4a342fd797c3acd7f843e4f477e89 100644 (file)
@@ -1,6 +1,11 @@
               Technical notes on version 1.39  
 
 General:
+12Sep06
+kes  Make sure valid argument passed to str_to_utime() where Arno
+     had a seg fault.
+kes  Apply Richard Mortimer's patch for bcopy, bextract, and bscan.
+     I.e. part of two different patches.
 11Sep06
 kes  Modify disk changer to simulate some of the error conditions
      of mtx-changer.