-2002-mm-dd Version 1.28 (not yet released)
-
+2003-01-04 Version 1.28 released
 General:
 - Implemented Bare Metal Recovery for Linux and manual procedures for Solaris
 - Now using only a single technotes file kes-1.28 and will add to
   tape drivers.
 
 Changes submitted this submission:
+04Jan03
+- Add cygreadline5.dll to Win32 release -- needed for console
 03Jan03
 - Add scripts make_catalog_backup and delete_catalog_backup that makes and
   deletes an ASCII copy of the catalog for backup. An example of how
 
           Release Notes for Bacula 1.28
 
-  Bacula code: Total files = 226 Total lines = 61,863 (*.h *.c *.in)
+  Bacula code: Total files = 228 Total lines = 62,042 (*.h *.c *.in)
 
 Major Changes this Release:
 - Bare Metal Recovery mostly automated for Linux systems and 
 - Schedule permits specification of 1st, 2nd, ... week e.g.
   1st Sun ...
 
-Minor Changes this Release:
+Other Changes this Release:
 - Allow backup of raw partitions.
 - Fixed Restore options (never,ifnewer, ...). They now work.
-- New bidirectional timed pipe mechanism for running child processes
-  permits better error messages.
+- Added a --enable-client-only    option that will cause "make" to only
+  build the File daemon and the libraries it needs.
+- Documented how to save the Catalog database (with included script).
 - Faster Storage daemon initialization (using pthreads)
 - Unlimited devices in Storage daemon (previously hard coded to 20).
 - Fixed bug that recognized only the last option specified on Include record.
 - User supplied script for Sun-desktop autoloader (examples/devices).
 - Added configure options for building static versions of the 
   daemons and the console program.
-- Added a --enable-client-only    option that will cause "make" to only
-  build the File daemon and the libraries it needs.
-- Documented how to save the Catalog database (with included script).
+- New bidirectional timed pipe mechanism for running child processes
+  permits better error messages.
+- Removed last restrictions on filename length for catalog items. Previous
+  maximum was 500 chars for path and 500 chars for filename. Now unlimited.
+- Improvements all over the code to prevent string overflows and to ensure
+  that copied strings are properly terminated.
+- Improved handling of 64 bit integers especially concerning the DB.
+- Database now contains accurate tape file/block positions, and many other
+  DB items are more correctly handled.
+- Improved bootstrap record generation (more detail).
 
 Items to note:
 - Nothing in particular.
 
                  Kern's ToDo List
-                 01 January 2003 
+                 04 January 2003 
 
 Documentation to do: (a little bit at a time)
 - Document running a test version.
-- Make sure restore options are documented
 - Document query file format.
 - Document static linking
-- Document nofollow flag
 
 Testing to do: (painful)
 - that console command line options work
 - Figure out how to allow multiple simultaneous file Volumes on
   a single device.
 - Why are save/restore of device different sizes (sparse?)
-- Backup of raw partitions
+- Make sure differential handled correctly
 
 For 1.29 release:
+- Cancel does not work for restore in FD.
+- Restore to a particular time -- e.g. before date, after date. 
 - Implement SHA1
 - Implement disk spooling
 - Implement finer multiprocessing options.
 - Solaris -I on tar for include list
-- Add whereln to where or not where absolute links
+- Add whereabslinks to where or not where absolute links
 - Figure out some way to automatically backup all local partitions
 - Enable avoid backing up archive device (findlib/find_one.c:128)
 - Implement FileOptions (see end of this document)
 - Make hash table for linked files in findlib/find_one.c:161
 - Make bcopy read through bad tape records.
 - Need a verbose mode in restore, perhaps to bsr.
-- Should we dump a SOS when starting a new tape?
 - bscan without -v is too quiet -- perhaps show jobs.
 - Add code to reject whole blocks if not wanted on restore.
 - Implement multiple simultaneous file Volumes on a single device.
 - Restore program that errors in SD due to no tape reports
   OK incorrectly in output.
 - After unmount, if restore job started, ask to mount.
-- Fix db_get_fileset in cats/sql_get.c for multiple records.
-- Fix catalog filename truncation in sql_get and sql_create. Use
-  only a single filename split routine.
 - Make Restore report an error if FD or SD term codes are not OK.
 - Convert all %x substitution variables, which are hard to remember
   and read to %(variable-name).  Idea from TMDA.
 - Add JobLevel in FD status (but make sure it is defined).
 - Make Pool resource handle Counter resources.
 - Remove NextId for SQLite. Optimize.
-- Fix gethostbyname() to use gethostbyname_r()
 - Strip trailing / from Include
 - Move all SQL statements into a single location.
 - Cleanup db_update_media and db_update_pool
 - Add Client FS/OS id (Linux, Win95/98, ...).
 - Test a second language e.g. french.
 - Compare tape to Client files (attributes, or attributes and data) 
-- Restore to a particular time -- e.g. before date, after date. 
 - Make all database Ids 64 bit.
 - Write an applet for Linux.
 - Add estimate to Console commands
 - Fix Win2000 error with no messages during startup.
 - Events : tape has more than xxx bytes.
 - Restrict characters permitted in a Resource name.
-- Complete  code in Bacula Resources -- this will permit
+- Complete code in Bacula Resources -- this will permit
   reading a new config file at any time.
 - Handle ctl-c in Console
 - Implement LabelTemplate (at least first cut).
 - Implement script driven addition of File daemon to config files.
 - Think about how to make Bacula work better with File (non-tape) archives.
 
-- see setgroup and user for Bacula p4-5 of stunnel.c
 - Implement new serialize subroutines
    send(socket, "string", &Vol, "uint32", &i, NULL)
 - Audit all UA commands to ensure that we always prompt where possible.
 - Make database type selectable by .conf files i.e. at runtime
 - gethostbyname failure in bnet_connect() continues
   generating errors -- should stop.
-- Add HOST to Volume label.
 - Set flag for uname -a.  Add to Volume label.
 - Implement throttled work queue.
 - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc)
 - Make bcopy copy with a single tape drive.
 - Permit changing ownership during restore.
 
-- Restore should get Device and Pool information from
-  job record rather than from config.
 - Autolabel should be specified by DIR instead of SD.
 - Find out how to get the system tape block limits, e.g.:
   Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes.  
 =====
 - FD sends unsaved file list to Director at end of job (see
   RFC below).
+- File daemon should build list of files skipped, and then
+  at end of save retry and report any errors.
 - Write a Storage daemon that uses pipes and
   standard Unix programs to write to the tape.
   See afbackup.
   if tape is not valid.
 - Verify from Volume
 - Ensure that /dev/null works
-- File daemon should build list of files skipped, and then
-  at end of save retry and report any errors.
 - Need report class for messages. Perhaps
   report resource where report=group of messages
 - enhance scan_attrib and rename scan_jobtype, and
   fill in code for "since" option 
-- Need to save contents of FileSet to tape?
 - Director needs a time after which the report status is sent
   anyway -- or better yet, a retry time for the job.
   Don't reschedule a job if previous incarnation is still running.
-- Figure out how to save the catalog (possibly a special FileSet).
-- Figure out how to restore the catalog.
 - Some way to automatically backup everything is needed????
 - Need a structure for pending actions:
   - buffered messages
            last update 27 November 2002
 
 Item 1:   Multiple simultaneous Jobs. (done)
-Done
+Done -- Restore part needs better implementation to work correctly
 
   What:   Permit multiple simultaneous jobs in Bacula.
 
 - Implement ./configure --with-client-only
 - Finish up static linking 
 - that restore options work in FD               
+- Backup of raw partitions
+- Document nofollow flag
+- Make sure restore options are documented
+- Should we dump a SOS when starting a new tape? (no -- too complicated)
+- Fix gethostbyname() to use gethostbyname_r() -- no added mutex
+- Add HOST to Volume label.
+- Need to save contents of FileSet to tape? -- no not now
+- Fix db_get_fileset in cats/sql_get.c for multiple records.
+- Fix catalog filename truncation in sql_get and sql_create. Use
+  only a single filename split routine.
+- Figure out how to save the catalog (possibly a special FileSet).
+- Figure out how to restore the catalog.
     
 
         }
         cr->ClientId = atoi(row[0]);
         if (row[1]) {
-           strncpy(cr->Uname, row[1], sizeof(cr->Uname)-2);
-           cr->Uname[sizeof(cr->Uname)-1] = 0;
+           bstrncpy(cr->Uname, row[1], sizeof(cr->Uname));
         } else {
            cr->Uname[0] = 0;         /* no name */
         }
 
             Mmsg1(&mdb->errmsg, _("Error fetching row: %s\n"), sql_strerror(mdb));
         } else {
            fdbr->FileId = (FileId_t)str_to_int64(row[0]);
-           strncpy(fdbr->LStat, row[1], sizeof(fdbr->LStat));
-           fdbr->LStat[sizeof(fdbr->LStat)] = 0;
-           strncpy(fdbr->MD5, row[2], sizeof(fdbr->MD5));
-           fdbr->MD5[sizeof(fdbr->MD5)] = 0;
+           bstrncpy(fdbr->LStat, row[1], sizeof(fdbr->LStat));
+           bstrncpy(fdbr->MD5, row[2], sizeof(fdbr->MD5));
            stat = 1;
         }
       } else {
 
       db_unlock(mdb);
       return 0;
    }
-   strncpy(index, row[0], 28);
-   index[28] = 0;
+   bstrncpy(index, row[0], 28);
    sql_free_result(mdb);
 
    Mmsg(&mdb->cmd,
 
  *     Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 
    localtime_r(&now, &tm);
    /* Use only characters that are permitted in Windows filenames */
    strftime(dt, sizeof(dt), "%Y-%m-%d_%H.%M.%S", &tm); 
-   strncpy(name, base_name, sizeof(name));
+   bstrncpy(name, base_name, sizeof(name));
    name[sizeof(name)-22] = 0;         /* truncate if too long */
    sprintf(jcr->Job, "%s.%s", name, dt); /* add date & time */
    /* Convert spaces into underscores */
 
 
       /* List JOB */
       } else if (strcasecmp(ua->argk[i], _("job")) == 0 && ua->argv[i]) {
-        strncpy(jr.Job, ua->argv[i], MAX_NAME_LENGTH);
-        jr.Job[MAX_NAME_LENGTH-1] = 0;
+        bstrncpy(jr.Job, ua->argv[i], MAX_NAME_LENGTH);
         jr.JobId = 0;
         db_list_job_records(ua->db, &jr, prtit, ua);
 
 
         for (j=i+1; j<ua->argc; j++) {
             if (strcasecmp(ua->argk[j], _("job")) == 0 && ua->argv[j]) {
-              strncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
-              jr.Job[MAX_NAME_LENGTH-1] = 0;
+              bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
               jr.JobId = 0;
               db_get_job_record(ua->db, &jr);
               jobid = jr.JobId;
         int done = FALSE;
         for (j=i+1; j<ua->argc; j++) {
             if (strcasecmp(ua->argk[j], _("job")) == 0 && ua->argv[j]) {
-              strncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
-              jr.Job[MAX_NAME_LENGTH-1] = 0;
+              bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
               jr.JobId = 0;
               db_get_job_record(ua->db, &jr);
               jobid = jr.JobId;
         int done = FALSE;
         for (j=i+1; j<ua->argc; j++) {
             if (strcasecmp(ua->argk[j], _("job")) == 0 && ua->argv[j]) {
-              strncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
-              jr.Job[MAX_NAME_LENGTH-1] = 0;
+              bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
               jr.JobId = 0;
               db_get_job_record(ua->db, &jr);
               jobid = jr.JobId;
 
  */
 
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 
 /* 
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
        len = strlen(fname);
        namebuf_len = len + DEFAULT_NAMEBUF_LEN;
        namebuf = (char *)bmalloc(namebuf_len + 2);
-       strncpy(namebuf, fname, namebuf_len);
+       bstrncpy(namebuf, fname, namebuf_len);
        while (len >= 1 && namebuf[len - 1] == '/')
         len--;
        namebuf[len++] = '/';
 
    char cpath[400], npath[400];
    int len;
 
-   strncpy(my_name, name, sizeof(my_name));
-   my_name[sizeof(my_name)-1] = 0;
+   bstrncpy(my_name, name, sizeof(my_name));
    if (argc>0 && argv && argv[0]) {
       /* strip trailing filename and save exepath */
       for (l=p=argv[0]; *p; p++) {
 
    stat = 1;                         /* good return */
    if ((dev->state & ST_TAPE) && vol->start_file > 0) {
       Dmsg1(200, "====== Got start_file = %d\n", vol->start_file);
+      Jmsg(jcr, M_INFO, 0, _("Forward spacing to file %d.\n"), vol->start_file);
       fsf_dev(dev, vol->start_file);
    }
 
 
 /* */
 #define VERSION "1.28"
 #define VSTRING "1"
-#define DATE    "2 January 2003"
-#define LSMDATE "02Jan03"
+#define DATE    "4 January 2003"
+#define LSMDATE "04Jan03"
 
 /* Debug flags */
 #define DEBUG 1