ソースを参照

Resolves: bug 232910
Description: ACI targetattr list parser is whitespace sensitive
Fix Description: In addition to the previous fixes, test for quote at end of string before incrementing s - otherwise test will always fail.

Rich Megginson 18 年 前
コミット
b695fa9ed8
1 ファイル変更9 行追加9 行削除
  1. 9 9
      ldap/servers/plugins/acl/aclparse.c

+ 9 - 9
ldap/servers/plugins/acl/aclparse.c

@@ -1239,16 +1239,16 @@ __aclp__init_targetattr (aci_t *aci, char *attr_val)
        if it begins with a quote, it must end with one as well
     */
 	if (*s == '"') {
+		if (s[len-1] == '"') {
+			s[len-1] = '\0'; /* trim trailing quote */
+		} else {
+			/* error - if it begins with a quote, it must end with a quote */
+			slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
+							"__aclp__init_targetattr: Error: The statement does not begin and end with a \": [%s]\n",
+							attr_val);
+			return ACL_SYNTAX_ERR;
+		}
 		s++; /* skip leading quote */
-        if (s[len-1] == '"') {
-            s[len-1] = '\0'; /* trim trailing quote */
-        } else {
-            /* error - if it begins with a quote, it must end with a quote */
-            slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
-                            "__aclp__init_targetattr: Error: The statement does not begin and end with a \": [%s]\n",
-                            attr_val);
-            return ACL_SYNTAX_ERR;
-        }
 	}
 
 	str = s;