jdk/src/share/classes/sun/security/pkcs11/Secmod.java
changeset 13565 6298d600104f
parent 12813 c10ab96dcf41
child 16734 da1901d79073
equal deleted inserted replaced
13564:3571e232ab03 13565:6298d600104f
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2012, 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
   403                 if (fips) {
   403                 if (fips) {
   404                     throw new RuntimeException("FIPS flag set for non-internal "
   404                     throw new RuntimeException("FIPS flag set for non-internal "
   405                         + "module: " + libraryName + ", " + commonName);
   405                         + "module: " + libraryName + ", " + commonName);
   406                 }
   406                 }
   407             }
   407             }
   408             this.libraryName = (new File(libraryDir, libraryName)).getPath();
   408             // On Ubuntu the libsoftokn3 library is located in a subdirectory
       
   409             // of the system libraries directory. (Since Ubuntu 11.04.)
       
   410             File libraryFile = new File(libraryDir, libraryName);
       
   411             if (!libraryFile.isFile()) {
       
   412                File failover = new File(libraryDir, "nss/" + libraryName);
       
   413                if (failover.isFile()) {
       
   414                    libraryFile = failover;
       
   415                }
       
   416             }
       
   417             this.libraryName = libraryFile.getPath();
   409             this.commonName = commonName;
   418             this.commonName = commonName;
   410             this.slot = slot;
   419             this.slot = slot;
   411             this.type = type;
   420             this.type = type;
   412             initConfiguration();
   421             initConfiguration();
   413         }
   422         }