Skip to content

Commit 59b8d59

Browse files
committedFeb 12, 2021
8261481: Cannot read Kerberos settings in dynamic store on macOS Big Sur
Reviewed-by: mullan
1 parent 9f81ca8 commit 59b8d59

File tree

1 file changed

+5
-6
lines changed
  • src/java.security.jgss/share/classes/sun/security/krb5

1 file changed

+5
-6
lines changed
 

‎src/java.security.jgss/share/classes/sun/security/krb5/Config.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,16 @@ private static boolean isMacosLionOrBetter() {
167167

168168
String osVersion = GetPropertyAction.privilegedGetProperty("os.version");
169169
String[] fragments = osVersion.split("\\.");
170-
171-
// sanity check the "10." part of the version
172-
if (!fragments[0].equals("10")) return false;
173170
if (fragments.length < 2) return false;
174171

175-
// check if Mac OS X 10.7(.y)
172+
// check if Mac OS X 10.7(.y) or higher
176173
try {
174+
int majorVers = Integer.parseInt(fragments[0]);
177175
int minorVers = Integer.parseInt(fragments[1]);
178-
if (minorVers >= 7) return true;
176+
if (majorVers > 10) return true;
177+
if (majorVers == 10 && minorVers >= 7) return true;
179178
} catch (NumberFormatException e) {
180-
// was not an integer
179+
// were not integers
181180
}
182181

183182
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.