/** * Displays security warning messages if any possible secutiry issue is found. */ private void showSecurityWarnings() throws NamingException { // Warn if the default password is not changed. boolean needToChangeAdminPassword = false; LdapDN adminDn = new LdapDN( PartitionNexus.ADMIN_PRINCIPAL ); adminDn.normalize( configuration.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping() ); Attributes adminEntry = partitionNexus.lookup( adminDn ); Object userPassword = adminEntry.get( "userPassword" ).get(); if ( userPassword instanceof byte[] ) { needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( new String( ( byte[] ) userPassword ) ); } else if ( userPassword.toString().equals( PartitionNexus.ADMIN_PASSWORD ) ) { needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( userPassword.toString() ); } if ( needToChangeAdminPassword ) { log.warn( "You didn't change the admin password of directory service " + "instance '" + instanceId + "'. " + "Please update the admin password as soon as possible " + "to prevent a possible security breach." ); } }