if(!cfg.getDBDirectoryPermissions().equalsIgnoreCase(
config.getDBDirectoryPermissions()) ||
!cfg.getDBDirectory().equals(this.config.getDBDirectory()))
{
FilePermission backendPermission;
try
{
backendPermission =
FilePermission.decodeUNIXMode(cfg.getDBDirectoryPermissions());
}
catch(Exception e)
{
messages.add(ERR_CONFIG_BACKEND_MODE_INVALID.get(
config.dn().toString()));
ccr = new ConfigChangeResult(
DirectoryServer.getServerErrorResultCode(),
adminActionRequired,
messages);
return ccr;
}
//Make sure the mode will allow the server itself access to
//the database
if(!backendPermission.isOwnerWritable() ||
!backendPermission.isOwnerReadable() ||
!backendPermission.isOwnerExecutable())
{
messages.add(ERR_CONFIG_BACKEND_INSANE_MODE.get(
cfg.getDBDirectoryPermissions()));
ccr = new ConfigChangeResult(
DirectoryServer.getServerErrorResultCode(),
adminActionRequired,
messages);
return ccr;
}
// Get the backend database backendDirectory permissions and apply
if(FilePermission.canSetPermissions())
{
File parentDirectory = getFileForPath(config.getDBDirectory());
File backendDirectory = new File(parentDirectory,
config.getBackendId());
try
{
if(!FilePermission.setPermissions(backendDirectory,
backendPermission))
{
Message message = WARN_JEB_UNABLE_SET_PERMISSIONS.get(
backendPermission.toString(), backendDirectory.toString());
logError(message);
}
}
catch(Exception e)
{