sfrench/samba-autobuild/.git
10 years agos4: tidy up vfs cifs in regards to using share_string_option
Garming Sam [Thu, 20 Feb 2014 20:29:38 +0000 (09:29 +1300)]
s4: tidy up vfs cifs in regards to using share_string_option

Change-Id: I014bce667d3f875a913dbccf269b514f7ffbab7b
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agos4: tidy up some null checks in ntvfs
Garming Sam [Thu, 20 Feb 2014 20:06:25 +0000 (09:06 +1300)]
s4: tidy up some null checks in ntvfs

Change-Id: I629a299bea10b063de4525020a4c6b838260cd67
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
10 years agolibcli: Overflow array index read possible, in auth code.
Ira Cooper [Thu, 13 Feb 2014 19:45:23 +0000 (14:45 -0500)]
libcli: Overflow array index read possible, in auth code.

Changed the if condtion to detect when we'd improperly overflow.

Coverity-Id: 1167990
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Mon Feb 24 11:56:38 CET 2014 on sn-devel-104

10 years agoRevert "libcli: Overflow array index read possible, in auth code."
Ira Cooper [Mon, 24 Feb 2014 08:46:00 +0000 (14:16 +0530)]
Revert "libcli: Overflow array index read possible, in auth code."

This reverts commit 538cbfe0e90b7c7ed0f8421b323cac4dacd83f04.

Signed-off-by: Ira Cooper <ira@samba.org>
10 years agolibcli: Overflow array index read possible, in auth code.
Ira Cooper [Thu, 13 Feb 2014 19:45:23 +0000 (14:45 -0500)]
libcli: Overflow array index read possible, in auth code.

The values have to be signed here to allow for the values to go negative,
to prevent the overflow.

Coverity-Id: 1167990
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Mon Feb 24 07:23:03 CET 2014 on sn-devel-104

10 years agos3:printing: Fix a possible NULL dereference.
Poornima Gurusiddaiah [Fri, 14 Feb 2014 03:27:12 +0000 (03:27 +0000)]
s3:printing: Fix a possible NULL dereference.

Coverity-Id: 710708

Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agos3:passdb: Fix the use of uninitialized scalar variable.
Poornima Gurusiddaiah [Fri, 14 Feb 2014 03:56:56 +0000 (03:56 +0000)]
s3:passdb: Fix the use of uninitialized scalar variable.

Coverity-id: 1107228,1107227

Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agos3/libsmb: Free memdup'd local variable
Jose A. Rivera [Thu, 20 Feb 2014 15:14:59 +0000 (09:14 -0600)]
s3/libsmb: Free memdup'd local variable

secrets_fetch_machine_password() sets pwd to point to memdup()'d (and thus
malloc()'d) memory. This memory should be freed before we go out of scope.

Change-Id: I07e575819c309fa5b85627dce2eb969bc720ce4e
Coverity-Id: 1168001
Reviewed-by: Ira Cooper <ira@samba.org>
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Sat Feb 22 00:58:23 CET 2014 on sn-devel-104

10 years agopassdb: Patch memory leak in pdb_ldap.c
Jose A. Rivera [Tue, 18 Feb 2014 13:35:37 +0000 (07:35 -0600)]
passdb: Patch memory leak in pdb_ldap.c

Moved the call to the talloc autofree function to as early a point as
possible. init_ldap_from_sam() already calls smbldap_set_mod(), and there's
a chance that the init will fail after having already allocated memory for
&mods.

Coverity-Id: 1167997
Change-Id: Ic26bfb3c530f90aa885e447b8409deba49708d64
Reviewed-by: Ira Cooper <ira@samba.org>
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agotestprogs: Fix pkinit test with system ldb.
Andreas Schneider [Fri, 21 Feb 2014 14:55:22 +0000 (15:55 +0100)]
testprogs: Fix pkinit test with system ldb.

Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Feb 21 17:58:24 CET 2014 on sn-devel-104

10 years agotestprogs: Fix kinit test with system ldb.
Andreas Schneider [Fri, 21 Feb 2014 14:52:42 +0000 (15:52 +0100)]
testprogs: Fix kinit test with system ldb.

Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 years agonsswitch: Fix idmap rfc2307 test with system ldb.
Andreas Schneider [Fri, 21 Feb 2014 14:37:52 +0000 (15:37 +0100)]
nsswitch: Fix idmap rfc2307 test with system ldb.

Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 years agoselftest: Use the absolute path to the ldb modules.
Andreas Schneider [Fri, 21 Feb 2014 13:23:00 +0000 (14:23 +0100)]
selftest: Use the absolute path to the ldb modules.

This fixes 'make test' on Fedora with external ldb.

Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
10 years agoheimdal: Use krb5_free_default_realm() for free()
Santosh Kumar Pradhan [Fri, 21 Feb 2014 04:18:31 +0000 (09:48 +0530)]
heimdal: Use krb5_free_default_realm() for free()

The resource allocated by krb5_default_default_realm() should be
free()'d by krb5_free_default_realm() instead of plain free()
for better readability.

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agokdc: Free the resource which is not used anymore
Santosh Kumar Pradhan [Fri, 21 Feb 2014 04:13:47 +0000 (09:43 +0530)]
kdc: Free the resource which is not used anymore

In samba_kdc_firstkey() routine, krb5_get_default_realm() allocates
memory for "realm" but never used afterwards. Free() the leaked memory.

CID: 1107223

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()
Gregor Beck [Thu, 20 Feb 2014 10:25:53 +0000 (11:25 +0100)]
s3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()

As a domain member we should always use a DC of our own domain.

It would be possible to pass all sids in one single dcerpc_wbint_LookupSids()
call. For now we just fix bug.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3:winbindd: fix _wbint_LookupSids() on error
Gregor Beck [Thu, 20 Feb 2014 12:14:31 +0000 (13:14 +0100)]
s3:winbindd: fix _wbint_LookupSids() on error

We need to make sure that r->out.domains remains valid,
otherwise we're not able to marshall the response.

Note that wbint_LookupSids() has [out,ref] lsa_RefDomainList *domains,
while lsa_LookupSids() has [out,ref] lsa_RefDomainList **domains.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"
Stefan Metzmacher [Thu, 13 Feb 2014 14:36:27 +0000 (15:36 +0100)]
s3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"

If smbd_server_connection_terminate("CTDB_SRVID_RELEASE_IP") is triggered from
within ctdbd_migrate(), we got a smb_panic complaining about invalid
lock_order, as ctdbd_migrate is called from dbwrap_fetch_locked().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10444
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 21 14:51:51 CET 2014 on sn-devel-104

10 years agos3:lib/ctdbd_conn: let release_ip_handler return bool
Stefan Metzmacher [Mon, 17 Feb 2014 10:57:52 +0000 (11:57 +0100)]
s3:lib/ctdbd_conn: let release_ip_handler return bool

If it returns true the passed ip address matched and we
let a nested ctdb operation fail with NT_STATUS_ADDRESS_CLOSED.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agos3:smbd: maintain smbd_server_connection->status
Stefan Metzmacher [Mon, 17 Feb 2014 11:01:12 +0000 (12:01 +0100)]
s3:smbd: maintain smbd_server_connection->status

If this isn't NT_STATUS_OK, we skip any io on the socket.

This avoids possible problems during shutdown.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agos3:smbd: simplify exit_server_common()
Stefan Metzmacher [Mon, 17 Feb 2014 11:05:42 +0000 (12:05 +0100)]
s3:smbd: simplify exit_server_common()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agoclitar: don't panic, propagate talloc errors upwards
David Disseldorp [Thu, 20 Feb 2014 18:47:50 +0000 (19:47 +0100)]
clitar: don't panic, propagate talloc errors upwards

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Feb 21 02:49:36 CET 2014 on sn-devel-104

10 years agoclitar: propagate make_remote_path() talloc errors
David Disseldorp [Thu, 20 Feb 2014 18:47:49 +0000 (19:47 +0100)]
clitar: propagate make_remote_path() talloc errors

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: return allocation errors from is_subpath()
David Disseldorp [Thu, 20 Feb 2014 18:47:48 +0000 (19:47 +0100)]
clitar: return allocation errors from is_subpath()

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: add error return to tar_path_in_list()
David Disseldorp [Thu, 20 Feb 2014 18:47:47 +0000 (19:47 +0100)]
clitar: add error return to tar_path_in_list()

In preparation for propagation of memory allocation errors from
is_subpath().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: add error return to tar_extract_skip_path()
David Disseldorp [Thu, 20 Feb 2014 18:47:46 +0000 (19:47 +0100)]
clitar: add error return to tar_extract_skip_path()

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: add error return to tar_create_skip_path()
David Disseldorp [Thu, 20 Feb 2014 18:47:45 +0000 (19:47 +0100)]
clitar: add error return to tar_create_skip_path()

In preparation for propagation of memory allocation errors from
tar_path_in_list() and friends.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoclitar: check for path_base_name() allocation errors
David Disseldorp [Thu, 20 Feb 2014 18:47:44 +0000 (19:47 +0100)]
clitar: check for path_base_name() allocation errors

Add a separate NTSTATUS return code, as base string may be NULL on
successful return.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolib: Fix a typo
Volker Lendecke [Tue, 31 Dec 2013 14:28:04 +0000 (15:28 +0100)]
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 20 22:58:59 CET 2014 on sn-devel-104

10 years agomessaging: Fix a memleak on error in messaging_tdb_init
Volker Lendecke [Sat, 28 Dec 2013 13:18:32 +0000 (14:18 +0100)]
messaging: Fix a memleak on error in messaging_tdb_init

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agolib: Avoid a strlen call in xx_path()
Volker Lendecke [Wed, 1 Jan 2014 10:38:52 +0000 (11:38 +0100)]
lib: Avoid a strlen call in xx_path()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agokrb5_locator: Slightly simplify code
Volker Lendecke [Thu, 13 Feb 2014 13:19:26 +0000 (13:19 +0000)]
krb5_locator: Slightly simplify code

This makes it a bit easier to read for me

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
10 years agowinbindd: Avoid using deallocated memory
Santosh Kumar Pradhan [Thu, 20 Feb 2014 10:21:37 +0000 (15:51 +0530)]
winbindd: Avoid using deallocated memory

Failure in ads_search_retry() deallocates the memory occupied
by "ads" which should not be used after.

CID: 242096

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
10 years agomessaging: Enforce just one messaging context
Volker Lendecke [Tue, 18 Feb 2014 19:51:23 +0000 (20:51 +0100)]
messaging: Enforce just one messaging context

The current messaging implementation is based on a tdb indexed by server_id. If
we have more than one messaging context in a process, messages might not arrive
at the right context and be dropped, depending on which signal handler is
triggered first.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agovfstext: Use just one messaging_context in vfstest
Volker Lendecke [Tue, 18 Feb 2014 19:51:57 +0000 (20:51 +0100)]
vfstext: Use just one messaging_context in vfstest

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agospoolssd: Use only one messaging_context per process
Volker Lendecke [Tue, 18 Feb 2014 19:51:43 +0000 (20:51 +0100)]
spoolssd: Use only one messaging_context per process

After the fork, the code created a fresh messaging_context before doing the
reinit_after_fork. This means to have two initialized messaging contexts in
that process. This patch aligns spoolssd with lsad.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoheimdal_build: only enable libintl functions if everything was found
Christian Ambach [Wed, 19 Feb 2014 21:17:01 +0000 (22:17 +0100)]
heimdal_build: only enable libintl functions if everything was found

do not rely on intl.h being available but also on the functions being usable
This should fix the build on HP-UX

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
Signed-off-by: Christian Ambach <ambi@samba.org>
Change-Id: I5dd88d2d5216b778624778455cca99b32d0be58f
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 20 01:28:24 CET 2014 on sn-devel-104

10 years agoparam: add const to a local variable to prevent a warning about lp_fstype
Garming Sam [Thu, 13 Feb 2014 21:38:55 +0000 (10:38 +1300)]
param: add const to a local variable to prevent a warning about lp_fstype

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: Idc9217eb812b018fed933f84c2c4f1818f8f9372
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
10 years agoparam: remove lp_dnsdomain from s3
Garming Sam [Fri, 24 Jan 2014 04:39:41 +0000 (17:39 +1300)]
param: remove lp_dnsdomain from s3

With the use of the shared globals structure, lp_dnsdomain is no longer used in the code and removing it would remove a notable special case

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I59526c40c58e132a134d67fa7944dfeacd05f4c6
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
10 years agoparam: change s3_param.h from a generated file to a static one
Garming Sam [Fri, 24 Jan 2014 03:45:31 +0000 (16:45 +1300)]
param: change s3_param.h from a generated file to a static one

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I131e37ec92f7a826caec382023915c5e4b4c52be
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
10 years agoparam: remove generated loadparm ctx table file and include it directly
Garming Sam [Fri, 24 Jan 2014 02:52:15 +0000 (15:52 +1300)]
param: remove generated loadparm ctx table file and include it directly

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I5f1d42e3ae6495accf7a711938cc28c03ab2cd62
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
10 years agoparam: use loadparm_globals struct instead of lp function pointers in s3_helpers
Garming Sam [Fri, 24 Jan 2014 02:38:59 +0000 (15:38 +1300)]
param: use loadparm_globals struct instead of lp function pointers in s3_helpers

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I4507cdbf111b7f9dca3ca18ee2bf242ffdfeb4e7
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
10 years agolib/param: rename lp_string to lpcfg_string
Garming Sam [Thu, 13 Feb 2014 21:23:36 +0000 (10:23 +1300)]
lib/param: rename lp_string to lpcfg_string

This avoids the confusion with lp_string in source3.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: Ic6df23b9e5986f7d1fd6253e30ebfdc1a3a45a41
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
10 years agolib/param: handle non-constant strings properly by passing in a memory context
Garming Sam [Thu, 16 Jan 2014 21:30:37 +0000 (10:30 +1300)]
lib/param: handle non-constant strings properly by passing in a memory context

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: Ic6bb1c709defd2b0f35fc7b877da0badca385776
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
10 years agos4: pass down a memory context when performing share_string_option, to allow substitu...
Garming Sam [Thu, 16 Jan 2014 21:16:12 +0000 (10:16 +1300)]
s4: pass down a memory context when performing share_string_option, to allow substitutions

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I24b36db3ac11834c3268b2da929e214c10268b16
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
10 years agobuild: check for libarchive version via pkgconfig
David Disseldorp [Wed, 19 Feb 2014 16:17:45 +0000 (17:17 +0100)]
build: check for libarchive version via pkgconfig

The previous libarchive linker and header file check was not suitible
for older libarchive versions that do not provide the function
archive_read_support_filter_all().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Feb 19 20:19:07 CET 2014 on sn-devel-104

10 years agocli: do not dump libarchive absence warning on startup
David Disseldorp [Wed, 19 Feb 2014 15:41:35 +0000 (16:41 +0100)]
cli: do not dump libarchive absence warning on startup

tar_parse_args() already prints the warning if a tarmode argument is
provided.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3-clitar: Fix identation.
Andreas Schneider [Mon, 17 Feb 2014 14:00:43 +0000 (15:00 +0100)]
s3-clitar: Fix identation.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Simplify is_subpath().
Andreas Schneider [Mon, 17 Feb 2014 10:24:33 +0000 (11:24 +0100)]
s3-clitar: Simplify is_subpath().

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of fix_unix_path().
Andreas Schneider [Mon, 17 Feb 2014 10:32:14 +0000 (11:32 +0100)]
s3-clitar: Improve readabilty of fix_unix_path().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of max_token().
Andreas Schneider [Mon, 17 Feb 2014 10:28:13 +0000 (11:28 +0100)]
s3-clitar: Improve readabilty of max_token().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of make_remote_path().
Andreas Schneider [Mon, 17 Feb 2014 10:25:43 +0000 (11:25 +0100)]
s3-clitar: Improve readabilty of make_remote_path().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of tar_path_in_list().
Andreas Schneider [Mon, 17 Feb 2014 10:12:05 +0000 (11:12 +0100)]
s3-clitar: Improve readabilty of tar_path_in_list().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of tar_read_inclusion_file().
Andreas Schneider [Mon, 17 Feb 2014 10:10:11 +0000 (11:10 +0100)]
s3-clitar: Improve readabilty of tar_read_inclusion_file().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of tar_set_newer_than().
Andreas Schneider [Mon, 17 Feb 2014 10:07:16 +0000 (11:07 +0100)]
s3-clitar: Improve readabilty of tar_set_newer_than().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of tar_send_file().
Andreas Schneider [Mon, 17 Feb 2014 10:05:28 +0000 (11:05 +0100)]
s3-clitar: Improve readabilty of tar_send_file().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of tar_extract().
Andreas Schneider [Mon, 17 Feb 2014 10:03:53 +0000 (11:03 +0100)]
s3-clitar: Improve readabilty of tar_extract().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of get_file_callback().
Andreas Schneider [Mon, 17 Feb 2014 09:59:27 +0000 (10:59 +0100)]
s3-clitar: Improve readabilty of get_file_callback().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of tar_create_from_list().
Andreas Schneider [Mon, 17 Feb 2014 09:57:29 +0000 (10:57 +0100)]
s3-clitar: Improve readabilty of tar_create_from_list().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of tar_parse_args().
Andreas Schneider [Mon, 17 Feb 2014 09:55:59 +0000 (10:55 +0100)]
s3-clitar: Improve readabilty of tar_parse_args().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of cmd_setmode().
Andreas Schneider [Mon, 17 Feb 2014 09:50:17 +0000 (10:50 +0100)]
s3-clitar: Improve readabilty of cmd_setmode().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of cmd_tar().
Andreas Schneider [Mon, 17 Feb 2014 09:49:16 +0000 (10:49 +0100)]
s3-clitar: Improve readabilty of cmd_tar().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Improve readabilty of cmd_block().
Andreas Schneider [Mon, 17 Feb 2014 09:47:15 +0000 (10:47 +0100)]
s3-clitar: Improve readabilty of cmd_block().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agos3-clitar: Use ARRAY_SIZE macro.
Andreas Schneider [Sat, 15 Feb 2014 16:05:18 +0000 (17:05 +0100)]
s3-clitar: Use ARRAY_SIZE macro.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agobuild: use configure var for libarchive depenency
David Disseldorp [Sat, 15 Feb 2014 09:37:28 +0000 (10:37 +0100)]
build: use configure var for libarchive depenency

Avoid CONFIG_SET('HAVE_LIBARCHIVE') checks in wscript_build, by using a
simple archive_lib variable.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar: get tar context handle via helper function
David Disseldorp [Fri, 14 Feb 2014 16:16:14 +0000 (17:16 +0100)]
clitar: get tar context handle via helper function

Add and use tar_get_ctx() to get the tarmode context handle in client.c,
rather than declaring an extern.
Also, add checks for NULL context pointer arguments.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3: fix --with-libarchive bug, remove useless DEFINE()
Aurélien Aptel [Wed, 7 Aug 2013 15:50:15 +0000 (17:50 +0200)]
s3: fix --with-libarchive bug, remove useless DEFINE()

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: fix segfault in cmd_block()
Aurélien Aptel [Wed, 7 Aug 2013 14:49:20 +0000 (16:49 +0200)]
clitar.c: fix segfault in cmd_block()

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3: add --with-libarchive to build configuration
Aurélien Aptel [Wed, 7 Aug 2013 14:34:22 +0000 (16:34 +0200)]
s3: add --with-libarchive to build configuration

* skip tar tests if disabled
* print error message when using disabled command
* autodetection of libarchive

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
[ddiss@samba.org: rebased against makefile cleanup]
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3/selftest/tests.py: add test_smbclient_tarmode.pl to test suite
Aurélien Aptel [Mon, 5 Aug 2013 17:02:47 +0000 (19:02 +0200)]
s3/selftest/tests.py: add test_smbclient_tarmode.pl to test suite

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agomanpages/smbclient: remove trailing whitespace
Aurélien Aptel [Wed, 31 Jul 2013 15:29:10 +0000 (17:29 +0200)]
manpages/smbclient: remove trailing whitespace

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
[ddiss@samba.org: split from tarmode documentation chages]
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agomanpages/smbclient: update tarmode documentation
Aurélien Aptel [Thu, 30 Jan 2014 12:05:31 +0000 (13:05 +0100)]
manpages/smbclient: update tarmode documentation

* document tarmode (nosystem, nohidden)
* deprecate r switch in tar options

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
[ddiss@samba.org: split from whitespace cleanup]
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: check all allocations return value
Aurélien Aptel [Wed, 24 Jul 2013 15:32:17 +0000 (17:32 +0200)]
clitar.c: check all allocations return value

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: create and free talloc context properly
Aurélien Aptel [Wed, 24 Jul 2013 14:48:02 +0000 (16:48 +0200)]
clitar.c: create and free talloc context properly

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar: remove unnecessary public function prototypes
David Disseldorp [Fri, 14 Feb 2014 16:22:50 +0000 (17:22 +0100)]
clitar: remove unnecessary public function prototypes

Public functions declared in clitar_proto.h needn't be listed as
prototypes in clitar.c.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: add prototype, rearrange definition for easier reading.
Aurélien Aptel [Tue, 23 Jul 2013 15:39:09 +0000 (17:39 +0200)]
clitar.c: add prototype, rearrange definition for easier reading.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: documentation
Aurélien Aptel [Tue, 23 Jul 2013 14:55:50 +0000 (16:55 +0200)]
clitar.c: documentation

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: honor regex flag, emulate old behaviour (and quirks), add tests
Aurélien Aptel [Fri, 19 Jul 2013 16:35:01 +0000 (18:35 +0200)]
clitar.c: honor regex flag, emulate old behaviour (and quirks), add tests

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
[ddiss@samba.org: split from test changes already upstream]
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: blocksize in block unit, fix error handling in tar_create().
Aurélien Aptel [Thu, 18 Jul 2013 15:06:33 +0000 (17:06 +0200)]
clitar.c: blocksize in block unit, fix error handling in tar_create().

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclient: fix tar_parse_args() compiler warning
David Disseldorp [Fri, 14 Feb 2014 17:08:28 +0000 (18:08 +0100)]
client: fix tar_parse_args() compiler warning

tar_parse_args() requires a const argument array pointer.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: when returning int, always use 0 for success
Aurélien Aptel [Thu, 18 Jul 2013 14:22:26 +0000 (16:22 +0200)]
clitar.c: when returning int, always use 0 for success

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.h: delete file
Aurélien Aptel [Wed, 17 Jul 2013 16:04:20 +0000 (18:04 +0200)]
clitar.h: delete file

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: default block size was a multiple of TBLOCK
Aurélien Aptel [Wed, 17 Jul 2013 16:01:59 +0000 (18:01 +0200)]
clitar.c: default block size was a multiple of TBLOCK

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: only list <include list> instead of whole share, handle wildcards
Aurélien Aptel [Wed, 17 Jul 2013 14:25:34 +0000 (16:25 +0200)]
clitar.c: only list <include list> instead of whole share, handle wildcards

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: implement interactive command + respective test
Aurélien Aptel [Tue, 16 Jul 2013 17:15:48 +0000 (19:15 +0200)]
clitar.c: implement interactive command + respective test

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
[ddiss@samba.org: split from test changes already upstream]
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: cosmetic changes
Aurélien Aptel [Tue, 16 Jul 2013 14:32:29 +0000 (16:32 +0200)]
clitar.c: cosmetic changes

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: operation INCLUDE_LIST same as INCLUDE
Aurélien Aptel [Tue, 16 Jul 2013 14:22:13 +0000 (16:22 +0200)]
clitar.c: operation INCLUDE_LIST same as INCLUDE

use local variable during argument parsing to separate
the 2 cases.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: fix creation exclusion, don't reverse in exclusion mode
Aurélien Aptel [Tue, 16 Jul 2013 14:16:29 +0000 (16:16 +0200)]
clitar.c: fix creation exclusion, don't reverse in exclusion mode

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: fix include mode bug
Aurélien Aptel [Tue, 16 Jul 2013 13:49:27 +0000 (15:49 +0200)]
clitar.c: fix include mode bug

- if we include path/a/, path/ was skipped because
  it's not in path/a/.
- solution: add a flag to tar_path_in_list() to also
  check the opposite ie. if the list is in the path

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: implement reset mode
Aurélien Aptel [Tue, 16 Jul 2013 12:47:29 +0000 (14:47 +0200)]
clitar.c: implement reset mode

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar: implement exclusion filter for extraction
Aurélien Aptel [Mon, 15 Jul 2013 16:58:36 +0000 (18:58 +0200)]
clitar: implement exclusion filter for extraction

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: implement dry mode, add total_size and fix write bug
Aurélien Aptel [Thu, 11 Jul 2013 16:17:25 +0000 (18:17 +0200)]
clitar.c: implement dry mode, add total_size and fix write bug

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: add line in DBG macro
Aurélien Aptel [Thu, 11 Jul 2013 16:12:38 +0000 (18:12 +0200)]
clitar.c: add line in DBG macro

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: implement nosystem, nohidden and include filter.
Aurélien Aptel [Thu, 11 Jul 2013 13:56:03 +0000 (15:56 +0200)]
clitar.c: implement nosystem, nohidden and include filter.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: implement basic tar creation
Aurélien Aptel [Wed, 10 Jul 2013 22:57:40 +0000 (00:57 +0200)]
clitar.c: implement basic tar creation

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: don't create file when processing dir
Aurélien Aptel [Wed, 10 Jul 2013 12:12:25 +0000 (14:12 +0200)]
clitar.c: don't create file when processing dir

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: implement basic full extraction
Aurélien Aptel [Wed, 10 Jul 2013 11:16:08 +0000 (13:16 +0200)]
clitar.c: implement basic full extraction

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: fix_unix_path() now replace / with \
Aurélien Aptel [Tue, 9 Jul 2013 21:44:16 +0000 (23:44 +0200)]
clitar.c: fix_unix_path() now replace / with \

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: factor path_list handling in a function, remove tar_fd
Aurélien Aptel [Tue, 9 Jul 2013 21:17:46 +0000 (23:17 +0200)]
clitar.c: factor path_list handling in a function, remove tar_fd

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoclitar.c: update TAR_DEFAULT_BLOCK_SIZE comment
Aurélien Aptel [Tue, 9 Jul 2013 21:07:06 +0000 (23:07 +0200)]
clitar.c: update TAR_DEFAULT_BLOCK_SIZE comment

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>