-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8349546: Linux support for Kerberos "nativeccache" functionality #28075
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
Open
nrhall
wants to merge
17
commits into
openjdk:master
Choose a base branch
from
nrhall:nrhall-add-support-for-linux-krb5-native
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+754
−16
Open
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c0204db
Add support for native Kerberos credential acquisition on Linux
nrhall 2e6cd02
Fix permissions on build.sh
nrhall 307c3f2
Tidy up comments/docs
nrhall 5106d31
eliminate build.sh in favour of jtreg primitives
nrhall 33407d4
more comment fixes
nrhall 1a28cee
Add specific MacOS jtreg compiler flags to fix deprecation warnings
nrhall 5cad1e4
Add missing .h file to PR
nrhall bc904b0
Fixes to ensure that the jtreg test is not built or executed if krb5 …
nrhall 3ea9793
Attend to @erikj79's code review comments
nrhall d58d417
Minor variable/function name and comment clean-ups
nrhall 47968fe
Minor doc/comment clean-ups
nrhall 8c8288a
Address second set of @erikj79's build comments
nrhall f4a8543
Attend to @smemery's code review comments
nrhall 98417c3
Attend to remaining comments from @smemery
nrhall 3690702
Attend to @wangweij's code review comments - in particular a large cl…
nrhall d7ea6c9
Small doc fix
nrhall ed56092
Clean up jtreg run/compile directives, attend to other review comments
nrhall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # | ||
| # Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. | ||
| # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| # | ||
| # This code is free software; you can redistribute it and/or modify it | ||
| # under the terms of the GNU General Public License version 2 only, as | ||
| # published by the Free Software Foundation. Oracle designates this | ||
| # particular file as subject to the "Classpath" exception as provided | ||
| # by Oracle in the LICENSE file that accompanied this code. | ||
| # | ||
| # This code is distributed in the hope that it will be useful, but WITHOUT | ||
| # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| # version 2 for more details (a copy is included in the LICENSE file that | ||
| # accompanied this code). | ||
| # | ||
| # You should have received a copy of the GNU General Public License version | ||
| # 2 along with this work; if not, write to the Free Software Foundation, | ||
| # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| # | ||
| # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| # or visit www.oracle.com if you need additional information or have any | ||
| # questions. | ||
| # | ||
|
|
||
| ################################################################################ | ||
| # Setup krb5 (Kerberos 5) | ||
| ################################################################################ | ||
| AC_DEFUN_ONCE([LIB_SETUP_KRB5], | ||
| [ | ||
| AC_ARG_WITH(krb5, [AS_HELP_STRING([--with-krb5], | ||
| [enable krb5 support (default=yes), or "no" to disable])]) | ||
| # Determine if krb5 should be disabled | ||
| KRB5_DISABLED=no | ||
| if test "x${with_krb5}" = xno; then | ||
| AC_MSG_NOTICE([krb5 explicitly disabled]) | ||
| KRB5_DISABLED=yes | ||
| elif test "x$NEEDS_LIB_KRB5" = xfalse; then | ||
nrhall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if test "x${with_krb5}" != x && test "x${with_krb5}" != xno; then | ||
| AC_MSG_WARN([[krb5 not used, so --with-krb5 is ignored]]) | ||
| fi | ||
| KRB5_DISABLED=yes | ||
| fi | ||
| if test "x$KRB5_DISABLED" = xyes; then | ||
| KRB5_CFLAGS= | ||
| KRB5_LIBS= | ||
| ENABLE_LIBLINUXKRB5=false | ||
| else | ||
| # First try pkg-config (most modern approach) | ||
| AC_PATH_TOOL([PKG_CONFIG], [pkg-config], [no]) | ||
nrhall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| use_pkgconfig_for_krb5=no | ||
| if test "x$PKG_CONFIG" != "xno"; then | ||
nrhall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| AC_MSG_CHECKING([if pkg-config knows about krb5]) | ||
| if $PKG_CONFIG --exists krb5; then | ||
| AC_MSG_RESULT([yes]) | ||
| use_pkgconfig_for_krb5=yes | ||
| else | ||
| AC_MSG_RESULT([no]) | ||
| fi | ||
| fi | ||
| if test "x$use_pkgconfig_for_krb5" = "xyes"; then | ||
| # Use pkg-config to get compiler and linker flags | ||
| AC_MSG_CHECKING([for krb5 cflags via pkg-config]) | ||
| KRB5_CFLAGS="`$PKG_CONFIG --cflags krb5`" | ||
| AC_MSG_RESULT([$KRB5_CFLAGS]) | ||
| AC_MSG_CHECKING([for krb5 libs via pkg-config]) | ||
| KRB5_LIBS="`$PKG_CONFIG --libs krb5`" | ||
| AC_MSG_RESULT([$KRB5_LIBS]) | ||
| ENABLE_LIBLINUXKRB5=true | ||
| else | ||
| # Fallback: try krb5-config | ||
| AC_PATH_TOOL([KRB5CONF], [krb5-config], [no]) | ||
nrhall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if test "x$KRB5CONF" != "xno"; then | ||
| # Use krb5-config to get compiler and linker flags | ||
| AC_MSG_CHECKING([for krb5 cflags via krb5-config]) | ||
| KRB5_CFLAGS="`$KRB5CONF --cflags`" | ||
| AC_MSG_RESULT([$KRB5_CFLAGS]) | ||
| AC_MSG_CHECKING([for krb5 libs via krb5-config]) | ||
| KRB5_LIBS="`$KRB5CONF --libs`" | ||
| AC_MSG_RESULT([$KRB5_LIBS]) | ||
| ENABLE_LIBLINUXKRB5=true | ||
| else | ||
| # Final fallback: try manual detection in system locations | ||
| AC_CHECK_HEADERS([krb5.h], [ | ||
| AC_CHECK_LIB([krb5], [krb5_init_context], [ | ||
| KRB5_CFLAGS="" | ||
| KRB5_LIBS="-lkrb5" | ||
| # Check for com_err header and library which are often required | ||
| AC_CHECK_HEADERS([com_err.h], [ | ||
| AC_CHECK_LIB([com_err], [com_err], [ | ||
| KRB5_LIBS="$KRB5_LIBS -lcom_err" | ||
| ]) | ||
| ]) | ||
| ENABLE_LIBLINUXKRB5=true | ||
| ], [ENABLE_LIBLINUXKRB5=false]) | ||
| ], [ENABLE_LIBLINUXKRB5=false]) | ||
| fi | ||
| fi | ||
| fi | ||
| AC_SUBST(KRB5_CFLAGS) | ||
| AC_SUBST(KRB5_LIBS) | ||
| AC_SUBST(ENABLE_LIBLINUXKRB5) | ||
| ]) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.