ldap/servers/plugins/acl/aclparse.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 6041c77a179936f64598ed1039274aa05eebea1e
Author: Anupam Jain <anjain(a)localhost.localdomain>
Date: Tue Jul 23 13:20:13 2013 -0700
Ticket #617 - Possible to add invalid ACI value
Fix description: The fix enables the syntax check for ACI
even when '(' is not present
https://fedorahosted.org/389/ticket/617
Reviewed by nhosoi.
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
index bf02764..a8a38a1 100644
--- a/ldap/servers/plugins/acl/aclparse.c
+++ b/ldap/servers/plugins/acl/aclparse.c
@@ -97,8 +97,8 @@ acl_parse(char * str, aci_t *aci_item, char **errbuf)
{
int rv=0;
- char *next;
- char *save;
+ char *next=NULL;
+ char *save=NULL;
while(*str) {
__acl_strip_leading_space( &str );
@@ -108,9 +108,12 @@ acl_parse(char * str, aci_t *aci_item, char **errbuf)
if ((next = slapi_find_matching_paren(str)) == NULL) {
return(ACL_SYNTAX_ERR);
}
- } else {
+ } else if (!next) {
+ /* the statement does not start with a parenthesis */
+ return(ACL_SYNTAX_ERR);
+ } else {
/* then we have done all the processing */
- return 0;
+ return 0;
}
LDAP_UTF8INC(str); /* skip the "(" */
save = next;