Skip to content

Commit

Permalink
Check if Kerberos config exists and is readable
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick authored and kokosing committed Dec 2, 2021
1 parent 6ce2460 commit b56ace1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public LoginBasedSubjectProvider(
"Refusing to set system property 'java.security.krb5.conf' to '%s', it is already set to '%s'",
newValue,
currentValue);
checkState(
file.exists() && !file.isDirectory(),
"Kerberos config file '%s' does not exist or is a directory",
newValue);
checkState(file.canRead(), "Kerberos config file '%s' is not readable", newValue);
System.setProperty("java.security.krb5.conf", newValue);
});
}
Expand Down

0 comments on commit b56ace1

Please sign in to comment.