src/java.security.jgss/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
changeset 51398 3c389a284345
parent 47216 71c04702a3d5
equal deleted inserted replaced
51397:c9150700bbd0 51398:3c389a284345
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    29  *  Copyright 1997 The Open Group Research Institute.  All rights reserved.
    29  *  Copyright 1997 The Open Group Research Institute.  All rights reserved.
    30  */
    30  */
    31 
    31 
    32 package sun.security.krb5.internal.ktab;
    32 package sun.security.krb5.internal.ktab;
    33 
    33 
       
    34 import sun.security.action.GetPropertyAction;
    34 import sun.security.krb5.*;
    35 import sun.security.krb5.*;
    35 import sun.security.krb5.internal.*;
    36 import sun.security.krb5.internal.*;
    36 import sun.security.krb5.internal.crypto.*;
    37 import sun.security.krb5.internal.crypto.*;
    37 import java.util.ArrayList;
    38 import java.util.ArrayList;
    38 import java.util.Arrays;
    39 import java.util.Arrays;
   201             } catch (KrbException e) {
   202             } catch (KrbException e) {
   202                 kname = null;
   203                 kname = null;
   203             }
   204             }
   204 
   205 
   205             if (kname == null) {
   206             if (kname == null) {
   206                 String user_home =
   207                 String user_home = GetPropertyAction
   207                         java.security.AccessController.doPrivileged(
   208                         .privilegedGetProperty("user.home");
   208                         new sun.security.action.GetPropertyAction("user.home"));
       
   209 
   209 
   210                 if (user_home == null) {
   210                 if (user_home == null) {
   211                     user_home =
   211                     user_home = GetPropertyAction
   212                         java.security.AccessController.doPrivileged(
   212                             .privilegedGetProperty("user.dir");
   213                         new sun.security.action.GetPropertyAction("user.dir"));
       
   214                 }
   213                 }
   215 
   214 
   216                 kname = user_home + File.separator  + "krb5.keytab";
   215                 kname = user_home + File.separator  + "krb5.keytab";
   217             }
   216             }
   218             defaultTabName = kname;
   217             defaultTabName = kname;