1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

1212 Commits

Author SHA1 Message Date
Stefan Metzmacher
a484a70f22 s3:client: use cli_session_setup_creds() in smbspool.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-15 11:00:29 +01:00
Stefan Metzmacher
5e51f6457e s3:client: use cli_session_setup_creds() in client.c cmd_logon()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-15 11:00:29 +01:00
Stefan Metzmacher
482d3b35e9 s3:libsmb: let the callers only pass the password string to cli_session_setup[_send]()
There're no callers which tried to pass raw {lm,nt}_response any more.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-15 11:00:26 +01:00
Stefan Metzmacher
d6d8893d56 s3:popt_common: simplify popt_common_credentials handling
This offers a global 'struct user_auth_info *cmdline_auth_info',
similar to the 'cmdline_credentials' we have in
source4/lib/cmdline/popt_common.c.

And we create that in the POPT_CALLBACK_REASON_PRE stage
and finalize it in the POPT_CALLBACK_REASON_POST stage.

That means much less boring work for the callers
and more freedom to change the user_auth_info internals
in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-15 11:00:26 +01:00
Noel Power
15fa802c77 s3/client: obey 'disable netbios' smb.conf param, don't connect via NBT port.
If 'disable netbios' is true 'smbclient -L //server' will try use the NBT
port to list the servers and 'smbclient -M //server' use the netbios
messaging WinPopup facility, we should honour the config and not do that.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12418

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-15 01:14:21 +01:00
Andreas Schneider
82e630dc35 s3-client: Sync in tool cmdline help with smbclient manpage
From smbclient manpage:
notify <dir name>
    Query a directory for change notifications. This command issues a
    recursive filechangenotify call for all possible changes.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov  9 06:12:23 CET 2016 on sn-devel-144
2016-11-09 06:12:23 +01:00
Jeremy Allison
cb687a6af0 s3: smbclient. Ensure we don't crash by freeing uninitialized *snapshots.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-08-22 19:10:22 +02:00
Jeremy Allison
57a54af66f s3: smbclient: In order to get shadow copy data over SMB1 we must call cli_shadow_copy_data() twice.
Once with 'get_names = false' to get the size, then again with 'get_names = true'
to get the data or a Windows server fails to return valid info. Samba doesn't have this bug.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Aug 19 23:59:35 CEST 2016 on sn-devel-144
2016-08-19 23:59:35 +02:00
Andrew Bartlett
c0a930249a s3-client: Fix compiler errors when building with --address-sanitizer
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-16 04:40:13 +02:00
Aurelien Aptel
0b79ec200d s3/client/clitar.c: always close fd
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jun  2 12:47:26 CEST 2016 on sn-devel-144
2016-06-02 12:47:26 +02:00
Aurelien Aptel
4feffb6707 s3/client/clitar.c: NULL-check correct variable
`f` was checked again instead of `s`.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: ndreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-06-01 00:57:32 +02:00
Jeremy Allison
17045c315a s3: smbclient: Add posix_whoami command.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-05-25 23:09:08 +02:00
Andreas Schneider
e59e0a5481 s3-smbspool: Log to stderr
This way we will be able to see the log in the cups logs and are able to
debug issues.

https://bugzilla.samba.org/show_bug.cgi?id=11935

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-05-25 16:49:23 +02:00
Günther Deschner
e0d8c6b6b4 s3:client:smbspool_krb5_wrapper: fix the non clearenv build.
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Apr 29 19:52:23 CEST 2016 on sn-devel-144
2016-04-29 19:52:23 +02:00
Jérémie Courrèges-Anglas
f198abcbb3 Provide fallback code for non-portable clearenv(3)
clearenv(3) is a GNU extension that was rejected twice by POSIX,
without an easy, portable alternative.

As the dovecot project notes,
"""
environ = NULL crashes on OSX - and OpenBSD < 6.0
*environ = NULL doesn't work on FreeBSD 7.0
environ = emptyenv doesn't work on Haiku OS
environ = calloc should work everywhere
"""
(source: http://hg.dovecot.org/dovecot-2.0/file/48f90e7e92dc/src/lib/env-util.c)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11864
Signed-off-by: Jérémie Courrèges-Anglas <jca@wxcvbn.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 29 00:12:02 CEST 2016 on sn-devel-144
2016-04-29 00:12:02 +02:00
Jeremy Allison
e7e23e9647 CVE-2015-7560: s3: libsmb: Rename cli_posix_getfaclXX() functions to cli_posix_getacl() as they operate on pathnames.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-03-10 06:52:23 +01:00
Andreas Schneider
62c68bd8c8 s3-client: Add a KRB5 wrapper for smbspool
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11690

We need a wrapper for smbspool to be able to authenticate with Kerberos.
This needs to replace the cups smb backend. The permission need to be
0700 and the owner root.

Note that Kerberos support is broken in CUPS 2.1.2 maybe earlier
versions. It works with 1.6.3.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 25 19:58:46 CET 2016 on sn-devel-144
2016-01-25 19:58:46 +01:00
Andreas Schneider
8ec92e5073 smbspool: Add string representation of nt_status
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 22 20:59:36 CET 2016 on sn-devel-144
2016-01-22 20:59:36 +01:00
Uri Simchoni
275da6c5c7 smbclient: query disk usage relative to current directory
When querying disk usage in the "dir" and "du" commands,
use the current directory. This behavior is compatible
with Windows command shell "dir" command.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11662

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-01-06 00:54:18 +01:00
Björn Jacke
c118fbc680 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@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Dec  3 16:09:08 CET 2015 on sn-devel-104
2015-12-03 16:09:08 +01:00
Volker Lendecke
412cefc7c8 client: Fix parameter mixup
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11628

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Dec  2 21:01:14 CET 2015 on sn-devel-104
2015-12-02 21:01:14 +01:00
Mathieu Parent
c315fce17e Fix various spelling errors
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  6 13:43:45 CET 2015 on sn-devel-104
2015-11-06 13:43:45 +01:00
Jeremy Allison
a47012d542 s3: smbclient: Move cmd_setmode out of clitar.c and back into client.c
setmode <file> attribute is a valid smbclient command even if libarchive
isn't on the system and tarmode isn't compiled in.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-18 07:58:15 +02:00
Anubhav Rakshit
cebcf0e4da s3:client: Add "scopy" cmd to perform Server Side copy using smbclient.
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-14 13:04:17 +02:00
Richard Sharpe
589c7bc6d6 Convert all uint32/16/8 to _t in source3/client.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-13 19:11:23 +02:00
Volker Lendecke
c51300ad89 lib: load_case_tables() -> smb_init_locale()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-24 00:00:20 +01:00
Jeremy Allison
080ec0f7d9 s3: smbclient: Allinfo leaves the file handle open.
https://bugzilla.samba.org/show_bug.cgi?id=11094

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Feb 10 23:28:46 CET 2015 on sn-devel-104
2015-02-10 23:28:46 +01:00
Andreas Schneider
eb1bf816b6 s3-smbspool: Use strtol() instead of atoi().
This fixes a coverity warning.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-22 20:29:06 +01:00
Andreas Schneider
6557a0218a s3-smbclient: Return success if we listed the shares.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10960

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-24 18:52:05 +01:00
Volker Lendecke
dcd6373613 lib: Align unix_timespec_to_nt_time with nt_time_to_unix_timespec
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-30 22:28:14 +02:00
Jeremy Allison
66a04ba7c1 s3: libsmb : Move users of cli_dskattr to a 64-bit interface cli_disk_free().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2014-06-07 03:15:14 +02:00
Jeremy Allison
69e24b4e8b s3: client : Add extra return parameter to all client open calls.
Add a return parameter of struct smb_create_returns *cr to
cli_ntcreate()
cli_ntcreate_recv()
cli_nttrans_create()
cli_nttrans_create_recv()

Always pass in NULL for now. This fixes the create
API to always fully return the data the server has
given back to us on the open file to the caller.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-09 23:10:07 +02:00
Stefan Metzmacher
f0f245f4c8 s3:client: only limit the buffer by the given length 'n'
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-05 10:06:24 -08:00
David Disseldorp
913b2a172d 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
2014-02-21 02:49:35 +01:00
David Disseldorp
83a653fadb clitar: propagate make_remote_path() talloc errors
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:03:02 +13:00
David Disseldorp
55de6d60ef clitar: return allocation errors from is_subpath()
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:02:57 +13:00
David Disseldorp
852259773b 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>
2014-02-21 12:02:52 +13:00
David Disseldorp
6d5b56dc7a clitar: add error return to tar_extract_skip_path()
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:02:48 +13:00
David Disseldorp
4d9e1b68b7 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>
2014-02-21 12:02:43 +13:00
David Disseldorp
385f0c9ea0 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>
2014-02-21 12:02:43 +13:00
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
Aurélien Aptel
50d069637d client.c, clitar.c: rename process_tar to tar_process, prepare code
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:26 +01:00
Aurélien Aptel
60eec86ceb clitar.c, client.c: add flag to know if there's a tar operation to do.
- remove tar_type global.

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:26 +01:00
Aurélien Aptel
b753900b09 clitar.c: fix path name when adding them
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:26 +01:00
Aurélien Aptel
3a8e3264d0 clitar: use lowercase for bool 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:26 +01:00
Aurélien Aptel
113aa6f3d4 clitar.c: add tar_dump() debug function, fix bugs
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:26 +01:00
Aurélien Aptel
431483e6b9 client.c: remove unused extern declaration
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:26 +01:00
Aurélien Aptel
45a45c8eda implement argument parsing, split client_proto.h
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:26 +01:00
Aurélien Aptel
eebd378b6c client.c: remove trailing whitespace
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:26 +01:00
Aurélien Aptel
342d38eb4b clitar.c: start of argument parsing
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:26 +01:00
Aurélien Aptel
b9b5bc433d clitar.c: add doc, remove _t suffix in enum name
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:26 +01:00