[Fedora-directory-commits] ldapserver/ldap/servers/plugins/acl aclparse.c, 1.7, 1.8

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Thu Oct 18 20:55:13 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/acl
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19790/ldapserver/ldap/servers/plugins/acl

Modified Files:
	aclparse.c 
Log Message:
Resolves: bug 232910
Bug Description: ACI targetattr list parser is whitespace sensitive
Reviewed by: nkinder, nhosoi (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: Need to trim trailing whitespace from the targetattr clause.  I noticed that targetattrfilters had the same problem, except it returned ACL_SYNTAX_ERR in that case, so I changed targetattr to do the same.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no



Index: aclparse.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/aclparse.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- aclparse.c	18 Oct 2007 00:08:27 -0000	1.7
+++ aclparse.c	18 Oct 2007 20:55:10 -0000	1.8
@@ -1232,10 +1232,16 @@
 	s = strchr (attr_val, '=');
 	s++;
 	__acl_strip_leading_space(&s);
+	__acl_strip_trailing_space(s);
 	len = strlen(s);
 	if (*s == '"' && s[len-1] == '"') {
 		s[len-1] = '\0';
 		s++;
+	} else {
+		slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
+						"__aclp__init_targetattr: Error: The statement does not begin and end with a \": [%s]\n",
+						s);
+		return ACL_SYNTAX_ERR;
 	}
 
 	str = s;
@@ -1635,12 +1641,15 @@
     s = strchr (input_str, '=');
     s++;							/* skip the = */
     __acl_strip_leading_space(&s);	/* skip to next significant character */
+    __acl_strip_trailing_space(s);
     len = strlen(s);				/* Knock off the " and trailing ) */
 	if (*s == '"' && s[len-1] == '"') {
 		s[len-1] = '\0';
 		s++;						/* skip the first " */
 	} else {						/* No matching quotes */
-        	
+		slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
+						"__aclp__init_targetattrfilters: Error: The statement does not begin and end with a \": [%s]\n",
+						s);
     	return (ACL_SYNTAX_ERR);
     }
     




More information about the Fedora-directory-commits mailing list