]> git.sur5r.net Git - bacula/bacula/commitdiff
Add wx-console directory
authorKern Sibbald <kern@sibbald.com>
Tue, 13 Apr 2004 12:50:27 +0000 (12:50 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 13 Apr 2004 12:50:27 +0000 (12:50 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1194 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ReleaseNotes
bacula/src/console/authenticate.c
bacula/src/dird/bacula-dir.conf.in
bacula/src/dird/ua_query.c
bacula/src/lib/smartall.c
bacula/src/stored/spool.c

index 291a24af301f1e54ef666b0a36401ff11a60ab1f..f6ce8e090545ef31a5fb23699ae4592f3d729f49 100644 (file)
@@ -1,8 +1,16 @@
 
-          Release Notes for Bacula 1.34.0
+          Release Notes for Bacula 1.34.1
 
   Bacula code: Total files = 306 Total lines = 91,131 (*.h *.c *.in)
 
+Changes for 1.34.1:  
+- Autochanger users, please note you must add %d to the end of the
+  changer command line in your Device resource in your bacula-sd.conf
+  file.
+- Fixed a crash in the query command.
+- Removed the schedule from the default restore job.
+Release 1.34.0
 Major Features:
 - Data spooling which reduces tape shoe-shine during Inc backups,         
   and permits multiple simultaneous backups without interleaved blocks.
index 5f5be7bfca5bdc704081e23a64132afb8176be5d..09704476498f92c140a21aae77f6232eddb66b0a 100644 (file)
@@ -11,7 +11,7 @@
  *
  */
 /*
-   Copyright (C) 2000, 2001 Kern Sibbald and John Walker
+   Copyright (C) 2001-2004 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
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+   You should have received a copy of the GNU General Public
+   License along with this program; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 
+   MA 02111-1307, USA.
  */
 
 #include "bacula.h"
index f150794933c726f2a90c7cfd90a59885233fd344..25e719882b027b6064f73f1bbe0f0d0ebadd4924 100644 (file)
@@ -68,6 +68,7 @@ Job {
   Client=@hostname@-fd                 
   FileSet="Full Set"                  
   Storage = File                      
+  Pool = Default
   Messages = Standard
   Where = /tmp/bacula-restores
 }
index 970ef5ab52f43cc845c407a39a504e9f1b5c40a9..32f21142664cb99873331d146ceb43c817369ba2 100644 (file)
@@ -32,8 +32,8 @@
 
 extern DIRRES *director;
 
-static char *substitute_prompts(UAContext *ua, 
-                      char *query, char **prompt, int nprompt);
+static POOLMEM *substitute_prompts(UAContext *ua, 
+                      POOLMEM *query, char **prompt, int nprompt);
 
 /*
  * Read a file containing SQL queries and prompt
@@ -50,23 +50,21 @@ static char *substitute_prompts(UAContext *ua,
  */
 int querycmd(UAContext *ua, char *cmd)
 {
-   FILE *fd;
+   FILE *fd = NULL;
    POOLMEM *query = get_pool_memory(PM_MESSAGE);
    char line[1000];
    int i, item, len;
    char *prompt[9];
-   int nprompt;
+   int nprompt = 0;;
    char *query_file = director->query_file;
    
    if (!open_db(ua)) {
-      free_pool_memory(query);
-      return 1;
+      goto bail_out;
    }
    if ((fd=fopen(query_file, "r")) == NULL) {
       bsendmsg(ua, "Could not open %s: ERR=%s\n", query_file,
         strerror(errno));
-      free_pool_memory(query);
-      return 1;
+      goto bail_out;
    }
 
    start_prompt(ua, _("Available queries:\n"));
@@ -77,9 +75,7 @@ int querycmd(UAContext *ua, char *cmd)
       }
    }
    if ((item=do_prompt(ua, "", _("Choose a query"), NULL, 0)) < 0) {
-      fclose(fd);
-      free_pool_memory(query);
-      return 1;
+      goto bail_out;
    }
    rewind(fd);
    i = -1;
@@ -93,15 +89,12 @@ int querycmd(UAContext *ua, char *cmd)
    }
    if (i != item) {
       bsendmsg(ua, _("Could not find query.\n"));
-      fclose(fd);
-      free_pool_memory(query);
-      return 1;
+      goto bail_out;
    }
    query[0] = 0;
    for (i=0; i<9; i++) {
       prompt[i] = NULL;
    }
-   nprompt = 0;
    while (fgets(line, sizeof(line), fd) != NULL) {
       if (line[0] == '#') {
         continue;
@@ -121,11 +114,10 @@ int querycmd(UAContext *ua, char *cmd)
            continue;
         }
       }  
-      query = check_pool_memory_size(query, len + 1);
       if (*query != 0) {
-         strcat(query, " ");
+         pm_strcat(&query, " ");
       }
-      strcat(query, line);
+      pm_strcat(&query, line);
       if (line[len-1] != ';') {
         continue;
       }
@@ -151,6 +143,11 @@ int querycmd(UAContext *ua, char *cmd)
             bsendmsg(ua, "%s\n", query);
         }
    }
+
+bail_out:
+   if (fd) {
+      fclose(fd);
+   }
    free_pool_memory(query);
    for (i=0; i<nprompt; i++) {
       free(prompt[i]);
@@ -159,7 +156,7 @@ int querycmd(UAContext *ua, char *cmd)
 }
 
 static POOLMEM *substitute_prompts(UAContext *ua, 
-                      char *query, char **prompt, int nprompt)
+                      POOLMEM *query, char **prompt, int nprompt)
 {
    char *p, *q, *o;
    POOLMEM *new_query;
index fe8093facb92f38a83acbb1b545ec36bd7fe29fb..c9a333e34bcb4da180381996d782f370a01fbbcb 100644 (file)
@@ -498,6 +498,7 @@ void sm_static(int mode)
  *  so that the memory is allocated through smartalloc.
  */
 
+#ifdef xxx
 void * operator new(size_t size)
 {
 // Dmsg1(000, "new called %d\n", size);
@@ -509,5 +510,6 @@ void operator delete(void *buf)
 // Dmsg1(000, "free called 0x%x\n", buf);
    sm_free(__FILE__, __LINE__, buf);
 }
+#endif
 
 #endif
index e2b2e97784c7ccb06d1dbdc4059fbdecca60e7cc..8c0f92a5dba60d5940b82dc77a2ba0ac360fe2ce 100644 (file)
@@ -160,6 +160,7 @@ static bool close_data_spool_file(JCR *jcr)
    if (spool_stats.data_size < 0) {
       spool_stats.data_size = 0;
    }
+   jcr->dcr->spool_size = 0;
    V(mutex);
 
    make_unique_data_spool_filename(jcr, &name);
@@ -185,18 +186,22 @@ static bool despool_data(DCR *dcr)
    dcr->spooling = false;
    lock_device(dcr->dev);
    dcr->dev_locked = true; 
-   /* Set up a dev structure to read */
+
+   /* Setup a dev structure to read */
    rdev = (DEVICE *)malloc(sizeof(DEVICE));
    memset(rdev, 0, sizeof(DEVICE));
    rdev->dev_name = get_memory(strlen("spool")+1);
    strcpy(rdev->dev_name, "spool");
    rdev->errmsg = get_pool_memory(PM_EMSG);
    *rdev->errmsg = 0;
+   rdev->max_block_size = dcr->dev->max_block_size;
+   rdev->min_block_size = dcr->dev->min_block_size;
    rdev->device = dcr->dev->device;
    rdcr = new_dcr(NULL, rdev);
    rdcr->spool_fd = dcr->spool_fd; 
    rdcr->jcr = jcr;                  /* set a valid jcr */
    block = rdcr->block;
+   Dmsg1(800, "read/write block size = %d\n", block->buf_len);
    lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */
 
    for ( ; ok; ) {