opends/src/messages/messages/config.properties
@@ -20,7 +20,7 @@ # # CDDL HEADER END # # Portions Copyright 2006-2007 Sun Microsystems, Inc. # Portions Copyright 2006-2008 Sun Microsystems, Inc. @@ -1686,9 +1686,9 @@ SEVERE_ERR_CONFIG_BACKEND_MODE_INVALID_567=Configuration entry %s does not \ contain a valid value for configuration attribute ds-cfg-db-directory-permissions (It \ should be an UNIX permission mode in three-digit octal notation.) SEVERE_WARN_CONFIG_BACKEND_INSANE_MODE_568=Unable to set the requested file \ permissions to the backend database directory. The requested permissions will \ result in an inaccessible database SEVERE_ERR_CONFIG_BACKEND_INSANE_MODE_568=Invalid UNIX file permissions %s \ does not allow read and write access to the backend database directory by \ the backend INFO_CONFIG_CORE_DESCRIPTION_TIME_LIMIT_569=Default maximum \ length of time that should be allowed when processing a search operation. \ This may be overridden on a per-user basis by including the \ @@ -2130,10 +2130,14 @@ SEVERE_ERR_CONFIG_WORKFLOW_CANNOT_CONFIGURE_MANUAL_713=An error occurred \ while trying to configure in manual mode the workflows in the \ Directory Server, and rollback to automatic configuration mode has failed \ too. If the server is in an unstable state restart it with the last \ too. If the server is in an unstab\ le state restart it with the last \ valid configuration SEVERE_ERR_CONFIG_WORKFLOW_CANNOT_CONFIGURE_AUTO_714=An error occurred \ while trying to configure in automatic mode the workflows in the \ Directory Server, and rollback to manual configuration mode has failed \ too. If the server is in an unstable state restart it with the last \ valid configuration SEVERE_ERR_CONFIG_LOGGING_INSANE_MODE_715=Invalid UNIX file permissions %s \ does not allow write access to the log file by the log publisher SEVERE_ERR_CONFIG_LOGGING_MODE_INVALID_716=Invalid UNIX file permissions %s: %s opends/src/server/org/opends/server/backends/jeb/RootContainer.java
@@ -22,7 +22,7 @@ * CDDL HEADER END * * * Portions Copyright 2006-2007 Sun Microsystems, Inc. * Portions Copyright 2006-2008 Sun Microsystems, Inc. */ package org.opends.server.backends.jeb; import org.opends.messages.Message; @@ -56,7 +56,7 @@ import static org.opends.messages.ConfigMessages. ERR_CONFIG_BACKEND_MODE_INVALID; import static org.opends.messages.ConfigMessages. WARN_CONFIG_BACKEND_INSANE_MODE; ERR_CONFIG_BACKEND_INSANE_MODE; import static org.opends.server.util.StaticUtils.*; import static org.opends.messages.ConfigMessages.*; @@ -182,7 +182,8 @@ !backendPermission.isOwnerReadable() || !backendPermission.isOwnerExecutable()) { Message message = WARN_CONFIG_BACKEND_INSANE_MODE.get(); Message message = ERR_CONFIG_BACKEND_INSANE_MODE.get( config.getDBDirectoryPermissions()); throw new ConfigException(message); } @@ -759,7 +760,8 @@ !newBackendPermission.isOwnerReadable() || !newBackendPermission.isOwnerExecutable()) { Message message = WARN_CONFIG_BACKEND_INSANE_MODE.get(); Message message = ERR_CONFIG_BACKEND_INSANE_MODE.get( cfg.getDBDirectoryPermissions()); unacceptableReasons.add(message); acceptable = false; } @@ -932,7 +934,8 @@ !backendPermission.isOwnerReadable() || !backendPermission.isOwnerExecutable()) { messages.add(WARN_CONFIG_BACKEND_INSANE_MODE.get()); messages.add(ERR_CONFIG_BACKEND_INSANE_MODE.get( cfg.getDBDirectoryPermissions())); ccr = new ConfigChangeResult( DirectoryServer.getServerErrorResultCode(), adminActionRequired, opends/src/server/org/opends/server/loggers/TextAccessLogPublisher.java
@@ -22,7 +22,7 @@ * CDDL HEADER END * * * Portions Copyright 2006-2007 Sun Microsystems, Inc. * Portions Copyright 2006-2008 Sun Microsystems, Inc. */ package org.opends.server.loggers; import org.opends.messages.Message; @@ -34,6 +34,7 @@ import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.admin.std.server.FileBasedAccessLogPublisherCfg; import org.opends.server.admin.std.server.AccessLogPublisherCfg; import org.opends.server.api.*; import org.opends.server.config.ConfigException; import org.opends.server.core.AbandonOperation; @@ -96,6 +97,17 @@ /** * {@inheritDoc} */ public boolean isConfigurationAcceptable(AccessLogPublisherCfg configuration, List<Message> unacceptableReasons) { FileBasedAccessLogPublisherCfg config = (FileBasedAccessLogPublisherCfg) configuration; return isConfigurationChangeAcceptable(config, unacceptableReasons); } /** * {@inheritDoc} */ public void initializeAccessLogPublisher( FileBasedAccessLogPublisherCfg config) throws ConfigException, InitializationException @@ -184,30 +196,25 @@ // Make sure the permission is valid. try { if(!currentConfig.getLogFilePermissions().equalsIgnoreCase( config.getLogFilePermissions())) { FilePermission filePerm = FilePermission.decodeUNIXMode(config.getLogFilePermissions()); } if(!currentConfig.getLogFile().equalsIgnoreCase(config.getLogFile())) if(!filePerm.isOwnerWritable()) { File logFile = getFileForPath(config.getLogFile()); if(logFile.createNewFile()) Message message = ERR_CONFIG_LOGGING_INSANE_MODE.get( config.getLogFilePermissions()); unacceptableReasons.add(message); return false; } } catch(DirectoryException e) { logFile.delete(); } } } catch(Exception e) { Message message = ERR_CONFIG_LOGGING_CANNOT_CREATE_WRITER.get( config.dn().toString(), stackTraceToSingleLineString(e)); Message message = ERR_CONFIG_LOGGING_MODE_INVALID.get( config.getLogFilePermissions(), String.valueOf(e)); unacceptableReasons.add(message); return false; } return isConfigurationAcceptable(config, unacceptableReasons); return true; } /** opends/src/server/org/opends/server/loggers/TextAuditLogPublisher.java
@@ -22,7 +22,7 @@ * CDDL HEADER END * * * Portions Copyright 2006-2007 Sun Microsystems, Inc. * Portions Copyright 2006-2008 Sun Microsystems, Inc. */ package org.opends.server.loggers; import org.opends.messages.Message; @@ -33,6 +33,7 @@ import java.util.*; import org.opends.server.admin.std.server.FileBasedAccessLogPublisherCfg; import org.opends.server.admin.std.server.AccessLogPublisherCfg; import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.api.*; import org.opends.server.config.ConfigException; @@ -75,6 +76,16 @@ private FileBasedAccessLogPublisherCfg currentConfig; /** * {@inheritDoc} */ public boolean isConfigurationAcceptable(AccessLogPublisherCfg configuration, List<Message> unacceptableReasons) { FileBasedAccessLogPublisherCfg config = (FileBasedAccessLogPublisherCfg) configuration; return isConfigurationChangeAcceptable(config, unacceptableReasons); } /** * {@inheritDoc} @@ -168,25 +179,20 @@ // Make sure the permission is valid. try { if(!currentConfig.getLogFilePermissions().equalsIgnoreCase( config.getLogFilePermissions())) { FilePermission filePerm = FilePermission.decodeUNIXMode(config.getLogFilePermissions()); } if(!currentConfig.getLogFile().equalsIgnoreCase(config.getLogFile())) if(!filePerm.isOwnerWritable()) { File logFile = getFileForPath(config.getLogFile()); if(logFile.createNewFile()) Message message = ERR_CONFIG_LOGGING_INSANE_MODE.get( config.getLogFilePermissions()); unacceptableReasons.add(message); return false; } } catch(DirectoryException e) { logFile.delete(); } } } catch(Exception e) { Message message = ERR_CONFIG_LOGGING_CANNOT_CREATE_WRITER.get( config.dn().toString(), stackTraceToSingleLineString(e)); Message message = ERR_CONFIG_LOGGING_MODE_INVALID.get( config.getLogFilePermissions(), String.valueOf(e)); unacceptableReasons.add(message); return false; } opends/src/server/org/opends/server/loggers/TextErrorLogPublisher.java
@@ -22,7 +22,7 @@ * CDDL HEADER END * * * Portions Copyright 2006-2007 Sun Microsystems, Inc. * Portions Copyright 2006-2008 Sun Microsystems, Inc. */ package org.opends.server.loggers; import org.opends.messages.Message; @@ -273,6 +273,36 @@ FileBasedErrorLogPublisherCfg config = (FileBasedErrorLogPublisherCfg) configuration; return isConfigurationChangeAcceptable(config, unacceptableReasons); } /** * {@inheritDoc} */ public boolean isConfigurationChangeAcceptable( FileBasedErrorLogPublisherCfg config, List<Message> unacceptableReasons) { // Make sure the permission is valid. try { FilePermission filePerm = FilePermission.decodeUNIXMode(config.getLogFilePermissions()); if(!filePerm.isOwnerWritable()) { Message message = ERR_CONFIG_LOGGING_INSANE_MODE.get( config.getLogFilePermissions()); unacceptableReasons.add(message); return false; } } catch(DirectoryException e) { Message message = ERR_CONFIG_LOGGING_MODE_INVALID.get( config.getLogFilePermissions(), String.valueOf(e)); unacceptableReasons.add(message); return false; } for(String overrideSeverity : config.getOverrideSeverity()) { if(overrideSeverity != null) @@ -329,41 +359,6 @@ /** * {@inheritDoc} */ public boolean isConfigurationChangeAcceptable( FileBasedErrorLogPublisherCfg config, List<Message> unacceptableReasons) { // Make sure the permission is valid. try { if(!currentConfig.getLogFilePermissions().equalsIgnoreCase( config.getLogFilePermissions())) { FilePermission.decodeUNIXMode(config.getLogFilePermissions()); } if(!currentConfig.getLogFile().equalsIgnoreCase(config.getLogFile())) { File logFile = getFileForPath(config.getLogFile()); if(logFile.createNewFile()) { logFile.delete(); } } } catch(Exception e) { Message message = ERR_CONFIG_LOGGING_CANNOT_CREATE_WRITER.get( config.dn().toString(), stackTraceToSingleLineString(e)); unacceptableReasons.add(message); return false; } return isConfigurationAcceptable(config, unacceptableReasons); } /** * {@inheritDoc} */ public ConfigChangeResult applyConfigurationChange( FileBasedErrorLogPublisherCfg config) { opends/src/server/org/opends/server/loggers/debug/TextDebugLogPublisher.java
@@ -38,6 +38,7 @@ import static org.opends.server.util.ServerConstants.PROPERTY_DEBUG_TARGET; import org.opends.server.admin.std.server.DebugTargetCfg; import org.opends.server.admin.std.server.FileBasedDebugLogPublisherCfg; import org.opends.server.admin.std.server.DebugLogPublisherCfg; import org.opends.server.admin.std.meta.DebugLogPublisherCfgDefn; import org.opends.server.admin.server.ConfigurationChangeListener; import org.opends.server.admin.server.ConfigurationDeleteListener; @@ -48,6 +49,10 @@ ERR_CONFIG_LOGGING_CANNOT_CREATE_WRITER; import static org.opends.messages.ConfigMessages. ERR_CONFIG_LOGGING_CANNOT_OPEN_FILE; import static org.opends.messages.ConfigMessages. ERR_CONFIG_LOGGING_INSANE_MODE; import static org.opends.messages.ConfigMessages. ERR_CONFIG_LOGGING_MODE_INVALID; import java.util.*; @@ -120,6 +125,17 @@ /** * {@inheritDoc} */ public boolean isConfigurationAcceptable(DebugLogPublisherCfg configuration, List<Message> unacceptableReasons) { FileBasedDebugLogPublisherCfg config = (FileBasedDebugLogPublisherCfg) configuration; return isConfigurationChangeAcceptable(config, unacceptableReasons); } /** * {@inheritDoc} */ public void initializeDebugLogPublisher(FileBasedDebugLogPublisherCfg config) throws ConfigException, InitializationException { @@ -237,30 +253,25 @@ // Make sure the permission is valid. try { if(!currentConfig.getLogFilePermissions().equalsIgnoreCase( config.getLogFilePermissions())) { FilePermission filePerm = FilePermission.decodeUNIXMode(config.getLogFilePermissions()); } if(!currentConfig.getLogFile().equalsIgnoreCase(config.getLogFile())) if(!filePerm.isOwnerWritable()) { File logFile = getFileForPath(config.getLogFile()); if(logFile.createNewFile()) Message message = ERR_CONFIG_LOGGING_INSANE_MODE.get( config.getLogFilePermissions()); unacceptableReasons.add(message); return false; } } catch(DirectoryException e) { logFile.delete(); } } } catch(Exception e) { Message message = ERR_CONFIG_LOGGING_CANNOT_CREATE_WRITER.get( config.dn().toString(), stackTraceToSingleLineString(e)); Message message = ERR_CONFIG_LOGGING_MODE_INVALID.get( config.getLogFilePermissions(), String.valueOf(e)); unacceptableReasons.add(message); return false; } return isConfigurationAcceptable(config, unacceptableReasons); return true; } /**