summaryrefslogtreecommitdiff
path: root/source3/client
Commit message (Collapse)AuthorAgeFilesLines
* s3: smbclient: Stop an SMB2-connection from blundering into SMB1-specific calls.Jeremy Allison2019-10-071-0/+4
| | | | | | | | | | | | Fix in the same way this was done in SMBC_opendir_ctx() for libsmbclient. This fix means the admin no longer has to remember to set 'min client protocol =' when connecting to an SMB2-only server (MacOSX for example) and trying to list shares. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14152 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:client:Use DEVICE_URI, instead of argv[0],for Device URIBryan Mason2019-09-181-7/+9
| | | | | | | | | | | | | | CUPS sanitizes argv[0] by removing username/password, so use DEVICE_URI environment variable first. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14128 Signed-off-by: Bryan Mason <bmason@redhat.com> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Sep 18 12:31:11 UTC 2019 on sn-devel-184
* client: enable allinfo and altname tab completionDavid Disseldorp2019-06-251-2/+2
| | | | | | | | | | Should tab-complete a single remote path. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Jun 25 10:55:45 UTC 2019 on sn-devel-184
* s3:smbspool: Use NTSTATUS return codesAndreas Schneider2019-05-231-105/+145
| | | | | | | | | This allows us to simplify some code and return better errors. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Add debug messages to kerberos_ccache_is_valid()Andreas Schneider2019-05-231-0/+6
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Always try to authenticate using KerberosAndreas Schneider2019-05-231-39/+51
| | | | | | | | | | | If username and password is given, then fallback to NTLM. However try kinit first. Also we correctly handle NULL passwords in the meantime and this makes it easier to deal with issues. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Print the filename we failed to openAndreas Schneider2019-05-231-1/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Fallback to default ccache if KRB5CCNAME is not setAndreas Schneider2019-05-231-25/+54
| | | | | | | | | This could also support the new KCM credential cache storage. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Use %u format specifier to print uidAndreas Schneider2019-05-231-3/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Add debug for finding KRB5CCNAMEAndreas Schneider2019-05-231-0/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Print the principal we use to authenticate withAndreas Schneider2019-05-231-0/+11
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Add the 'lp' group to the users groupsAndreas Schneider2019-05-231-0/+22
| | | | | | | | | | This is required to access files in /var/spool/cups which have been temporarily created in there by CUPS. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:smbspool: Fix regression printing with Kerberos credentialsAndreas Schneider2019-05-091-1/+1
| | | | | | | | | | | | This is a regression which has been introduced with Samba 4.8. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu May 9 16:46:05 UTC 2019 on sn-devel-184
* libsmb: Change cli_posix_readlink to return talloc'ed targetVolker Lendecke2019-03-271-2/+4
| | | | | | | | | | | | | | | | This is a deviation from the Posix readlink function that from my point of view makes this function easier to use. In Posix, probably the assumption is that readlink is cheap, so someone under memory constraints could just start with a small buffer and incrementally increase the buffer size. For us, it's a network round-trip, and we have the luxury of [mt]alloc, which the syscall kernel interface does not have. 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): Wed Mar 27 12:31:37 UTC 2019 on sn-devel-144
* utils: Use cli_hardlink instead of cli_nt_hardlinkVolker Lendecke2019-03-201-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:client: Fix smbspool device uri handlingAndreas Schneider2019-03-181-24/+96
| | | | | | | | | | | | | If we are executed as a CUPS backend, argv[0] is set to the device uri. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13832 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Bryan Mason <bmason@redhat.com> Signed-off-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Mar 18 16:47:55 UTC 2019 on sn-devel-144
* s3:client: Make sure we work on a copy of the titleAndreas Schneider2019-03-181-4/+10
| | | | | | | | | | We can't be sure we can write to the input buffer. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13832 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Bryan Mason <bmason@redhat.com> Signed-off-by: Guenther Deschner <gd@samba.org>
* s3:client: Evaluate the AUTH_INFO_REQUIRED variable set by cupsAndreas Schneider2019-03-181-12/+20
| | | | | | | | | | | This should not switch to username,password if cups has been configured to use negotiate (Kerberos authentication). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13832 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Bryan Mason <bmason@redhat.com> Signed-off-by: Guenther Deschner <gd@samba.org>
* s3:client: Pass DEVICE_URI and AUTH_INFO_REQUIRED env to smbspoolAndreas Schneider2019-03-181-3/+21
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13832 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Bryan Mason <bmason@redhat.com> Signed-off-by: Guenther Deschner <gd@samba.org>
* s3:client: Use C99 initializer for poptOption in smbclientAndreas Schneider2019-01-281-15/+130
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* smbclient: Use dom_sid_str_bufVolker Lendecke2019-01-081-3/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* client: Add kerberos tracingSwen Schillig2018-12-191-1/+4
| | | | | | | | | | Replace kerberos context initialization from raw krb5_init_context() to smb_krb5_init_context_basic() which is adding common tracing as well. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* smbspool: Free kerberos context on errorSwen Schillig2018-11-221-0/+1
| | | | | | | | | If processing cannot continue and the function returns the kerberos context must be free'd. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:lib: Move popt_common_credentials to separate fileChristof Schmitt2018-09-071-1/+1
| | | | | | | | | | | This is only used by command line utilities and has additional dependencies. Move to a separate file to contain the dependencies to the command line tools. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:smbclient: Do not call cli_RNetShareEnum if SMB1 is disabledAndreas Schneider2018-09-051-1/+7
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbclient: Fix errors printed if we can connect with SMB1Andreas Schneider2018-09-051-1/+1
| | | | | | | | | | | | | | | | | | smbclient -L //server before: Reconnecting with SMB1 for workgroup listing. Connection to earth.milkyway.site failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND) Failed to connect with SMB1 -- no workgroup available after: Reconnecting with SMB1 for workgroup listing. Unable to connect with SMB1 -- no workgroup available Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:client: Avoid a possible fd leak in do_get()Andreas Schneider2018-08-111-0/+7
| | | | | | | | | | | Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13567 Pair-Programmed-With: Justin Stephenson <jstephen@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:client: Add --quiet option to smbclientJustin Stephenson2018-06-261-1/+8
| | | | | | | | | | | Add quiet command-line argument to allow suppressing the help log message printed automatically after establishing a smbclient connection BUG: https://bugzilla.samba.org/show_bug.cgi?id=13485 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Björn Baumbach <bb@sernet.de>
* build: Make --with-libarchive the defaultAndrew Bartlett2018-05-151-1/+1
| | | | | | | | | | | | This means that those not wanting to link to libarchive will just need to build --without-libarchive. In general, we prefer that optional libraries be required by default so that they are not accidentially missed, particularly in packages. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* Fix spelling s/retun/return/Mathieu Parent2018-05-121-1/+1
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s3:smbspool: Fix cmdline argument handlingAndreas Schneider2018-05-031-19/+42
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13417 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Thu May 3 16:33:54 CEST 2018 on sn-devel-144
* smbclient: Handle ENUM_DIR in "notify" commandVolker Lendecke2018-04-051-2/+7
| | | | | | | | 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): Thu Apr 5 04:05:52 CEST 2018 on sn-devel-144
* s3:client: Fix size typesAndreas Schneider2018-04-031-8/+15
| | | | | | | This fixes compilation with -Wstrict-overflow=2. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:client: Fix size typesAndreas Schneider2018-03-201-3/+3
| | | | | | | This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* util/rfc1738_unescape(): return end pointer or NULL on errorDouglas Bagnall2018-02-221-2/+6
| | | | | | | At present we don't detect errors, but when we do we'll return NULL. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbspool: Improve URI handling codeAndreas Schneider2018-02-201-11/+18
| | | | | | | | | | | | This also checks that the URI given via the environment variables starts with smb:// Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Feb 20 21:46:38 CET 2018 on sn-devel-144
* smbspool: Initialize empty_str on declarationAndreas Schneider2018-02-151-6/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3: client: Rename <oldname> to <link_target> in cmd_symlink() and ↵Jeremy Allison2017-11-301-7/+8
| | | | | | | | | | | | cli_posix_symlink(). Stops us from mixing up the old and new names. Only behavior change is correcting the names printed in the error messages. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13172 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbspool_krb5_wrapper: fix some error messagesUri Simchoni2017-11-221-3/+4
| | | | | | | | | | Make cups_smb_debug declaration printf-aware to avoid picky warning about printf with variable format string. This in turn revealed some formatting errors. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmbclient: Allow server (NetApp) to return STATUS_INVALID_PARAMETER from ↵Jeremy Allison2017-11-111-1/+7
| | | | | | | | | | | | | | an echo. It does this if we send a session ID of zero. The server still replied. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13007 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Nov 11 08:44:37 CET 2017 on sn-devel-144
* s3: smbclient: Ensure we call client_clean_name() before all operations on ↵Jeremy Allison2017-10-242-8/+227
| | | | | | | | | | | | | remote pathnames. This allows names containing .. components to be resolved on the client side before being sent to the server. Relative names work in SMB1 but not in SMB2. Fix both client.c and clitar.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=13093 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: client: Add new utility function client_clean_name().Jeremy Allison2017-10-242-0/+32
| | | | | | | | | | | | | Correctly canonicalizes a remote pathname removing '..' elements before sending to a remote server. '..' elements work in SMB1 pathnames, but not in SMB2. Not yet used. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13093 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:Add a utimes command to smbclient so we can set the Windows times.Richard Sharpe2017-10-191-0/+122
| | | | | | | Add an update to the smbclient man page. Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbclient: don't try any workgroup listing with "client min protocol = SMB2"Stefan Metzmacher2017-08-191-0/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12863 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbclient: improve the error messages for smbclient -LStefan Metzmacher2017-08-191-6/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12863 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* source3/client: Fix typo in help message displayed by defaultAnoop C S2017-08-071-1/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12936 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:client: Use KRB5CCNAME in smbspool_krb5_wrapper if setAndreas Schneider2017-07-251-0/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:client: Only use kerberos if credential cache exists in smbspoolAndreas Schneider2017-07-251-6/+58
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:client: Make it possible use smbspool in selftestAndreas Schneider2017-07-251-2/+7
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:client: Fix the usage of argv in smbspoolAndreas Schneider2017-07-251-19/+9
| | | | | | | | We use argv[0] to print the name of the binary, but have shifted it away. Do not do that. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>