< prev index next >

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

Print this page
rev 59383 : [mq]: final


 910                     }
 911                     if (fileExists(path)) {
 912                         name = path;
 913                     }
 914                 }
 915                 if (name == null) {
 916                     path = getWindowsDirectory(true);
 917                     if (path != null) {
 918                         if (path.endsWith("\\")) {
 919                             path = path + "krb5.ini";
 920                         } else {
 921                             path = path + "\\krb5.ini";
 922                         }
 923                         name = path;
 924                     }
 925                 }
 926             }
 927             if (name == null) {
 928                 name = "c:\\winnt\\krb5.ini";
 929             }
 930         } else if (osname.startsWith("SunOS")) {
 931             name =  "/etc/krb5/krb5.conf";
 932         } else if (osname.contains("OS X")) {
 933             name = findMacosConfigFile();
 934         } else {
 935             name =  "/etc/krb5.conf";
 936         }
 937         if (DEBUG) {
 938             System.out.println("Native config name: " + name);
 939         }
 940         return name;
 941     }
 942 
 943     private String findMacosConfigFile() {
 944         String userHome = GetPropertyAction.privilegedGetProperty("user.home");
 945         final String PREF_FILE = "/Library/Preferences/edu.mit.Kerberos";
 946         String userPrefs = userHome + PREF_FILE;
 947 
 948         if (fileExists(userPrefs)) {
 949             return userPrefs;
 950         }
 951 




 910                     }
 911                     if (fileExists(path)) {
 912                         name = path;
 913                     }
 914                 }
 915                 if (name == null) {
 916                     path = getWindowsDirectory(true);
 917                     if (path != null) {
 918                         if (path.endsWith("\\")) {
 919                             path = path + "krb5.ini";
 920                         } else {
 921                             path = path + "\\krb5.ini";
 922                         }
 923                         name = path;
 924                     }
 925                 }
 926             }
 927             if (name == null) {
 928                 name = "c:\\winnt\\krb5.ini";
 929             }


 930         } else if (osname.contains("OS X")) {
 931             name = findMacosConfigFile();
 932         } else {
 933             name =  "/etc/krb5.conf";
 934         }
 935         if (DEBUG) {
 936             System.out.println("Native config name: " + name);
 937         }
 938         return name;
 939     }
 940 
 941     private String findMacosConfigFile() {
 942         String userHome = GetPropertyAction.privilegedGetProperty("user.home");
 943         final String PREF_FILE = "/Library/Preferences/edu.mit.Kerberos";
 944         String userPrefs = userHome + PREF_FILE;
 945 
 946         if (fileExists(userPrefs)) {
 947             return userPrefs;
 948         }
 949 


< prev index next >