]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Eliminate ./configure warning on po directory
authorKern Sibbald <kern@sibbald.com>
Sun, 6 Apr 2008 10:00:46 +0000 (10:00 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 6 Apr 2008 10:00:46 +0000 (10:00 +0000)
kes  Fix bug #1063, reuse of freed ptr in list nextvol.
kes  Release regex compile buffer in filed/job.c
kes  Add proper type of const char in sql_create.c
kes  Turn off debug in daemon termination routines
kes  Move free_volume_list() before devices are freed in stored.c
kes  Fix reference to uninitalized stack variables in bregex.c.
     This should correct bug #1067.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6747 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/po/Makefile.in.in
bacula/src/cats/sql_create.c
bacula/src/dird/dird.c
bacula/src/dird/ua_output.c
bacula/src/filed/filed.c
bacula/src/filed/job.c
bacula/src/lib/bregex.c
bacula/src/stored/stored.c
bacula/src/version.h
bacula/technotes-2.1

index d966318b38a4d05200271b7eb1c7f92870450be8..9ff8751cfbe29ea8035c9d61a6e403aa0274ef17 100644 (file)
@@ -25,6 +25,7 @@ VPATH = @srcdir@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 datadir = @datadir@
+datarootdir = @datarootdir@
 localedir = $(datadir)/locale
 gettextsrcdir = $(datadir)/gettext/po
 
@@ -185,23 +186,23 @@ install-data-yes: all
          for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
            if test -n "$$lc"; then \
              if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
-               link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
-               mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
-               mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
-               (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
-                for file in *; do \
-                  if test -f $$file; then \
-                    ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
-                  fi; \
-                done); \
-               rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+               link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+               mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+               mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+                for file in *; do \
+                  if test -f $$file; then \
+                    ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+                  fi; \
+                done); \
+               rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
              else \
-               if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
-                 :; \
-               else \
-                 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
-                 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
-               fi; \
+               if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+                 :; \
+               else \
+                 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+                 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               fi; \
              fi; \
              rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
              ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
@@ -234,23 +235,23 @@ installdirs-data-yes:
          for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
            if test -n "$$lc"; then \
              if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
-               link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
-               mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
-               mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
-               (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
-                for file in *; do \
-                  if test -f $$file; then \
-                    ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
-                  fi; \
-                done); \
-               rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+               link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+               mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+               mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+                for file in *; do \
+                  if test -f $$file; then \
+                    ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+                  fi; \
+                done); \
+               rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
              else \
-               if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
-                 :; \
-               else \
-                 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
-                 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
-               fi; \
+               if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+                 :; \
+               else \
+                 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+                 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               fi; \
              fi; \
            fi; \
          done; \
index 8ffba95043b5a98dffcef1e49edc1ac25fdfcef8..5e1ee2f26f225f350535990bab1831574a675be6 100644 (file)
@@ -967,7 +967,7 @@ bail_out:
 static int db_create_file_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar)
 {
    int stat;
-   static char *no_digest = "0";
+   static const char *no_digest = "0";
    char *digest;
 
    ASSERT(ar->JobId);
index ba93ce9a1d4f9161c6a2898262f1abb96fb6bf85..4b25176e9336d67fa91fcef0b223aff62b2d5a71 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -324,6 +324,7 @@ void terminate_dird(int sig)
       exit(1);
    }
    already_here = true;
+   debug_level = 0;                   /* turn off debug */
    stop_watchdog();
    generate_daemon_event(NULL, "Exit");
    write_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs));
index 66dc23d51bc69e768d21681ff7fae7ba9a67a988..8eaaf34f1360c0d3aeb05caff4dc93c484328643 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -446,7 +446,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist)
 static bool list_nextvol(UAContext *ua, int ndays)
 {
    JOB *job;
-   JCR *jcr = ua->jcr;
+   JCR *jcr;          
    USTORE store;
    RUN *run;
    time_t runtime;
@@ -463,23 +463,26 @@ static bool list_nextvol(UAContext *ua, int ndays)
    } else {
       job = (JOB *)GetResWithName(R_JOB, ua->argv[i]);
       if (!job) {
-         Jmsg(jcr, M_ERROR, 0, _("%s is not a job name.\n"), ua->argv[i]);
+         Jmsg(ua->jcr, M_ERROR, 0, _("%s is not a job name.\n"), ua->argv[i]);
          if ((job = select_job_resource(ua)) == NULL) {
             return false;
          }
       }
    }
+
+   jcr = new_jcr(sizeof(JCR), dird_free_jcr);
    for (run=NULL; (run = find_next_run(run, job, runtime, ndays)); ) {
       if (!complete_jcr_for_job(jcr, job, run->pool)) {
-         return false;
+         found = false;
+         goto get_out;
       }
       if (!jcr->jr.PoolId) {
-         ua->error_msg(_("Could not Pool Job %s\n"), job->name());
+         ua->error_msg(_("Could not find Pool for Job %s\n"), job->name());
          continue;
       }
       memset(&pr, 0, sizeof(pr));
       pr.PoolId = jcr->jr.PoolId;
-      if (!db_get_pool_record(ua->jcr, ua->db, &pr)) {
+      if (!db_get_pool_record(jcr, jcr->db, &pr)) {
          bstrncpy(pr.Name, "*UnknownPool*", sizeof(pr.Name));
       }
       mr.PoolId = jcr->jr.PoolId;
@@ -494,11 +497,12 @@ static bool list_nextvol(UAContext *ua, int ndays)
             job->name(), pr.Name, level_to_str(run->level), mr.VolumeName);
          found = true;
       }
-      if (jcr->db && jcr->db != ua->db) {
-         db_close_database(jcr, jcr->db);
-         jcr->db = NULL;
-      }
    }
+
+get_out:
+   db_close_database(jcr, jcr->db);
+   jcr->db = NULL;
+   free_jcr(jcr);
    if (!found) {
       ua->error_msg(_("Could not find next Volume for Job %s.\n"),
          job->hdr.name);
index 277e32d9947680bd20be860e9ec2dfb6b4de6c68..34d05191585ca8a315ae2ec46bfe4edc06516012 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -239,6 +239,7 @@ void terminate_filed(int sig)
       exit(1);                        /* prevent loops */
    }
    already_here = true;
+   debug_level = 0;                   /* turn off debug */
    stop_watchdog();
 
    bnet_stop_thread_server(server_tid);
index 03c971d8e8e6836282ba75ce4d3425d8b124f64b..d54a476b3d854e26b86c2e0dc694d841687ec52e 100644 (file)
@@ -289,6 +289,12 @@ void *handle_client_request(void *dirp)
             for (k=0; k<fo->regex.size(); k++) {
                regfree((regex_t *)fo->regex.get(k));
             }
+            for (k=0; k<fo->regexdir.size(); k++) {
+               regfree((regex_t *)fo->regexdir.get(k));
+            }
+            for (k=0; k<fo->regexfile.size(); k++) {
+               regfree((regex_t *)fo->regexfile.get(k));
+            }
             fo->regex.destroy();
             fo->regexdir.destroy();
             fo->regexfile.destroy();
index acba19730cd64f1f894db74e191a10ba78faf854..65fe8884aea6eb06e73fc000d54bffc782b2b101 100644 (file)
@@ -37,7 +37,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2006-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -1466,7 +1466,7 @@ int regcomp(regex_t * bufp, const char *regex, int cflags)
    if (bufp->cflags & REG_ICASE) {
       char *p, *lcase = bstrdup(regex);
       for( p = lcase; *p ; p++) {
-        *p = tolower(*p);
+         *p = tolower(*p);
       } 
       re_compile_pattern(bufp, (unsigned char *)lcase);
       bfree(lcase);
@@ -1480,8 +1480,8 @@ int regcomp(regex_t * bufp, const char *regex, int cflags)
 }
 
 void re_registers_to_regmatch(regexp_registers_t old_regs, 
-                             regmatch_t pmatch[], 
-                             size_t nmatch)
+                              regmatch_t pmatch[], 
+                              size_t nmatch)
 {
    size_t i=0;
    
@@ -1502,7 +1502,9 @@ int regexec(regex_t * preg, const char *string, size_t nmatch,
    int len = strlen(string);
    struct re_registers regs;
    stat = re_search(preg, (unsigned char *)string, len, 0, len, &regs);
-   re_registers_to_regmatch(&regs, pmatch, nmatch);
+   if (stat >= 0) {
+      re_registers_to_regmatch(&regs, pmatch, nmatch);
+   }
    /* stat is the start position in the string base 0 where       
     *  the pattern was found or negative if not found.
     */
@@ -1939,12 +1941,12 @@ int re_search(regex_t * bufp, unsigned char *str, int size, int pos,
    if (bufp->cflags & REG_ICASE) { /* we must use string in lowercase */
       int len = strlen((const char *)str);
       if (!bufp->lcase) {
-        bufp->lcase = get_pool_memory(PM_FNAME);
+         bufp->lcase = get_pool_memory(PM_FNAME);
       }
       check_pool_memory_size(bufp->lcase, len+1);
       unsigned char *dst = (unsigned char *)bufp->lcase;
       while (*string) {
-        *dst++ = tolower(*string++);
+         *dst++ = tolower(*string++);
       }
       *dst = '\0';
       string = (unsigned char *)bufp->lcase;
index bcbd606f15448f7034182e9edab55c75cfbe9ce5..9ec74effae396c7450a02b3fc8c5db33a25987a2 100644 (file)
@@ -541,6 +541,7 @@ void terminate_stored(int sig)
       exit(1);
    }
    in_here = true;
+   debug_level = 0;                   /* turn off any debug */
    stop_watchdog();
 
    if (sig == SIGTERM) {              /* normal shutdown request? */
@@ -584,6 +585,8 @@ void terminate_stored(int sig)
 
    Dmsg1(200, "In terminate_stored() sig=%d\n", sig);
 
+   free_volume_list();
+
    foreach_res(device, R_DEVICE) {
       Dmsg1(10, "Term device %s\n", device->device_name);
       if (device->dev) {
@@ -606,7 +609,6 @@ void terminate_stored(int sig)
    }
    term_msg();
    cleanup_crypto();
-   free_volume_list();
    term_reservations_lock();
    close_memory_pool();
 
index e30b7c1746b5db8c99260ea1ab045402c32459d5..2c44dc8038f818c0d8c29ba2fd872c98163803e9 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 #undef  VERSION
-#define VERSION "2.2.9-b5"
-#define BDATE   "04 April 2008"
-#define LSMDATE "04Apr08"
+#define VERSION "2.2.9-b6"
+#define BDATE   "06 April 2008"
+#define LSMDATE "06Apr08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */
index 98d567553b516a213bd78865cc910c106ab032af..13148860f7741c6d4ef6bae9b0dd975b7cfcdda0 100644 (file)
@@ -1,6 +1,17 @@
               Technical notes on version 2.2
 
 General:
+06Apr08
+kes  Eliminate ./configure warning on po directory 
+kes  Fix bug #1063, reuse of freed ptr in list nextvol.
+kes  Release regex compile buffer in filed/job.c
+kes  Add proper type of const char in sql_create.c
+kes  Turn off debug in daemon termination routines
+kes  Move free_volume_list() before devices are freed in stored.c
+kes  Fix reference to uninitalized stack variables in bregex.c. 
+     This should correct bug #1067.
+04Apr08
+kes  Fix possible seg fault in SD when freeing a volume entry.
 02Apr08
 kes  Apply patch from bug #1069 that corrects spurious error messages
      when ACLs enabled on SGI but no ACL exists.