[pkg-bacula-commits] [bacula] 01/01: Imported Upstream version 7.4.3+dfsg

Carsten Leonhardt leo at moszumanska.debian.org
Mon Jul 18 10:31:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

leo pushed a commit to branch upstream
in repository bacula.

commit f0deb2f706ff074f0f5af711170e15e3912124e9
Author: Carsten Leonhardt <leo at debian.org>
Date:   Mon Jul 18 12:22:59 2016 +0200

    Imported Upstream version 7.4.3+dfsg
---
 ChangeLog                          | 23 ++++++++++++++++++++++-
 LICENSE                            | 25 +++++++++++++------------
 LICENSE-FOSS                       | 27 +++++++++++++--------------
 ReleaseNotes                       | 36 +++++++++++++++++++++++++++++++++++-
 src/cats/grant_mysql_privileges.in | 10 +++++++++-
 src/cats/make_mysql_tables.in      | 16 +++++++++++++---
 src/dird/dird_conf.c               | 31 +++++++++++++++++++++++--------
 src/dird/fd_cmds.c                 |  5 ++++-
 src/dird/ua_cmds.c                 |  6 ++++--
 src/dird/ua_dotcmds.c              |  2 +-
 src/dird/ua_purge.c                |  2 ++
 src/dird/ua_status.c               |  2 +-
 src/filed/status.c                 |  2 +-
 src/lib/alist.h                    |  5 ++---
 src/lib/breg.c                     |  6 ++++--
 src/lib/bsock.c                    |  3 ---
 src/lib/edit.c                     | 19 +++++++++++--------
 src/lib/parse_conf.c               | 24 ++++++++++++++++++++++--
 src/lib/smartall.h                 |  6 ++----
 src/stored/autochanger.c           |  4 ++--
 src/stored/status.c                |  2 +-
 src/tools/bsmtp.c                  |  2 +-
 src/version.h                      |  6 +++---
 23 files changed, 189 insertions(+), 75 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1585647..1e15ff4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
-              Changelog on version 7.4.2
+              Changelog on version 7.4.3
+
+Release version 7.4.3
+
+17Jul16
+ - Add shortcut to RunScript console commands. Submitted by Wanderlei Huttel. 
+   Fixes bug #2224
+ - Fail when multiple mailcommand and other strings are specified in .conf. Fixes 
+   bug #2222
+ - Add support for terabytes in sizes. Submitted by Wanderlei Huttel. Fixes bug 
+   #2223
+ - Add error message for truncate command when actiononpurge not set. Fixes bug 
+   #2221
+14Jul16
+ - Fix optimization error with GCC 6.1
+ - Fix compilation warnings with GCC 6.1
+13Jul16
+ - Explicitly create MySQL user in grant_mysql_privileges.in
 
+Bugs fixed/closed since last release:
+2221 2222 2223 2224
+
+=====================================================================
 
 Release version 7.4.2
 
diff --git a/LICENSE b/LICENSE
index 8f657c3..6f339a7 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,6 @@
 
-             Last revision: 06 May 2014
+             Last major revision: 06 May 2014
+             Last minor revision: 16 July 2016
 
 Bacula is licensed under the GNU Affero General Public License, version
 3.0 as published by the Free Software Foundation, Inc. ("AGPLv3").
@@ -26,7 +27,7 @@ General Public License are as follows:
 
    Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2000-2015 Kern Sibbald
+   Copyright (C) 2000-2016 Kern Sibbald
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
@@ -61,28 +62,28 @@ AGPLv3 are as follows:
 The copyright for certain source files may include in addition to what is
 listed above the following copyright:
 
-   Copyright (C) 2000-2015 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2016 Free Software Foundation Europe e.V.
 
 The copyright on the Baculum code is:
 
-   Copyright (C) 2013-2015 Marcin Haba
+   Copyright (C) 2013-2016 Marcin Haba
 
-Copyrights of certain "script" files such as headers, shell script, Makefiles,
-etc ... were never explicitly defined. In almost all cases, they have
-been copyrighted with a BSD 2-Clause copyright to make them easier. However,
-as is the case of all BSD type copyrights you must keep the copyright in
-place and on any binary only released the copyright notice must also be
-released with the binaries.  An example of such a copyright is:
+Copyrights of certain "script" files such as headers, shell script,
+Makefiles, etc ...  were previously not explicitly defined.  In almost all
+cases, they are now copyrighted with a BSD 2-Clause copyright to make them
+easier.  However, as is the case of all BSD type copyrights you must keep
+the copyright in place and on any binary only released, the copyright notice
+must also be released with the binaries.  An example of such a copyright is:
 
 #
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2016 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 
 It is equivalent to the full BSD copyright of:
 
 =====
-Copyright (C) 2000-2015 Kern Sibbald
+Copyright (C) 2000-2016 Kern Sibbald
 License: BSD 2-Clause; see file LICENSE-FOSS
 
 Redistribution and use in source and binary forms, with or without
diff --git a/LICENSE-FOSS b/LICENSE-FOSS
index 1e22e24..ad7bbb7 100644
--- a/LICENSE-FOSS
+++ b/LICENSE-FOSS
@@ -45,24 +45,23 @@ sufficient copyright rights in its Contribution, if any, to grant
 the copyright license set forth in the LICENSE file..
 
 Notices:
-The Bacula community version uses a certain number of files that have
-FOSS (Free or Open Software) licenses.  Many of these files come from and are
-identical to the Bacula community code.  Most 3rd party FOSS licenses require
-no notification so they are not included here. 
-
-However, the Bacula Community binary releases consist of 
-files, with few source files (mostly scripts), and some of the FOSS licenses
-such such as the BSD (Berkeley Software Development) require publication of
-the copyright notices if the code is released in binary format.  For example
+The Bacula community version uses a certain number of files that have FOSS
+(Free or Open Software) licenses.  Most 3rd party FOSS licenses require no
+notification so they are not included here.
+
+However, the Bacula Community binary releases consist of files, with few
+source files (mostly scripts), and some of the FOSS licenses such such as
+the BSD (Berkeley Software Development) require publication of the
+copyright notices if the code is released in binary format.  For example
 certain copyright notifications are simplifed such as:
 
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2016 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 
 This license corresponds to the following:
 
 =====
-Copyright (C) 2000-2015 Kern Sibbald
+Copyright (C) 2000-2016 Kern Sibbald
 License: BSD 2-Clause; see file LICENSE-FOSS
 
 Redistribution and use in source and binary forms, with or without
@@ -109,15 +108,15 @@ Manpages:
 This man page document is released under the BSD 2-Clause license.
 
 Update datbase (updatedb):
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2016 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 
 Scripts (scripts):
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2016 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 
 Platforms (platforms):
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2016 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 
 Libraries (src/lib):
diff --git a/ReleaseNotes b/ReleaseNotes
index 6923339..e96f41e 100644
--- a/ReleaseNotes
+++ b/ReleaseNotes
@@ -1,5 +1,39 @@
 
-               Release Notes for Bacula 7.4.2
+               Release Notes for Bacula 7.4.3
+
+Release version 7.4.3
+
+This is a bug fix release. Most importantly, it fixes the new
+GCC 6.0 aggressive compiler behavior that elides (deletes) code 
+written by the Bacula developers.  There is no benefit to the
+new GCC agressive optimization and it breaks a lot of programs
+including Bacula.  This problem showed up on ArchLinux and Fedora 24.
+
+17Jul16
+ - Add LICENSE and LICENSE-FOSS files to the documentation
+ - Add shortcut to RunScript console commands. Submitted by Wanderlei Huttel. 
+   Fixes bug #2224
+ - Fail when multiple mailcommand and other strings are specified in .conf. Fixes 
+   bug #2222
+ - Add support for terabytes in sizes. Submitted by Wanderlei Huttel. Fixes bug 
+   #2223
+ - Add error message for truncate command when actiononpurge not set. Fixes bug 
+   #2221
+ - Fix optimization error with GCC 6.1
+ - Fix compilation warnings with GCC 6.1
+ - Explicitly create MySQL user in grant_mysql_privileges.in
+
+Bugs fixed/closed since last release:
+2221 2222 2223 2224
+
+New feature:
+  - There are two new Director directives that simplify doing
+    console commands rather than using RunScripts.  They are
+      ConsoleRunBeforeJob = "console-command"
+      ConsoleRunAfterJob = "console-command"
+
+
+===========================================================
 
 Release version 7.4.2
 
diff --git a/src/cats/grant_mysql_privileges.in b/src/cats/grant_mysql_privileges.in
index ab85680..f19eac1 100644
--- a/src/cats/grant_mysql_privileges.in
+++ b/src/cats/grant_mysql_privileges.in
@@ -2,7 +2,7 @@
 #
 # shell script to grant privileges to the bacula database
 #
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2016 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 db_user=${db_user:- at db_user@}
@@ -17,6 +17,14 @@ if [ "$db_ssl_options" != "" ]; then
    ssl_options="require $db_ssl_options"
 fi
  
+if $bindir/mysql $* -u root -f 2>/dev/null 1>/dev/null	<<EOD
+use mysql;
+create user ${db_user} ${pass};
+EOD
+then
+  echo "Created MySQL database user: ${db_user}"
+fi
+
 if $bindir/mysql $* -u root -f <<END-OF-DATA
 use mysql
 grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass} ${ssl_options};
diff --git a/src/cats/make_mysql_tables.in b/src/cats/make_mysql_tables.in
index 8ed8598..2e78e58 100644
--- a/src/cats/make_mysql_tables.in
+++ b/src/cats/make_mysql_tables.in
@@ -2,12 +2,22 @@
 #
 # shell script to create Bacula MySQL tables
 #
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2016 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 # Important note: 
-#   You won't get any support for performance issue if you changed the default
-#   schema.
+#   We cannot provide support for performance issues 
+#    if you changed the default schema.  In partcular
+#    if you change any of the indexes.
+#
+# Useful commands:
+#   mysql -u root
+#   show databases;
+#   show tables from <database>;
+#   show columns from <table> from <database>;
+#
+#   use mysql;
+#   select user from user;
 #
 bindir=@MYSQL_BINDIR@
 PATH="$bindir:$PATH"
diff --git a/src/dird/dird_conf.c b/src/dird/dird_conf.c
index 53fb9a1..3a4b381 100644
--- a/src/dird/dird_conf.c
+++ b/src/dird/dird_conf.c
@@ -325,11 +325,13 @@ RES_ITEM job_items[] = {
    {"SpoolSize",   store_size64, ITEM(res_job.spool_size), 0, 0, 0},
    {"ReRunFailedLevels",   store_bool, ITEM(res_job.rerun_failed_levels), 0, ITEM_DEFAULT, false},
    {"PreferMountedVolumes", store_bool, ITEM(res_job.PreferMountedVolumes), 0, ITEM_DEFAULT, true},
-   {"runbeforejob", store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
-   {"runafterjob",  store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
-   {"runafterfailedjob",  store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
-   {"clientrunbeforejob", store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
-   {"clientrunafterjob",  store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
+   {"RunBeforeJob", store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
+   {"RunAfterJob",  store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
+   {"RunAfterFailedJob",  store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
+   {"ClientRunBeforeJob", store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
+   {"ClientRunAfterJob",  store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
+   {"ConsoleRunBeforeJob", store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
+   {"ConsoleRunAfterJob",  store_short_runscript,  ITEM(res_job.RunScripts),  0, 0, 0},
    {"Runscript",          store_runscript, ITEM(res_job.RunScripts), 0, ITEM_NO_EQUALS, 0},
    {"MaximumConcurrentJobs", store_pint32, ITEM(res_job.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
    {"MaximumSpawnedJobs", store_pint32, ITEM(res_job.MaxSpawnedJobs), 0, ITEM_DEFAULT, 600},
@@ -1984,6 +1986,12 @@ static void store_short_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
          script->on_failure = false;
          script->set_target("");
 
+      } else if (strcasecmp(item->name, "clientrunbeforejob") == 0) {
+         script->old_proto = true;
+         script->when = SCRIPT_Before;
+         script->set_target("%c");
+         script->fail_on_error = true;
+
       } else if (strcasecmp(item->name, "clientrunafterjob") == 0) {
          script->old_proto = true;
          script->when = SCRIPT_After;
@@ -1991,11 +1999,18 @@ static void store_short_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
          script->on_success = true;
          script->on_failure = false;
 
-      } else if (strcasecmp(item->name, "clientrunbeforejob") == 0) {
-         script->old_proto = true;
+      } else if (strcasecmp(item->name, "consolerunbeforejob") == 0) {
          script->when = SCRIPT_Before;
-         script->set_target("%c");
+         script->set_target("");
          script->fail_on_error = true;
+         script->set_command(NPRT(script->command), CONSOLE_CMD);
+
+      } else if (strcasecmp(item->name, "consolerunafterjob") == 0) {
+         script->when = SCRIPT_After;
+         script->set_target("");
+         script->on_success = true;
+         script->on_failure = false;
+         script->set_command(NPRT(script->command), CONSOLE_CMD);
 
       } else if (strcasecmp(item->name, "runafterfailedjob") == 0) {
          script->when = SCRIPT_After;
diff --git a/src/dird/fd_cmds.c b/src/dird/fd_cmds.c
index c1ebd57..efb5596 100644
--- a/src/dird/fd_cmds.c
+++ b/src/dird/fd_cmds.c
@@ -672,7 +672,9 @@ int send_runscripts_commands(JCR *jcr)
    int result;
 
    Dmsg0(120, "bdird: sending runscripts to fd\n");
-
+   if (!jcr->job->RunScripts) {
+      goto norunscript;
+   }
    foreach_alist(cmd, jcr->job->RunScripts) {
       if (cmd->can_run_at_level(jcr->getJobLevel()) && cmd->target) {
          ehost = edit_job_codes(jcr, ehost, cmd->target, "");
@@ -719,6 +721,7 @@ int send_runscripts_commands(JCR *jcr)
         goto bail_out;
       }
    }
+norunscript:
    free_pool_memory(msg);
    free_pool_memory(ehost);
    return 1;
diff --git a/src/dird/ua_cmds.c b/src/dird/ua_cmds.c
index 5ba1a68..334066e 100644
--- a/src/dird/ua_cmds.c
+++ b/src/dird/ua_cmds.c
@@ -228,8 +228,10 @@ bool do_a_command(UAContext *ua)
       return false;
    }
 
-   while (ua->jcr->wstorage->size()) {
-      ua->jcr->wstorage->remove(0);
+   if (ua->jcr->wstorage) {
+      while (ua->jcr->wstorage->size()) {
+         ua->jcr->wstorage->remove(0);
+      }
    }
 
    len = strlen(ua->argk[0]);
diff --git a/src/dird/ua_dotcmds.c b/src/dird/ua_dotcmds.c
index eda973a..5fbe13f 100644
--- a/src/dird/ua_dotcmds.c
+++ b/src/dird/ua_dotcmds.c
@@ -1621,7 +1621,7 @@ static bool defaultscmd(UAContext *ua, const char *cmd)
          ua->send_msg("sdport=%d", storage->SDport);
          device = (DEVICE *)storage->device->first();
          ua->send_msg("device=%s", device->name());
-         if (storage->device->size() > 1) {
+         if (storage->device && storage->device->size() > 1) {
             while ((device = (DEVICE *)storage->device->next())) {
                ua->send_msg(",%s", device->name());
             }
diff --git a/src/dird/ua_purge.c b/src/dird/ua_purge.c
index 31b4b7e..e8f6a77 100644
--- a/src/dird/ua_purge.c
+++ b/src/dird/ua_purge.c
@@ -577,6 +577,8 @@ static void do_truncate_on_purge(UAContext *ua, MEDIA_DBR *mr,
 
    /* Do it only if action on purge = truncate is set */
    if (!(mr->ActionOnPurge & ON_PURGE_TRUNCATE)) {
+      ua->error_msg(_("\nThe option \"Action On Purge = Truncate\" was not defined in the Pool resource.\n"
+         "Unable to truncate volume \"%s\"\n"), mr->VolumeName);
       return;
    }
    /*
diff --git a/src/dird/ua_status.c b/src/dird/ua_status.c
index 3959660..ccf0b84 100644
--- a/src/dird/ua_status.c
+++ b/src/dird/ua_status.c
@@ -309,7 +309,7 @@ void list_dir_status_header(UAContext *ua)
       edit_uint64_with_commas(sm_max_buffers, b5));
 
    /* TODO: use this function once for all daemons */
-   if (b_plugin_list->size() > 0) {
+   if (b_plugin_list && b_plugin_list->size() > 0) {
       int len;
       Plugin *plugin;
       POOL_MEM msg(PM_FNAME);
diff --git a/src/filed/status.c b/src/filed/status.c
index 7980117..b753b58 100644
--- a/src/filed/status.c
+++ b/src/filed/status.c
@@ -90,7 +90,7 @@ static void  list_status_header(STATUS_PKT *sp)
               edit_uint64(debug_level, b2), get_trace(), (int)DEVELOPER_MODE,
               edit_uint64_with_commas(me->max_bandwidth_per_job/1024, b1));
    sendit(msg.c_str(), len, sp);
-   if (b_plugin_list->size() > 0) {
+   if (b_plugin_list && b_plugin_list->size() > 0) {
       Plugin *plugin;
       int len;
       pm_strcpy(msg, " Plugin: ");
diff --git a/src/lib/alist.h b/src/lib/alist.h
index c9b041a..4d83c49 100644
--- a/src/lib/alist.h
+++ b/src/lib/alist.h
@@ -103,8 +103,7 @@ inline void * alist::operator [](int index) const {
 
 inline bool alist::empty() const
 {
-   /* Check for null pointer */
-   return this ? num_items == 0 : true;
+   return num_items == 0;
 }
 
 /*
@@ -143,7 +142,7 @@ inline int alist::size() const
     *  on size to succeed even if nothing put in
     *  alist.
     */
-   return this ? num_items : 0;
+   return num_items;
 }
 
 /* How much to grow by each time */
diff --git a/src/lib/breg.c b/src/lib/breg.c
index 8034c2c..2e1a532 100644
--- a/src/lib/breg.c
+++ b/src/lib/breg.c
@@ -69,9 +69,11 @@ void free_bregexp(BREGEXP *self)
  */
 void free_bregexps(alist *bregexps)
 {
-   Dmsg0(500, "bregexp: freeing all BREGEXP object\n");
-
    BREGEXP *elt;
+   Dmsg0(500, "bregexp: freeing all BREGEXP object\n");
+   if (!bregexps) {
+      return;
+   }
    foreach_alist(elt, bregexps) {
       free_bregexp(elt);
    }
diff --git a/src/lib/bsock.c b/src/lib/bsock.c
index 5cb5d63..1a694cc 100644
--- a/src/lib/bsock.c
+++ b/src/lib/bsock.c
@@ -916,9 +916,6 @@ int BSOCK::wait_data_intr(int sec, int usec)
    fd_set fdset;
    struct timeval tv;
 
-   if (this == NULL) {
-      return -1;
-   }
    FD_ZERO(&fdset);
    FD_SET((unsigned)m_fd, &fdset);
    tv.tv_sec = sec;
diff --git a/src/lib/edit.c b/src/lib/edit.c
index f419ab4..1929011 100644
--- a/src/lib/edit.c
+++ b/src/lib/edit.c
@@ -343,13 +343,15 @@ static bool strunit_to_uint64(char *str, int str_len, uint64_t *value,
    double val;
    char mod_str[20];
    char num_str[50];
-   const int64_t mult[] = {1,             /* byte */
-                           1024,          /* kilobyte */
-                           1000,          /* kb kilobyte */
-                           1048576,       /* megabyte */
-                           1000000,       /* mb megabyte */
-                           1073741824,    /* gigabyte */
-                           1000000000};   /* gb gigabyte */
+   const int64_t mult[] = {1,              /* byte */
+                           1024,           /* kilobyte */
+                           1000,           /* kb kilobyte */
+                           1048576,        /* megabyte */
+                           1000000,        /* mb megabyte */
+                           1073741824,     /* gigabyte */
+                           1000000000,     /* gb gigabyte */
+                           1099511627776,  /* terabyte */
+                           1000000000000}; /* tb terabyte */
 
    if (!get_modifier(str, num_str, sizeof(num_str), mod_str, sizeof(mod_str))) {
       return 0;
@@ -386,7 +388,8 @@ static bool strunit_to_uint64(char *str, int str_len, uint64_t *value,
 bool size_to_uint64(char *str, int str_len, uint64_t *value)
 {
    /* first item * not used */
-   static const char *mod[]  = {"*", "k", "kb", "m", "mb",  "g", "gb",  NULL};
+   static const char *mod[]  = {"*", "k", "kb", "m", "mb",
+                                     "g", "gb", "t", "tb", NULL};
    return strunit_to_uint64(str, str_len, value, mod);
 }
 
diff --git a/src/lib/parse_conf.c b/src/lib/parse_conf.c
index 26d8140..dad7f5c 100644
--- a/src/lib/parse_conf.c
+++ b/src/lib/parse_conf.c
@@ -369,8 +369,8 @@ void store_name(LEX *lc, RES_ITEM *item, int index, int pass)
    free_pool_memory(msg);
    /* Store the name both pass 1 and pass 2 */
    if (*(item->value)) {
-      scan_err2(lc, _("Attempt to redefine name \"%s\" to \"%s\"."),
-         *(item->value), lc->str);
+      scan_err5(lc, _("Attempt to redefine \"%s\" from \"%s\" to \"%s\" referenced on line %d : %s\n"),
+         item->name, *(item->value), lc->str, lc->line_no, lc->line);
       return;
    }
    *(item->value) = bstrdup(lc->str);
@@ -388,6 +388,11 @@ void store_strname(LEX *lc, RES_ITEM *item, int index, int pass)
    lex_get_token(lc, T_NAME);
    /* Store the name */
    if (pass == 1) {
+      if (*(item->value)) {
+         scan_err5(lc, _("Attempt to redefine \"%s\" from \"%s\" to \"%s\" referenced on line %d : %s\n"),
+            item->name, *(item->value), lc->str, lc->line_no, lc->line);
+         return;
+      }
       *(item->value) = bstrdup(lc->str);
    }
    scan_to_eol(lc);
@@ -399,6 +404,11 @@ void store_str(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    lex_get_token(lc, T_STRING);
    if (pass == 1) {
+      if (*(item->value)) {
+         scan_err5(lc, _("Attempt to redefine \"%s\" from \"%s\" to \"%s\" referenced on line %d : %s\n"),
+            item->name, *(item->value), lc->str, lc->line_no, lc->line);
+         return;
+      }
       *(item->value) = bstrdup(lc->str);
    }
    scan_to_eol(lc);
@@ -417,6 +427,11 @@ void store_dir(LEX *lc, RES_ITEM *item, int index, int pass)
       if (lc->str[0] != '|') {
          do_shell_expansion(lc->str, sizeof_pool_memory(lc->str));
       }
+      if (*(item->value)) {
+         scan_err5(lc, _("Attempt to redefine \"%s\" from \"%s\" to \"%s\" referenced on line %d : %s\n"),
+            item->name, *(item->value), lc->str, lc->line_no, lc->line);
+         return;
+      }
       *(item->value) = bstrdup(lc->str);
    }
    scan_to_eol(lc);
@@ -442,6 +457,11 @@ void store_password(LEX *lc, RES_ITEM *item, int index, int pass)
          sprintf(&sig[j], "%02x", digest[i]);
          j += 2;
       }
+      if (*(item->value)) {
+         scan_err5(lc, _("Attempt to redefine \"%s\" from \"%s\" to \"%s\" referenced on line %d : %s\n"),
+            item->name, *(item->value), lc->str, lc->line_no, lc->line);
+         return;
+      }
       *(item->value) = bstrdup(sig);
    }
    scan_to_eol(lc);
diff --git a/src/lib/smartall.h b/src/lib/smartall.h
index 61ec9a9..4c69211 100644
--- a/src/lib/smartall.h
+++ b/src/lib/smartall.h
@@ -109,15 +109,13 @@ void *operator new(size_t s, const char *fname, int line)
 {
    size_t size =  s > sizeof(int) ? (unsigned int)s : sizeof(int);
    void *p = sm_malloc(fname, line, size);
-   memset(p, 0, size);
-   return p;
+   return memset(p, 0, size);   /* return memset() result to avoid GCC 6.1 issue */
 }
 void *operator new[](size_t s, const char *fname, int line)
 {
    size_t size =  s > sizeof(int) ? (unsigned int)s : sizeof(int);
    void *p = sm_malloc(fname, line, size);
-   memset(p, 0, size);
-   return p;
+   return memset(p, 0, size);  /* return memset() result to avoid GCC 6.1 issue */
 }
 
 void  operator delete(void *ptr)
diff --git a/src/stored/autochanger.c b/src/stored/autochanger.c
index 8c86d09..e3d8180 100644
--- a/src/stored/autochanger.c
+++ b/src/stored/autochanger.c
@@ -436,7 +436,7 @@ static bool unload_other_drive(DCR *dcr, int slot)
    int loaded;
    int i;
 
-   if (!changer) {
+   if (!changer || !changer->device) {
       return false;
    }
    if (changer->device->size() == 1) {
@@ -625,7 +625,7 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd)
    if (strcasecmp(cmd, "drives") == 0) {
       AUTOCHANGER *changer_res = dcr->device->changer_res;
       int drives = 1;
-      if (changer_res) {
+      if (changer_res && changer_res->device) {
          drives = changer_res->device->size();
       }
       dir->fsend("drives=%d\n", drives);
diff --git a/src/stored/status.c b/src/stored/status.c
index 9a7c173..cac05c8 100644
--- a/src/stored/status.c
+++ b/src/stored/status.c
@@ -753,7 +753,7 @@ bool qstatus_cmd(JCR *jcr)
 static void list_plugins(STATUS_PKT *sp)
 {
    POOL_MEM msg(PM_MESSAGE);
-   if (b_plugin_list->size() > 0) {
+   if (b_plugin_list && b_plugin_list->size() > 0) {
       Plugin *plugin;
       int len;
       pm_strcpy(msg, " Plugin: ");
diff --git a/src/tools/bsmtp.c b/src/tools/bsmtp.c
index 55148d4..997708d 100644
--- a/src/tools/bsmtp.c
+++ b/src/tools/bsmtp.c
@@ -231,7 +231,7 @@ static void get_date_string(char *buf, int buf_len)
 
    my_timezone = tz_offset(now, tm);
    strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S", &tm);
-   snprintf(tzbuf, sizeof(tzbuf), " %+2.2ld%2.2u", -my_timezone / 60, abs(my_timezone) % 60);
+   snprintf(tzbuf, sizeof(tzbuf), " %+2.2ld%2.2u", -my_timezone / 60, (unsigned int)abs(my_timezone) % 60);
    strcat(buf, tzbuf);              /* add +0100 */
    strftime(tzbuf, sizeof(tzbuf), " (%Z)", &tm);
    strcat(buf, tzbuf);              /* add (CEST) */
diff --git a/src/version.h b/src/version.h
index 0945a23..cfcf2f9 100644
--- a/src/version.h
+++ b/src/version.h
@@ -5,9 +5,9 @@
 #define COMMUNITY 1      /* Define to create a Windows community binary */
 
 /* Note: there can be only *one* VERSION in this file */
-#define VERSION "7.4.2"
-#define BDATE   "06 June 2016"
-#define LSMDATE "06Jun16"
+#define VERSION "7.4.3"
+#define BDATE   "18 June 2016"
+#define LSMDATE "18Jun16"
 
 #define RELEASE 1   /* Use ONLY in rpms */
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git



More information about the pkg-bacula-commits mailing list