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

19 Commits

Author SHA1 Message Date
Stefan Metzmacher
4514fb5f43 smbspool_krb5_wrapper: let kerberos_get_default_ccache() use smb_force_krb5_cc_default_name()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-05-14 10:18:32 +00:00
Stefan Metzmacher
a8da9de9f4 smbspool_krb5_wrapper: remove unused includes
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2024-05-14 10:18:32 +00:00
Joseph Sutton
3179fc2a70 s3:client: Correctly call setgroups() (CID 1449449)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13 02:18:31 +00:00
Jeremy Allison
1d3e118f6f s3: smbspool. Remove last use of 'extern char **environ;'.
This should come from lib/replace/replace.h to cope with
system (MacOSX etc.) differences.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Oct 14 19:51:59 UTC 2021 on sn-devel-184
2021-10-14 19:51:59 +00:00
Andreas Schneider
67f455c3d5 s3:smbspool: Leave early if we print as root
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Dec  9 14:18:11 UTC 2019 on sn-devel-184
2019-12-09 14:18:11 +00:00
Mikhail Novosyolov
58a90358e2 s3:smbspool_krb5_wrapper: ignore unknown values of AUTH_INFO_REQUIRED
To make smbspool_krb5_wrapper usable as a default destination for symlink
/usr/lib/cups/backend/smb in Linux ditros, it has to be well-prepared
for any possible values of AUTH_INFO_REQUIRED set by cupsd and correctly
pass printing tasks to smbspool if it sees that Kerberos authentication
is not needed.

Discussed here: https://lists.samba.org/archive/samba-technical/2019-October/134470.html

Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2019-12-09 12:48:45 +00:00
Andreas Schneider
6201b30421 s3:smbspool_krb5_wrapper: Map AUTH_INFO_REQUIRED=none to anonymous
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2019-12-09 12:48:45 +00:00
Andreas Schneider
6bbdf69e40 s3:smbspool: Fallback to default ccache if KRB5CCNAME is not set
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>
2019-05-23 09:41:17 +00:00
Andreas Schneider
be596ce3d2 s3:smbspool: Use %u format specifier to print uid
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>
2019-05-23 09:41:17 +00:00
Andreas Schneider
3632bfef25 s3:smbspool: Add debug for finding KRB5CCNAME
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>
2019-05-23 09:41:17 +00:00
Andreas Schneider
6086efb680 s3:smbspool: Add the 'lp' group to the users groups
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>
2019-05-23 09:41:17 +00:00
Andreas Schneider
43160184d2 s3:client: Pass DEVICE_URI and AUTH_INFO_REQUIRED env to smbspool
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>
2019-03-18 15:30:13 +00:00
Uri Simchoni
8efe057a87 smbspool_krb5_wrapper: fix some error messages
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>
2017-11-22 10:20:21 +01:00
Andreas Schneider
dc15954196 s3:client: Use KRB5CCNAME in smbspool_krb5_wrapper if set
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-07-25 09:14:19 +02:00
Andreas Schneider
4cced4da4c s3:client: The smbspool krb5 wrapper needs negotiate for authentication
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-15 06:43:47 +02:00
Bryan Mason
adbdce78ec Modify smbspool_krb5_wrapper to just fall through to smbspool if 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-02-17 04:27:26 +01: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
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