|
From: <gi...@ba...> - 2012-10-08 13:40:31
|
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 a71e3a7fb7c38a6067ed27337b23eef9558da321 (commit)
from 25b5baab27707e9438530849c989752c73bbcb2c (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 a71e3a7fb7c38a6067ed27337b23eef9558da321
Author: Marco van Wieringen <mv...@pl...>
Date: Sun Oct 7 21:32:18 2012 +0200
fix #1938 about PATH_MAX on hurd
-----------------------------------------------------------------------
Summary of changes:
diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c
index b1a0840..faf86d5 100644
--- a/bacula/src/filed/xattr.c
+++ b/bacula/src/filed/xattr.c
@@ -2430,7 +2430,7 @@ static int os_default_xattr_streams[1] = {
* This code creates a temporary cache with entries for each xattr which has
* a link count > 1 (which indicates it has one or more hard linked counterpart(s))
*/
-static xattr_link_cache_entry_t *find_xattr_link_cache_entry(JCR *jcr, ino_t inum)
+static inline xattr_link_cache_entry_t *find_xattr_link_cache_entry(JCR *jcr, ino_t inum)
{
xattr_link_cache_entry_t *ptr;
@@ -2442,14 +2442,14 @@ static xattr_link_cache_entry_t *find_xattr_link_cache_entry(JCR *jcr, ino_t inu
return NULL;
}
-static void add_xattr_link_cache_entry(JCR *jcr, ino_t inum, char *target)
+static inline void add_xattr_link_cache_entry(JCR *jcr, ino_t inum, char *target)
{
xattr_link_cache_entry_t *ptr;
ptr = (xattr_link_cache_entry_t *)malloc(sizeof(xattr_link_cache_entry_t));
memset(ptr, 0, sizeof(xattr_link_cache_entry_t));
ptr->inum = inum;
- bstrncpy(ptr->target, target, sizeof(ptr->target));
+ ptr->target = bstrdup(target);
if (!jcr->xattr_data->u.build->link_cache) {
jcr->xattr_data->u.build->link_cache = New(alist(10, not_owned_by_alist));
@@ -2457,6 +2457,22 @@ static void add_xattr_link_cache_entry(JCR *jcr, ino_t inum, char *target)
jcr->xattr_data->u.build->link_cache->append(ptr);
}
+static inline void drop_xattr_link_cache(JCR *jcr)
+{
+ xattr_link_cache_entry_t *ptr;
+
+ /*
+ * Walk the list of xattr link cache entries and free allocated memory on traversing.
+ */
+ foreach_alist(ptr, jcr->xattr_data->u.build->link_cache) {
+ free(ptr->target);
+ free(ptr);
+ }
+
+ delete jcr->xattr_data->u.build->link_cache;
+ jcr->xattr_data->u.build->link_cache = NULL;
+}
+
#if defined(HAVE_SYS_NVPAIR_H) && defined(_PC_SATTR_ENABLED)
/*
* This function returns true if a non default extended system attribute
@@ -3680,8 +3696,7 @@ static bxattr_exit_code solaris_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt)
retval = solaris_save_xattrs(jcr, NULL, NULL);
chdir(cwd);
if (jcr->xattr_data->u.build->link_cache) {
- delete jcr->xattr_data->u.build->link_cache;
- jcr->xattr_data->u.build->link_cache = NULL;
+ drop_xattr_link_cache(jcr);
}
}
return retval;
diff --git a/bacula/src/filed/xattr.h b/bacula/src/filed/xattr.h
index d54b912..cb1c68e 100644
--- a/bacula/src/filed/xattr.h
+++ b/bacula/src/filed/xattr.h
@@ -57,7 +57,7 @@ struct xattr_t {
*/
struct xattr_link_cache_entry_t {
uint32_t inum;
- char target[PATH_MAX];
+ char *target;
};
#define BXATTR_FLAG_SAVE_NATIVE 0x01
hooks/post-receive
--
Bacula Community source
|