Author: rareddy
Date: 2012-05-30 11:39:59 -0400 (Wed, 30 May 2012)
New Revision: 4151
Modified:
trunk/client/src/main/java/org/teiid/gss/MakeGSS.java
trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
Log:
TEIID-2013: Allow using the "java.security.krb5.conf" property for kerberoes
configuration.
Modified: trunk/client/src/main/java/org/teiid/gss/MakeGSS.java
===================================================================
--- trunk/client/src/main/java/org/teiid/gss/MakeGSS.java 2012-05-30 14:41:59 UTC (rev
4150)
+++ trunk/client/src/main/java/org/teiid/gss/MakeGSS.java 2012-05-30 15:39:59 UTC (rev
4151)
@@ -81,18 +81,31 @@
errors.append(nl);
}
+ String krb5 = System.getProperty("java.security.krb5.conf");
//$NON-NLS-1$
String realm = System.getProperty("java.security.krb5.realm");
//$NON-NLS-1$
- if (realm == null) {
- errors.append(JDBCPlugin.Util.getString("system_prop_missing",
"java.security.krb5.realm")); //$NON-NLS-1$ //$NON-NLS-2$
+ String kdc = System.getProperty("java.security.krb5.kdc");
//$NON-NLS-1$
+
+
+ if (krb5 == null && realm == null && kdc == null) {
+ errors.append(JDBCPlugin.Util.getString("no_gss_selection"));
//$NON-NLS-1$
errors.append(nl);
}
+ else if (krb5 != null && (realm != null || kdc != null)) {
+ errors.append(JDBCPlugin.Util.getString("ambigious_gss_selection"));
//$NON-NLS-1$
+ errors.append(nl);
+ }
+ else if ((realm != null && kdc == null) || (realm == null && kdc
!= null)) {
+ // krb5 is null here..
+ if (realm == null) {
+ errors.append(JDBCPlugin.Util.getString("system_prop_missing",
"java.security.krb5.realm")); //$NON-NLS-1$ //$NON-NLS-2$
+ errors.append(nl);
+ }
+ if (kdc == null) {
+ errors.append(JDBCPlugin.Util.getString("system_prop_missing",
"java.security.krb5.kdc")); //$NON-NLS-1$ //$NON-NLS-2$
+ errors.append(nl);
+ }
+ }
- String kdc = System.getProperty("java.security.krb5.kdc");
//$NON-NLS-1$
- if (kdc == null) {
- errors.append(JDBCPlugin.Util.getString("system_prop_missing",
"java.security.krb5.kdc")); //$NON-NLS-1$ //$NON-NLS-2$
- errors.append(nl);
- }
-
String config = System.getProperty("java.security.auth.login.config");
//$NON-NLS-1$
if (config == null) {
errors.append(JDBCPlugin.Util.getString("system_prop_missing",
"java.security.auth.login.config")); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
===================================================================
--- trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties 2012-05-30 14:41:59 UTC
(rev 4150)
+++ trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties 2012-05-30 15:39:59 UTC
(rev 4151)
@@ -172,4 +172,6 @@
TEIID20023=connection closed
TEIID20007=Duplicate Class
TEIID20028=data length too big: {0} > max of {1}. You may need to adjust the
maxObjectSize client setting.
-unexpected_element=Unexpected Element {0} encountered, expecting one of {1}
\ No newline at end of file
+unexpected_element=Unexpected Element {0} encountered, expecting one of {1}
+ambigious_gss_selection=Either configure "java.security.krb5.conf" property or
combination of "java.security.krb5.realm" and "java.security.krb5.kdc"
properties. Not both.
+no_gss_selection=No KRB5 configuration found. Either configure
"java.security.krb5.conf" property or combination of
"java.security.krb5.realm" and "java.security.krb5.kdc" properties.
\ No newline at end of file
Show replies by date