浏览代码

Resolves:479065
Summary: Only check permissions on nsslapd-rundir in normal execution mode.

Nathan Kinder 17 年之前
父节点
当前提交
4165ae9df0
共有 1 个文件被更改,包括 12 次插入11 次删除
  1. 12 11
      ldap/servers/slapd/main.c

+ 12 - 11
ldap/servers/slapd/main.c

@@ -976,17 +976,18 @@ main( int argc, char **argv)
 	case SLAPD_EXEMODE_PRINTVERSION:
 		slapd_print_version(1);
 		exit(1);
-	}
-
-	/* Ensure that we can read from and write to our rundir */
-	if (access(config_get_rundir(), R_OK | W_OK)) {
-		LDAPDebug(LDAP_DEBUG_ANY, "Unable to access nsslapd-rundir: %s\n",
-			slapd_system_strerror(errno), 0, 0);
-		LDAPDebug(LDAP_DEBUG_ANY, "Ensure that user \"%s\" has read and write "
-			"permissions on %s\n",
-			slapdFrontendConfig->localuser, config_get_rundir(), 0);
-		LDAPDebug(LDAP_DEBUG_ANY, "Shutting down.\n", 0, 0, 0);
-		exit(1);
+	default:
+		/* Ensure that we can read from and write to our rundir */
+		if (access(config_get_rundir(), R_OK | W_OK)) {
+			LDAPDebug(LDAP_DEBUG_ANY, "Unable to access nsslapd-rundir: %s\n",
+				slapd_system_strerror(errno), 0, 0);
+			LDAPDebug(LDAP_DEBUG_ANY, "Ensure that user \"%s\" has read and write "
+				"permissions on %s\n",
+				slapdFrontendConfig->localuser, config_get_rundir(), 0);
+			LDAPDebug(LDAP_DEBUG_ANY, "Shutting down.\n", 0, 0, 0);
+			exit(1);
+		}
+		break;
 	}
 
 	/*