[SCM] Samba Shared Repository - branch master updated

Björn Jacke bjacke at samba.org
Thu Dec 3 15:10:06 UTC 2015


The branch, master has been updated
       via  c118fbc clitar: cope with functions of older versions of libarchive
       via  f25d09a selftest: fix tar test with Pax format archives
      from  412cefc client: Fix parameter mixup

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c118fbc680f84622c12997cf347f3194d532ddbc
Author: Björn Jacke <bj at sernet.de>
Date:   Thu May 28 14:55:28 2015 +0200

    clitar: cope with functions of older versions of libarchive
    
    the feature of automatic decompression in extract mode is only supported in
    libarchive 3, so we use this only when available now.
    
    The changed config checks for that also fix this bug:
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11296
    
    Signed-off-by: Bjoern Jacke <bj at sernet.de>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Björn Jacke <bj at sernet.de>
    Autobuild-Date(master): Thu Dec  3 16:09:08 CET 2015 on sn-devel-104

commit f25d09a6eb8274fd62d23def8d494d4af0178bf5
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Dec 3 10:23:09 2015 +0100

    selftest: fix tar test with Pax format archives
    
    we need to skip PaxHeader pseudo files
    
    Signed-off-by: Bjoern Jacke <bj at sernet.de>

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

Summary of changes:
 source3/client/clitar.c                        | 10 ++++++++++
 source3/script/tests/test_smbclient_tarmode.pl |  6 +++++-
 source3/wscript                                |  8 ++++----
 source3/wscript_build                          |  3 ++-
 4 files changed, 21 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index b4f914f..8703f6b 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -720,7 +720,11 @@ out_close:
 		}
 	}
 out:
+#ifdef HAVE_ARCHIVE_READ_FREE
 	archive_write_free(t->archive);
+#else
+	archive_write_finish(t->archive);
+#endif
 	talloc_free(ctx);
 	return err;
 }
@@ -1002,7 +1006,9 @@ static int tar_extract(struct tar *t)
 
 	t->archive = archive_read_new();
 	archive_read_support_format_all(t->archive);
+#ifdef HAVE_ARCHIVE_READ_SUPPORT_FILTER_ALL
 	archive_read_support_filter_all(t->archive);
+#endif
 
 	if (strequal(t->tar_path, "-")) {
 		r = archive_read_open_fd(t->archive, STDIN_FILENO, bsize);
@@ -1053,7 +1059,11 @@ static int tar_extract(struct tar *t)
 	}
 
 out:
+#ifdef HAVE_ARCHIVE_READ_FREE
 	r = archive_read_free(t->archive);
+#else
+	r = archive_read_finish(t->archive);
+#endif
 	if (r != ARCHIVE_OK) {
 		DBG(0, ("Can't close %s : %s\n", t->tar_path,
 					archive_error_string(t->archive)));
diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl
index 663f02f..29cea99 100755
--- a/source3/script/tests/test_smbclient_tarmode.pl
+++ b/source3/script/tests/test_smbclient_tarmode.pl
@@ -1063,8 +1063,12 @@ sub check_tar {
     my $i = Archive::Tar->iter($tar, 1, {md5 => 1});
     while (my $f = $i->()) {
         if ($f->has_content) {
-            $total++;
             my $p = $f->full_path;
+
+	    # we skip pseudo files of Pax format archives
+            next if ($p =~ m/\/PaxHeader/);
+
+            $total++;
             $p =~ s{^\./+}{};
 
             # file that shouldn't be there
diff --git a/source3/wscript b/source3/wscript
index 990afcd..8741d19 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -212,14 +212,14 @@ main() {
 
     # check for libarchive (tar command in smbclient)
     # None means autodetect, True/False means enable/disable
-    conf.env['archive_lib'] = ''
+    conf.SET_TARGET_TYPE('archive', 'EMPTY')
     if Options.options.with_libarchive is not False:
         libarchive_mandatory = Options.options.with_libarchive == True
         Logs.info("Checking for libarchive existence")
-        if conf.CHECK_BUNDLED_SYSTEM('libarchive', minversion='3.1.2'):
-            conf.env['archive_lib'] = 'libarchive'
+        if conf.CHECK_HEADERS('archive.h') and conf.CHECK_LIB('archive', shlib=True):
+            conf.CHECK_FUNCS_IN('archive_read_support_filter_all archive_read_free', 'archive')
         elif libarchive_mandatory:
-            conf.fatal('libarchive support requested, but no suitable pkgconfig found')
+            conf.fatal('libarchive support requested, but not found')
 
     # check for DMAPI libs
     if Options.options.with_dmapi == False:
diff --git a/source3/wscript_build b/source3/wscript_build
index 236a452..e66e89f 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -1071,7 +1071,8 @@ bld.SAMBA3_BINARY('client/smbclient',
                  msrpc3
                  RPC_NDR_SRVSVC
                  cli_smb_common
-                 ''' + bld.env['archive_lib'])
+		 archive
+                 ''')
 
 bld.SAMBA3_BINARY('net',
                  source='''utils/net.c


-- 
Samba Shared Repository



More information about the samba-cvs mailing list