Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qualify required gssapi.h during samba 4.16.0 build #984

Closed
heitbaum opened this issue Mar 23, 2022 · 6 comments
Closed

qualify required gssapi.h during samba 4.16.0 build #984

heitbaum opened this issue Mar 23, 2022 · 6 comments

Comments

@heitbaum
Copy link
Contributor

Whilst this is a build bug with LibreELEC + samba - though I would raise the issue here too.

I am in the process of raising a samba bug for this too.

#include <gssapi.h>

During a cross compile we are having inconsistent builds of Samba 4.16.0 with the gssapi.h.

a) We separately build heimdal_asn1_compile and heimdal_compile_et and are using heimdal/heimdal:master without issue.

I have put together the following workaround to deal with the build failure. Not really sure the right way to have this fixed.
I have confirmed that the only gssapi.h files in the samba build are:

  • lib/replace/system/gssapi.h
  • third_party/heimdal/lib/gssapi/gssapi.h
  • third_party/heimdal/lib/gssapi/gssapi/gssapi.h

LibreELEC/LibreELEC.tv@810be4a

== Detail below ==

samba: qualify required gssapi.h
Inconsistent builds with samba 4.16 with the wrong gssapi.h being picked up. This is a workaround, and being raised upstream.

[1800/2511] Compiling source3/lib/smbd_shim.c
In file included from ../../third_party/heimdal/lib/gssapi/gssapi/gssapi_krb5.h:40,
                 from ../../lib/replace/system/gssapi.h:43,
                 from ../../lib/krb5_wrap/gss_samba.h:27,
                 from ../../auth/kerberos/pac_utils.h:27,
                 from ../../auth/kerberos/gssapi_pac.c:28:
../../third_party/heimdal/lib/gssapi/gssapi/gssapi_oid.h:9:8: error: unknown type name 'GSSAPI_LIB_VARIABLE'
    9 | extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_copy_ccache_x_oid_desc;
      |        ^~~~~~~~~~~~~~~~~~~

WORKAROUND PATCH

--- a/third_party/heimdal/lib/gssapi/gssapi/gssapi_krb5.h	2022-03-08 14:53:05.742089500 +0000
+++ b/third_party/heimdal/lib/gssapi/gssapi/gssapi_krb5.h	2022-03-08 14:53:05.742089500 +0000
@@ -36,7 +36,7 @@
 #ifndef GSSAPI_KRB5_H_
 #define GSSAPI_KRB5_H_
 
-#include <gssapi.h>
+#include <gssapi/gssapi/gssapi.h>
 #include <gssapi/gssapi_oid.h>
 
 GSSAPI_CPP_START
@jaltman
Copy link
Member

jaltman commented Mar 23, 2022

This patch is inappropriate for Heimdal for two reasons. First, Samba includes its own fork of Heimdal and that fork should be used when building Samba. Second, the proposed patch does not fix an issue in Heimdal but works around a deficiency in LibreELEC. gssapi.h is a public header that should not be included with a relative path.

@jaltman jaltman closed this as completed Mar 23, 2022
@heitbaum
Copy link
Contributor Author

This patch is inappropriate for Heimdal for two reasons. First, Samba includes its own fork of Heimdal and that fork should be used when building Samba. Second, the proposed patch does not fix an issue in Heimdal but works around a deficiency in LibreELEC. gssapi.h is a public header that should not be included with a relative path.

Hi @jaltman - I agree with your summation. Heimdal is building by itself correctly👍. The samba included Heimdal is being used for the samba build. The only reason for the separate build in LE is to allow the cross compile with the needed heimdal_asn1_compile and heimdal_compile_et. For whatever reason - I’m sure to come across the issue in why the samba build in LE is picking up the wrong gssapi.h. Issue raised was more as an fyi - and as a workaround until we can discover why the samba build is inconsistently building.

@jaltman
Copy link
Member

jaltman commented Mar 23, 2022

It is not safe to assume that the output from the asn1_compiler is stable across Heimdal versions. When building Samba the version shipped as part of Samba must be used.

@abartlet
Copy link
Member

abartlet commented Mar 23, 2022 via email

@heitbaum
Copy link
Contributor Author

Ticket raised at https://bugzilla.samba.org/show_bug.cgi?id=15033

@jaltman / @abartlet - firstly - apologies for creating the ticket as an FYI in Heimdal too, and potentially causing additional work - was not my intention. Was as an FYI as I had miss understood from the release notes that the Samba Heimdal was now closely tracking the GitHub.

I do agree - a LibreELEC + Samba build issue.

@jaltman - thanks for the insight on asn1. The LE build has been this way, and whilst now maintaining the package currency - only came across the compatibility issue when updating to 4.16 from 4.13. Looking at the change logs, and your pointer - I can only guess at why we didn’t use a host build of Samba’s Heimdal for these 2 binaries (something for the LE backlog 🙂)

@nicowilliams
Copy link
Contributor

I do try not to break the ABI nor API when I make changes to the ASN.1 compiler, but at some point I will have to, and you should assume the ABI for it breaks with every release.

(In particular the DER encode/decode functions really need to be able to take an optional alternative outer tag for best supporting IMPLICIT tagging. I could add more entry points, but why bloat things when I can break things? 🙂)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants