Bug 288505 - net/samba416: recent change to GSSAPI_BUILTIN breaks openssl from ports (DEFAULT_VERSIONS=ssl=openssl)
Summary: net/samba416: recent change to GSSAPI_BUILTIN breaks openssl from ports (DEFA...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: FreeBSD Samba Team (mail alias)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-27 22:00 UTC by John Hein
Modified: 2026-03-21 09:54 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (samba)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2025-07-27 22:00:32 UTC
After ports d94c7d4d808807c1a2d41294a1725d5daa58bc47, now when building net/samba416 using openssl from ports, you get:

===>  samba416-4.16.11_9 You are using OpenSSL from ports and
have selected GSSAPI from base, please select another GSSAPI value.
*** Error code 1

Stop.
make: stopped in /usr/ports/net/samba416

This happens on FreeBSD 13 and 14 (and probably 15/current as well).

Was there some confusion between "BUILTIN" and "BASE" in that commit?
"GSSAPI_BUILTIN" is the option to use the bundled GSSAPI/kerberos implemenation.  So it seems like adding USES+=gssapi is not the right knob to direct the samba build to use the bundled implementation.

Maybe there should be a GSSAPI_BASE option instead (and add USES=gssapi:base if that option is on)?

See also
 ports afec98c003bd04bd047563e5f10f4c70a9a52cc8 (samba419)
 ports 512e446a85207552add46105a630bc3fc497a9e3 (samba420)

Those samba variants may also be affected by those similar commits.

See also bug 287597, comment 19.
Comment 1 John Hein 2025-07-27 22:01:40 UTC
CC'ing committer.  cy@, please see comment 0.
Comment 2 John Hein 2025-07-27 22:03:54 UTC
For now, I locally rolled back the USES+=gssapi for GSSAPI_BUILTIN - I want to use the bundled kerberos (which is the default) and openssl from ports.

Comments from committer or samba team?
Comment 3 Michael Osipov freebsd_committer freebsd_triage 2025-07-28 06:58:36 UTC
Does it work with samba419? I have put a lot of effort to make Samba 4.19 to work as good as 4.16.
Comment 4 John Hein 2025-07-28 12:52:50 UTC
(In reply to Michael Osipov from comment #3)
> Does it work with samba419?

Depends...

On FreeBSD 13 (sing DEFAULT_OPTIONS=ssl=openssl (ports openssl) with the [default] GSSAPI_BUILTIN on does not fail with the 'please select another GSSAPI value' error (see Mk/Uses/gssapi.mk for that error) for net/samba419.

This is because - in this case - USES for GSSAPI_BUILTIN does not add 'gssapi' (or gssapi:<anything>).  It has GSSAPI_BUILTIN_USES=bison.  That seems correct.

However, if you have a base OS version that has MIT kerberos (15/current systems built with WITH_MITKRB5), it fails with the same issue:

===>  samba419-4.19.9_10 You are using OpenSSL from ports and have selected
GSSAPI from base, please select another GSSAPI value.
*** Error code 1

This is because on systems that have /usr/libexec/krb5kdc, net/samba419 currently detects that and sets 'GSSAPI_BUILTIN_USES=bison gssapi'.

Same with net/samba420.  You can see this yourself if you have DEFAULT_VERSIONS=ssl=openssl (e.g., in /etc/make.conf) and you just invoke any make target, like: 'make -C net/samba419 check-sanity'.

As I mentioned in comment 0, it seems like these recent updates are conflating GSSAPI_BUILTIN (i.e., use the kerberos implementation bundled with the samba source) with [what should be] GSSAPI_BASE.  We don't want to try to signal the samba build to look in /usr OR /usr/local for kerberos when trying to  use the kerberos bundled with samba.

Maybe GSSAPI_BUILTIN should be named GSSAPI_BUNDLED to avoid confusion of the meaning of "builtin" - wherein "builtin" could be mistakenly construed as the "builtin" kerberos implemention included in the base OS.  Of course, that's not what "builtin" means in the case of the net/samba* GSSAPI_BUILTIN option.  As described by GSSAPI_BUILTIN_DESC, it means to use the bundled kerberos.

To me it seems that the recent change to add USES=gssapi and --with-system-*krb* to CONFIGURE_ARGS for GSSAPI_BUILTIN was just a mistake.  Maybe I am missing something.

If it was a mistake, I think what was intended was to have a GSSAPI_BASE option to allow [trying to] build with the kerberos implementation in the base OS.
Comment 5 Helge Oldach 2026-03-21 09:54:08 UTC
Following the SSL example, we probably want to cover:
- GSSAPI_BUNDLED = bundled Heimdal (current default)
- GSSAPI_BASE = base Kerberos (Heimdal until FreeBSD 14, MIT from FreeBSD 15 onwards)
- GSSAPI_HEIMDAL = Heimdal from security/heimdal port
- GSSAPI_MIT = MIT from security/krb5 port

This would be similar to how mail/fetchmail handles it (except it doesn't come with Heimdal bundled).

Personally, I would suggest to make GSSAPI_BASE the new default.

These variants are already handled by Uses/gssapi.mk, so we're talking samba OPTIONS only.