summaryrefslogtreecommitdiff
path: root/source3/client
AgeCommit message (Collapse)AuthorFilesLines
2017-07-18Revert "s3:smbclient: Allow last dos attribute to be cleared"Jeremy Allison1-21/+3
Incorrect fix - this must be fixed inside cli_setatr(), not the callers. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12899 This reverts commit a4c3ee6767d768365a47bfda32a26cb7994b3787. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2017-07-15s3:client: The smbspool krb5 wrapper needs negotiate for authenticationAndreas Schneider1-10/+19
If you create a new printer it doesn't have AuthInfoRequired set and so cups calls the backend with: AUTH_INFO_REQUIRED=none In this case we need to return: ATTR: auth-info-required=negotiate and return an error that we require authentication. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12886 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): Sat Jul 15 06:43:47 CEST 2017 on sn-devel-144
2017-07-14s3:smbclient: Allow last dos attribute to be clearedSteve French1-3/+21
With the upgrade to SMB3.1.1 from cifs for smbclient, setmode no longer works when removing attributes, if the resultant attribute is 0 it is skipped (unlike for the old cifs setpathinfo). When clearing the final attribute, pass in ATTRIBUTE_NORMAL instead of zero. This also removes a redundant cli_setatr call when clearing attributes (cli_setatr was being called twice). BUG: https://bugzilla.samba.org/show_bug.cgi?id=12899 Signed-off-by: Steve French <sfrench@samba.org> Reviewed-by: Anne Marie Merritt <annemarie.merritt@primarydata.com> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 14 02:43:47 CEST 2017 on sn-devel-144
2017-07-07s3: smbclient: Add new command deltree.Jeremy Allison1-0/+178
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-07-07s3: client: Move struct file_list code to using talloc from malloc.Jeremy Allison1-11/+18
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-06-27s3:libsmb: remove unused 'bool show_hdr' from cli_cm_open()Stefan Metzmacher1-5/+5
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-27s3:smbclient: remove unreliable Domain=[...] OS=[Windows 6.1] Server=[...] ↵Stefan Metzmacher1-5/+7
banner On interactive sessions we print the following instead now: Try "help" do get a list of possible commands. smb: > The reason for this is that we don't get these information via SMB2 and the we only get the domain name via some layering violations from the NTLMSSP state. It's better to remove this consitently for all SMB and auth protocol combinations. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-22s3:client: smbclient -L can't do workgroup listing over SMB2/3Stefan Metzmacher1-4/+9
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-17s3: libsmb: Widen cli_state_get_tid() / cli_state_set_tid() to 32-bits.Jeremy Allison1-1/+4
Copes with SMB2 connections. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12831 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2017-05-09s3: client tools: Call popt_free_cmdline_auth_info() on all normal exits.Jeremy Allison1-0/+3
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-09s3: client tools. Remove direct access to struct user_auth_info ↵Jeremy Allison1-83/+88
*cmdline_auth_info. Only access through utility functions. Remove all the local pointer aliases that were just being set to cmdline_auth_info in the client tools. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-03-28smbclient: add -f option to rename commandUri Simchoni1-2/+8
This option causes the rename to request that the destination file / directory be replaced if it exists. Supported only in SMB2 and higher protocol. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-28s3: libsmb: add replace support to cli_rename()Uri Simchoni1-1/+1
Adds support for replacing the destination file at the higher-level cli_rename(). This is actually supported only by SMB2, and fails with invalid parameter with SMB1. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-17Modify smbspool_krb5_wrapper to just fall through to smbspool if ↵Bryan Mason1-15/+17
AUTH_INFO_REQUIRED is not set or is not "negotiate". BUG: https://bugzilla.samba.org/show_bug.cgi?id=12575 Signed-off-by: Bryan Mason <bmason@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Feb 17 04:27:26 CET 2017 on sn-devel-144
2017-01-27s3:client: don't use cli->use_kerberos && cli->got_kerberos_mechanism in ↵Stefan Metzmacher1-8/+9
smbspool.c We already know if we want to use kerberos and there's no point in altering the error message if we tried but failed to use kerberos. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-12-21s3:client: use cli_cm_force_encryption_creds in smbspool.c (in a #if 0 section)Stefan Metzmacher1-5/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-12-21s3:client: make use of cli_smb1_setup_encryption() in cmd_posix_encrypt()Stefan Metzmacher1-14/+32
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-12-20s3:popt_common: let POPT_COMMON_CREDENTIALS imply logfile and conffile loadingStefan Metzmacher1-10/+1
All users of POPT_COMMON_CREDENTIALS basically need the same logic, while some ignore a broken smb.conf and some complain about it. This will allow the future usage of config options in the credential post processing. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-11smbclient: xfile->stdioVolker Lendecke1-17/+16
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2016-12-09s3:libsmb: don't pass 'passlen' to cli_tree_connect[_send]() and allow pass=NULLStefan Metzmacher1-1/+1
There're no callers which try to pass a raw lm_response directly anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Dec 9 13:09:37 CET 2016 on sn-devel-144
2016-12-09s3:client: avoid using cli->{use_kerberos,...} for cli_session_creds_init() ↵Stefan Metzmacher1-4/+9
in smbspool.c CLI_FULL_CONNECTION_USE_KERBEROS is the only possible flag the caller of smb_complete_connection() will pass, so we can avoid use it directly instead of going via cli_start_connection() to use cli->use_kerberos. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-12-09s3:client: make use of cli_tree_connect_creds() in smbspool.cStefan Metzmacher1-2/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-20lib: Remove global xfile.h includesVolker Lendecke1-0/+1
This makes it more obvious where this legacy code is used Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Nov 20 06:23:19 CET 2016 on sn-devel-144
2016-11-15s3:client: use cli_session_setup_creds() in smbspool.cStefan Metzmacher1-3/+17
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-15s3:client: use cli_session_setup_creds() in client.c cmd_logon()Stefan Metzmacher1-3/+16
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-15s3:libsmb: let the callers only pass the password string to ↵Stefan Metzmacher2-4/+2
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-15s3:popt_common: simplify popt_common_credentials handlingStefan Metzmacher1-16/+8
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-15s3/client: obey 'disable netbios' smb.conf param, don't connect via NBT port.Noel Power1-1/+10
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-09s3-client: Sync in tool cmdline help with smbclient manpageAndreas Schneider1-1/+1
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-08-22s3: smbclient. Ensure we don't crash by freeing uninitialized *snapshots.Jeremy Allison1-1/+1
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-19s3: smbclient: In order to get shadow copy data over SMB1 we must call ↵Jeremy Allison1-0/+14
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-06-16s3-client: Fix compiler errors when building with --address-sanitizerAndrew Bartlett1-1/+1
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-02s3/client/clitar.c: always close fdAurelien Aptel1-3/+4
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-01s3/client/clitar.c: NULL-check correct variableAurelien Aptel1-1/+1
`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-05-25s3: smbclient: Add posix_whoami command.Jeremy Allison1-0/+46
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
2016-05-25s3-smbspool: Log to stderrAndreas Schneider1-1/+1
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-04-29s3:client:smbspool_krb5_wrapper: fix the non clearenv build.Günther Deschner1-2/+6
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-29Provide fallback code for non-portable clearenv(3)Jérémie Courrèges-Anglas1-0/+6
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-03-10CVE-2015-7560: s3: libsmb: Rename cli_posix_getfaclXX() functions to ↵Jeremy Allison1-1/+1
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-01-25s3-client: Add a KRB5 wrapper for smbspoolAndreas Schneider2-0/+227
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-22smbspool: Add string representation of nt_statusAndreas Schneider1-2/+2
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-06smbclient: query disk usage relative to current directoryUri Simchoni1-1/+1
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>
2015-12-03clitar: cope with functions of older versions of libarchiveBjörn Jacke1-0/+10
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-02client: Fix parameter mixupVolker Lendecke1-1/+1
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-11-06Fix various spelling errorsMathieu Parent1-1/+1
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-09-18s3: smbclient: Move cmd_setmode out of clitar.c and back into client.cJeremy Allison3-129/+124
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-07-14s3:client: Add "scopy" cmd to perform Server Side copy using smbclient.Anubhav Rakshit1-0/+134
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2015-05-13Convert all uint32/16/8 to _t in source3/client.Richard Sharpe4-28/+28
Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-24lib: load_case_tables() -> smb_init_locale()Volker Lendecke2-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-02-10s3: smbclient: Allinfo leaves the file handle open.Jeremy Allison1-0/+1
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