David Disseldorp
43227c3d9f
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>
2014-02-19 18:22:31 +01:00
Andreas Schneider
6759008666
s3-clitar: Fix identation.
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
995118484f
s3-clitar: Simplify is_subpath().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
3b207dc0f3
s3-clitar: Improve readabilty of fix_unix_path().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
ef150e7dfa
s3-clitar: Improve readabilty of max_token().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
4f6552c63b
s3-clitar: Improve readabilty of make_remote_path().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
98ede411e3
s3-clitar: Improve readabilty of tar_path_in_list().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
2ccba45d30
s3-clitar: Improve readabilty of tar_read_inclusion_file().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
f955bc4b5d
s3-clitar: Improve readabilty of tar_set_newer_than().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
75dbb27115
s3-clitar: Improve readabilty of tar_send_file().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
f58ef3878e
s3-clitar: Improve readabilty of tar_extract().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
f8ac29d1ac
s3-clitar: Improve readabilty of get_file_callback().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
4dd84bb830
s3-clitar: Improve readabilty of tar_create_from_list().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
87c5258fa3
s3-clitar: Improve readabilty of tar_parse_args().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
034da62e6b
s3-clitar: Improve readabilty of cmd_setmode().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
7bb9836c94
s3-clitar: Improve readabilty of cmd_tar().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:29 +01:00
Andreas Schneider
a65f557c6b
s3-clitar: Improve readabilty of cmd_block().
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:29 +01:00
Andreas Schneider
3707fba088
s3-clitar: Use ARRAY_SIZE macro.
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:29 +01:00
David Disseldorp
8dc6f0fb39
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>
2014-02-19 18:22:29 +01:00
Aurélien Aptel
a66942df05
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>
2014-02-19 18:22:29 +01:00
Aurélien Aptel
95f9e60ef7
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>
2014-02-19 18:22:29 +01:00
Aurélien Aptel
b8844fcdae
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>
2014-02-19 18:22:29 +01:00
Aurélien Aptel
68305d90b3
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>
2014-02-19 18:22:29 +01:00
David Disseldorp
08f3c4e942
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>
2014-02-19 18:22:29 +01:00
Aurélien Aptel
44265721bc
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
5cd72b39b3
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
82dce8f7a8
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
fc05ff32fd
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>
2014-02-19 18:22:28 +01:00
David Disseldorp
cae67383dd
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
3a7efaa009
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
9cb9077233
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
7c973de802
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
679cd16270
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
3348b139d2
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
5f99b0915d
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
6d0ff6d2f0
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>
2014-02-19 18:22:28 +01:00
Aurélien Aptel
b825854005
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
cbad767ded
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
e2b0092e1d
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
d96e2b2052
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
d23074cece
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
39a21cdce3
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
9032fc7eec
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
ec1583ebd4
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
b7f6fd26b6
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
c9e23fd1a6
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
dfd627b902
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
5af65f87b5
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>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
29542d1cb5
clitar.c: start processing tar files in extraction mode
...
- move default block size to a define
- add doc comments
- basic processing in tar_extract
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-19 18:22:27 +01:00
Aurélien Aptel
ed9d22097d
client.c: fix negation in tar_to_process test
...
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
[ddiss@samba.org: rebase against lp_cli_maxprotocol() changes]
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-19 18:22:27 +01:00