|
From: <gi...@ba...> - 2012-10-07 14:13:29
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Bacula Community source".
The branch, Branch-5.2 has been updated
via 25b5baab27707e9438530849c989752c73bbcb2c (commit)
via dc6815cafdcb14f44d1ce1b8f9977e617f44e614 (commit)
via ae52e6565a20566223c59d65a2943e0191e0812b (commit)
via cabc5e6e26c34dd1fc55d300a41adf827ee80b9b (commit)
via 438211de5881ffdbd7bf6ed343bb32b9b619ae4c (commit)
from 38dfd2afb1255acb0c25fe9de942d1df16bf687a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 25b5baab27707e9438530849c989752c73bbcb2c
Author: Eric Bollengier <er...@ba...>
Date: Sun Oct 7 16:03:31 2012 +0200
fix #1938 about MAXPATHLEN on hurd
commit dc6815cafdcb14f44d1ce1b8f9977e617f44e614
Author: Marco van Wieringen <mv...@pl...>
Date: Fri Oct 5 16:31:39 2012 +0200
Fix bug #1937 OpenBSD autochanger example script
Make the OpenBSD autochanger script cope with a non fully load
autochanger.
Imported patch in bug report 1937.
commit ae52e6565a20566223c59d65a2943e0191e0812b
Author: Marco van Wieringen <mv...@pl...>
Date: Wed Sep 19 10:14:59 2012 +0200
Fix bug #1934 Wrong values at media list in BAT
commit cabc5e6e26c34dd1fc55d300a41adf827ee80b9b
Author: Kern Sibbald <ke...@si...>
Date: Sun Sep 16 12:39:54 2012 +0200
Fix double unlink
commit 438211de5881ffdbd7bf6ed343bb32b9b619ae4c
Author: Kern Sibbald <ke...@si...>
Date: Sun Sep 16 12:22:29 2012 +0200
More tests for freeing NULL pointers
-----------------------------------------------------------------------
Summary of changes:
diff --git a/bacula/examples/autochangers/chio-changer-openbsd b/bacula/examples/autochangers/chio-changer-openbsd
index d5e83b9..fa150fb 100644
--- a/bacula/examples/autochangers/chio-changer-openbsd
+++ b/bacula/examples/autochangers/chio-changer-openbsd
@@ -95,7 +95,7 @@ case ${cmd} in
list)
${CHIO} -f ${ctl} status -v slot | \
sed -ne 's/^slot *\([0-9]*:\).*FULL.*voltag.*<\(.*\):.*/\1\2/p' | \
- awk -F: '{print $1 + 1 ":" $2 }'
+ awk -F: '{ print $1 + 1 ":" $2 }'
exit $?
;;
@@ -105,10 +105,13 @@ case ${cmd} in
;;
loaded)
- local _slot=`${CHIO} -f ${ctl} status -v | egrep '^slot.*<ACCESS> voltag: <:[0-9]>$' | awk '{ print $2 }' | awk -F: '{ print $1 + 1 }'`
- [ -z "${_slot}" ] && _slot=0
- echo ${_slot}
- exit $?
+ # XXX output the first empty slot if the drive is loaded
+ _slot=`${CHIO} -f ${ctl} status -v | egrep '^slot.*<ACCESS> voltag: <:[0-9]>$' | awk '{ print $2 }' | awk -F: '{ print $1 + 1 }'`
+ rtn=$?
+ _loaded=`${CHIO} -f ${ctl} status -v | egrep "^drive ${drive}: <ACCESS,FULL> voltag: <.*:[0-9]>"`
+ [ -z "${_slot}" -o -z "${_loaded}" ] && _slot=0
+ echo ${_slot} | awk '{ print $1 }'
+ exit ${rtn}
;;
slots)
${CHIO} -f ${ctl} params | awk "/slots/{print \$2}"
diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c
index 68c70ef..dba28bf 100644
--- a/bacula/src/findlib/find.c
+++ b/bacula/src/findlib/find.c
@@ -505,6 +505,9 @@ term_find_files(FF_PKT *ff)
if (ff->link_save) {
free_pool_memory(ff->link_save);
}
+ if (ff->ignoredir_fname) {
+ free_pool_memory(ff->ignoredir_fname);
+ }
hard_links = term_find_one(ff);
free(ff);
return hard_links;
diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h
index a91ba88..8d6be39 100644
--- a/bacula/src/findlib/find.h
+++ b/bacula/src/findlib/find.h
@@ -169,6 +169,7 @@ struct FF_PKT {
POOLMEM *sys_fname; /* system filename */
POOLMEM *fname_save; /* save when stripping path */
POOLMEM *link_save; /* save when stripping path */
+ POOLMEM *ignoredir_fname; /* used to ignore directories */
char *digest; /* set to file digest when the file is a hardlink */
struct stat statp; /* stat packet */
uint32_t digest_len; /* set to the digest len when the file is a hardlink*/
diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c
index 36708d3..d854994 100644
--- a/bacula/src/findlib/find_one.c
+++ b/bacula/src/findlib/find_one.c
@@ -103,6 +103,7 @@ static FF_PKT *new_dir_ff_pkt(FF_PKT *ff_pkt)
dir_ff_pkt->linkhash = NULL;
dir_ff_pkt->fname_save = NULL;
dir_ff_pkt->link_save = NULL;
+ dir_ff_pkt->ignoredir_fname = NULL;
return dir_ff_pkt;
}
@@ -120,6 +121,9 @@ static void free_dir_ff_pkt(FF_PKT *dir_ff_pkt)
if (dir_ff_pkt->link_save) {
free_pool_memory(dir_ff_pkt->link_save);
}
+ if (dir_ff_pkt->ignoredir_fname) {
+ free_pool_memory(dir_ff_pkt->ignoredir_fname);
+ }
free(dir_ff_pkt);
}
@@ -308,7 +312,6 @@ bool check_changes(JCR *jcr, FF_PKT *ff_pkt)
static bool have_ignoredir(FF_PKT *ff_pkt)
{
struct stat sb;
- char tmp_name[MAXPATHLEN];
char *ignoredir;
/* Ensure that pointers are defined */
@@ -318,14 +321,11 @@ static bool have_ignoredir(FF_PKT *ff_pkt)
ignoredir = ff_pkt->fileset->incexe->ignoredir;
if (ignoredir) {
- if (strlen(ff_pkt->fname) + strlen(ignoredir) + 2 > MAXPATHLEN) {
- return false;
+ if (!ff_pkt->ignoredir_fname) {
+ ff_pkt->ignoredir_fname = get_pool_memory(PM_FNAME);
}
-
- strcpy(tmp_name, ff_pkt->fname);
- strcat(tmp_name, "/");
- strcat(tmp_name, ignoredir);
- if (stat(tmp_name, &sb) == 0) {
+ Mmsg(ff_pkt->ignoredir_fname, "%s/%s", ff_pkt->fname, ignoredir);
+ if (stat(ff_pkt->ignoredir_fname, &sb) == 0) {
Dmsg2(100, "Directory '%s' ignored (found %s)\n",
ff_pkt->fname, ignoredir);
return true; /* Just ignore this directory */
diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c
index 24afdf1..fc7f22a 100644
--- a/bacula/src/lib/message.c
+++ b/bacula/src/lib/message.c
@@ -588,13 +588,17 @@ void close_msg(JCR *jcr)
}
free_memory(line);
rem_temp_file:
- /* Remove temp mail file */
- fclose(d->fd);
- d->fd = NULL;
- /* Exclude spaces in mail_filename */
- safer_unlink(d->mail_filename, MAIL_REGEX);
- free_pool_memory(d->mail_filename);
- d->mail_filename = NULL;
+ /* Remove temp file */
+ if (d->fd) {
+ fclose(d->fd);
+ d->fd = NULL;
+ }
+ if (d->mail_filename) {
+ /* Exclude spaces in mail_filename */
+ safer_unlink(d->mail_filename, MAIL_REGEX);
+ free_pool_memory(d->mail_filename);
+ d->mail_filename = NULL;
+ }
Dmsg0(850, "end mail or mail on error\n");
break;
default:
diff --git a/bacula/src/qt-console/util/fmtwidgetitem.cpp b/bacula/src/qt-console/util/fmtwidgetitem.cpp
index d284ac2..ef742bf 100644
--- a/bacula/src/qt-console/util/fmtwidgetitem.cpp
+++ b/bacula/src/qt-console/util/fmtwidgetitem.cpp
@@ -130,7 +130,7 @@ QString convertBytesIEC(qint64 qfld)
/* having divided for a smaller unit, now we can safely convert to double and
use the extra room for decimals */
- return QString("%1 %2iB").arg(qfld / 1000.0, 0, 'f', 2).arg(suffix);
+ return QString("%1 %2iB").arg(qfld / 1024.0, 0, 'f', 2).arg(suffix);
}
/* String to human value based on k=1000 */
hooks/post-receive
--
Bacula Community source
|