mono icon indicating copy to clipboard operation
mono copied to clipboard

Support for Heimdal

Open Arfrever opened this issue 4 years ago • 5 comments
trafficstars

external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.c (https://github.com/mono/corefx/blob/main/src/Native/Unix/System.Net.Security.Native/pal_gssapi.c) seems to already support Heimdal (one of implementations of Kerberos):

#if HAVE_GSSFW_HEADERS
#include <GSS/GSS.h>
#else
#if HAVE_HEIMDAL_HEADERS
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_krb5.h>
#else
#include <gssapi/gssapi_ext.h>
#include <gssapi/gssapi_krb5.h>
#endif
#endif

However configure.ac of Mono fails to detect headers of Heimdal. It only searches for headers of MIT Kerberos V:

checking for GSS/GSS.h... no
checking for gssapi/gssapi_ext.h... no
checking for GSS_SPNEGO_MECHANISM... no
...
checking Mono.Native support... configure: WARNING: GSS is not enabled, it requires libkrb5-dev package
Linux
...

Arfrever avatar Mar 31 '21 16:03 Arfrever

~~Patch: mono-6.12.0.122-heimdal.patch.txt~~

Improved patch: mono-6.12.0.122-gss.patch.txt (Improved patch adds support for --enable-gss / --disable-gss option.)

Arfrever avatar Mar 31 '21 18:03 Arfrever

You should send a pull request so that it can be reviewed and merged.

lextm avatar Apr 01 '21 00:04 lextm

It fails to detect even kerberos and gss.

barracuda156 avatar May 07 '23 04:05 barracuda156

@Arfrever Does not work for me with gss enabled even with your patch. Kerberos and GSS installed, neither is picked up.

  CC       ../../external/corefx/src/Native/Unix/System.Net.Security.Native/libmono_native_la-pal_gssapi.lo
In file included from ../../external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.c:7:
../../external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.h:47: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
   47 | #pragma clang diagnostic push
      | 
../../external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.h:48: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
   48 | #pragma clang diagnostic ignored "-Wpadded"
      | 
../../external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.h:54: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
   54 | #pragma clang diagnostic pop
      | 
cc1: note: unrecognized command-line option '-Wno-typedef-redefinition' may have been intended to silence earlier diagnostics
  CCLD     libmono-native.la
ld: framework not found GSS
collect2: error: ld returned 1 exit status

barracuda156 avatar May 07 '23 06:05 barracuda156

Ah, macOS build has been broken by https://github.com/mono/mono/issues/14793

@Arfrever We should use kerberos5 or heimdal on macOS < 10.14.

barracuda156 avatar Jun 30 '24 12:06 barracuda156