From 7947e61865e26cbcb4c0257afe2105d98e3a6d55 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Tue, 23 Jun 2009 19:13:29 +0000 Subject: [PATCH] Fix 2 rather big bugs in the xattr and acl code and fix a small memory leak on a particular code path for Linux xattr/acl handling. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8923 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/acl.c | 2 +- bacula/src/filed/xattr.c | 7 ++++++- bacula/technotes | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c index 1e43df13e7..9e76b24045 100644 --- a/bacula/src/filed/acl.c +++ b/bacula/src/filed/acl.c @@ -533,12 +533,12 @@ static bool darwin_build_acl_streams(JCR *jcr, FF_PKT *ff_pkt) */ if ((jcr->acl_data_len = generic_get_acl_from_os(jcr, BACL_TYPE_ACCESS)) < 0) return false; +#endif if (jcr->acl_data_len > 0) { if (!send_acl_stream(jcr, STREAM_ACL_DARWIN_ACCESS_ACL)) return false; } -#endif return true; } diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c index fe43b04233..68b427a756 100644 --- a/bacula/src/filed/xattr.c +++ b/bacula/src/filed/xattr.c @@ -318,8 +318,11 @@ static bool generic_xattr_build_streams(JCR *jcr, FF_PKT *ff_pkt, int stream) bp = strchr(bp, '\0') + 1; } - if (count == 0) + if (count == 0) { + free(xattr_list); + return true; + } /* * Allocate enough room to hold all extended attributes. @@ -740,6 +743,8 @@ static void add_xattr_link_cache_entry(ino_t inum, char *target) strncpy(ptr->target, target, sizeof(ptr->target)); if (xattr_link_cache_head == NULL) xattr_link_cache_head = ptr; + if (xattr_link_cache_tail != NULL) + xattr_link_cache_tail->next = ptr; xattr_link_cache_tail = ptr; } } diff --git a/bacula/technotes b/bacula/technotes index 07882980ee..48627f6dab 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,6 +3,8 @@ General: 23Jun09 +mvw Fix 2 rather big bugs in the xattr and acl code and fix a small + memory leak on a particular code path for Linux xattr/acl handling. ebl Update FileSetId when initializing job. ebl Fix compilation problem with message.c ebl Add '*' when volume is online when displaying volume list in restore. Should -- 2.39.5