[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Thu Sep 22 10:15:24 MDT 2011


The branch, master has been updated
       via  15df927 Fix xattr memory leak.  Fixes bug 8475.
       via  8adceeb Testsuite/dir-sgid: use symbolic mode to set sgid bit
      from  0c7fdf7 Add solaris xattr support to the tests. Change the xattr case statements to use $HOST_OS. (Slightly tweaked version of a Ben Walton patch.)

;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 15df927ae26ff0c0d2e31f2245ce5848346084a4
Author: Wayne Davison <wayned at samba.org>
Date:   Thu Sep 22 09:02:21 2011 -0700

    Fix xattr memory leak.  Fixes bug 8475.

commit 8adceeb2b38a7f9f6a2c1fc5a5bf2635927a303b
Author: Ben Walton <bwalton at artsci.utoronto.ca>
Date:   Tue Sep 20 22:57:39 2011 -0400

    Testsuite/dir-sgid: use symbolic mode to set sgid bit
    
    The chmod on Solaris (9 and 10) cannot set the sgid bit on a directory
    using absolute mode, so use symbolic mode.  Avoids a skipped test.

-----------------------------------------------------------------------

Summary of changes:
 testsuite/dir-sgid.test |    4 ++--
 xattrs.c                |    9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/testsuite/dir-sgid.test b/testsuite/dir-sgid.test
index bbd86a6..44cd61e 100644
--- a/testsuite/dir-sgid.test
+++ b/testsuite/dir-sgid.test
@@ -26,7 +26,7 @@ testit() {
 echo "File!" >"$scratchdir/file"
 echo "#!/bin/sh" >"$scratchdir/program"
 mkdir "$scratchdir/dir"
-chmod 2764 "$scratchdir/dir" || test_skipped "Can't chmod"
+chmod u=rwx,g=rw,g+s,o=r "$scratchdir/dir" || test_skipped "Can't chmod"
 chmod 664 "$scratchdir/file"
 chmod 775 "$scratchdir/program"
 [ -g "$scratchdir/dir" ] || test_skipped "The directory setgid bit vanished!"
@@ -35,7 +35,7 @@ mkdir "$scratchdir/dir/blah"
 
 # Test some target directories
 testit setgid-off 700 rw------- rwx------ rwx------
-testit setgid-on 2700 rw------- rwx------ rwx--S---
+testit setgid-on u=rwx,g=rw,g+s,o-rwx rw------- rwx------ rwx--S---
 
 # Hooray
 exit 0
diff --git a/xattrs.c b/xattrs.c
index 3a7cb25..52c33cd 100644
--- a/xattrs.c
+++ b/xattrs.c
@@ -94,11 +94,14 @@ static void rsync_xal_free(item_list *xalp)
 	size_t i;
 	rsync_xa *rxas = xalp->items;
 
+	if (!xalp->malloced)
+		return;
+
 	for (i = 0; i < xalp->count; i++) {
 		free(rxas[i].datum);
 		/*free(rxas[i].name);*/
 	}
-	xalp->count = 0;
+	free(xalp->items);
 }
 
 void free_xattr(stat_x *sxp)
@@ -773,10 +776,8 @@ void uncache_tmp_xattrs(void)
 		item_list *xattr_start = xattr_item + prior_xattr_count;
 		xattr_item += rsync_xal_l.count;
 		rsync_xal_l.count = prior_xattr_count;
-		while (xattr_item-- > xattr_start) {
+		while (xattr_item-- > xattr_start)
 			rsync_xal_free(xattr_item);
-			free(xattr_item->items);
-		}
 		prior_xattr_count = (size_t)-1;
 	}
 }


-- 
The rsync repository.


More information about the rsync-cvs mailing list