[Fedora-directory-commits] ldapserver/ldap/servers/slapd configdse.c, 1.7, 1.8 libglobs.c, 1.19, 1.20

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Mon Sep 17 22:48:13 UTC 2007


Author: nkinder

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17638

Modified Files:
	configdse.c libglobs.c 
Log Message:
Resolves: 293541
Summary: Allow server to start if descriptor related attributes are set too high.



Index: configdse.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/configdse.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- configdse.c	27 Feb 2007 02:57:29 -0000	1.7
+++ configdse.c	17 Sep 2007 22:48:10 -0000	1.8
@@ -294,9 +294,25 @@
 		if (attr_name)
 		{
 			retval = config_set(attr_name, values, returntext, 1 /* force apply */);
-			if ((retval != LDAP_SUCCESS) &&
-				slapi_attr_flag_is_set(attr, SLAPI_ATTR_FLAG_OPATTR))
-				retval = LDAP_SUCCESS; /* ignore attempts to modify operational attrs */
+			if ((strcasecmp(attr_name, CONFIG_MAXDESCRIPTORS_ATTRIBUTE) == 0) ||
+				(strcasecmp(attr_name, CONFIG_RESERVEDESCRIPTORS_ATTRIBUTE) == 0) ||
+				(strcasecmp(attr_name, CONFIG_CONNTABLESIZE_ATTRIBUTE) == 0)) {
+				/* We should not treat an LDAP_UNWILLING_TO_PERFORM as fatal for
+				 * the these config attributes.  This error is returned when
+				 * the value we are trying to set is higher than the current
+				 * process limit.  The set function will auto-adjust the runtime
+				 * value to the current process limit when this happens.  We want
+				 * to allow the server to still start in this case. */
+				if (retval == LDAP_UNWILLING_TO_PERFORM) {
+					slapi_log_error (SLAPI_LOG_FATAL, NULL, "Config Warning: - %s\n", returntext);
+					retval = LDAP_SUCCESS;
+				}
+			} else {
+				if ((retval != LDAP_SUCCESS) &&
+					slapi_attr_flag_is_set(attr, SLAPI_ATTR_FLAG_OPATTR)) {
+					retval = LDAP_SUCCESS; /* ignore attempts to modify operational attrs */
+				}
+			}
 		}
 
 		if (values)


Index: libglobs.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/libglobs.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- libglobs.c	17 Aug 2007 02:12:37 -0000	1.19
+++ libglobs.c	17 Sep 2007 22:48:10 -0000	1.20
@@ -552,27 +552,27 @@
 	/* parameterizing lock dir */
 	{CONFIG_LOCKDIR_ATTRIBUTE, config_set_lockdir,
 		NULL, 0,
-		(void**)&global_slapdFrontendConfig.lockdir, CONFIG_STRING, config_get_lockdir},
+		(void**)&global_slapdFrontendConfig.lockdir, CONFIG_STRING, (ConfigGetFunc)config_get_lockdir},
 	/* parameterizing tmp dir */
 	{CONFIG_TMPDIR_ATTRIBUTE, config_set_tmpdir,
 		NULL, 0,
-		(void**)&global_slapdFrontendConfig.tmpdir, CONFIG_STRING, config_get_tmpdir},
+		(void**)&global_slapdFrontendConfig.tmpdir, CONFIG_STRING, (ConfigGetFunc)config_get_tmpdir},
 	/* parameterizing cert dir */
 	{CONFIG_CERTDIR_ATTRIBUTE, config_set_certdir,
 		NULL, 0,
-		(void**)&global_slapdFrontendConfig.certdir, CONFIG_STRING, config_get_certdir},
+		(void**)&global_slapdFrontendConfig.certdir, CONFIG_STRING, (ConfigGetFunc)config_get_certdir},
 	/* parameterizing ldif dir */
 	{CONFIG_LDIFDIR_ATTRIBUTE, config_set_ldifdir,
 		NULL, 0,
-		(void**)&global_slapdFrontendConfig.ldifdir, CONFIG_STRING, config_get_ldifdir},
+		(void**)&global_slapdFrontendConfig.ldifdir, CONFIG_STRING, (ConfigGetFunc)config_get_ldifdir},
 	/* parameterizing bak dir */
 	{CONFIG_BAKDIR_ATTRIBUTE, config_set_bakdir,
 		NULL, 0,
-		(void**)&global_slapdFrontendConfig.bakdir, CONFIG_STRING, config_get_bakdir},
+		(void**)&global_slapdFrontendConfig.bakdir, CONFIG_STRING, (ConfigGetFunc)config_get_bakdir},
 	/* parameterizing sasl plugin path */
 	{CONFIG_SASLPATH_ATTRIBUTE, config_set_saslpath,
 		NULL, 0,
-		(void**)&global_slapdFrontendConfig.saslpath, CONFIG_STRING, config_get_saslpath},
+		(void**)&global_slapdFrontendConfig.saslpath, CONFIG_STRING, (ConfigGetFunc)config_get_saslpath},
 	{CONFIG_REWRITE_RFC1274_ATTRIBUTE, config_set_rewrite_rfc1274,
 		NULL, 0,
 		(void**)&global_slapdFrontendConfig.rewrite_rfc1274, CONFIG_ON_OFF, NULL},
@@ -2655,8 +2655,9 @@
   nValue = strtol(value, &endp, 10);
 
   if ( *endp != '\0' || errno == ERANGE || nValue < 1 || nValue > maxVal ) {
-	PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", maximum file descriptors must range from 1 to %d (the current process limit)",
-			attrname, value, maxVal );
+	PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", maximum "
+			"file descriptors must range from 1 to %d (the current process limit).  "
+			"Server will use a setting of %d.", attrname, value, maxVal, maxVal);
         if ( nValue > maxVal ) {
             nValue = maxVal;
             retVal = LDAP_UNWILLING_TO_PERFORM;
@@ -2707,8 +2708,9 @@
 #elif !defined(AIX)
 
   if ( *endp != '\0' || errno == ERANGE || nValue < 1 || nValue > maxVal ) {
-	PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", connection table size must range from 1 to %d"
-                      " (the current process maxdescriptors limit)", attrname, value, maxVal );
+	PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", connection table "
+			"size must range from 1 to %d (the current process maxdescriptors limit).  "
+			"Server will use a setting of %d.", attrname, value, maxVal );
         if ( nValue > maxVal) {
             nValue = maxVal;
             retVal = LDAP_UNWILLING_TO_PERFORM;
@@ -2753,8 +2755,9 @@
   nValue = strtol(value, &endp, 10);
   
   if ( *endp != '\0' || errno == ERANGE || nValue < 1 || nValue > maxVal ) {
-	PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", reserved file descriptors must range from 1 to %d"
-                      " (the current process maxdescriptors limit)", attrname, value, maxVal );
+	PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", reserved file "
+			"descriptors must range from 1 to %d (the current process maxdescriptors limit).  "
+			"Server will use a setting of %d.", attrname, value, maxVal, maxVal );
         if ( nValue > maxVal) {
             nValue = maxVal;
             retVal = LDAP_UNWILLING_TO_PERFORM;




More information about the Fedora-directory-commits mailing list