Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/acl
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4424
Modified Files:
acleffectiverights.c
Log Message:
Resolves: #457156
Summary: GER: allow GER for non-existing entries (phase 2) (comment #6)
Description: additional fix for the previous checkin.
Not just checking if dn is NULL or not, but also checking the length of dn is
greater than 0. If both conditions are satisfied, locate the template entry at
the dn.
Index: acleffectiverights.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/acleffectiverights.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- acleffectiverights.c 31 Jul 2008 17:25:37 -0000 1.11
+++ acleffectiverights.c 31 Jul 2008 21:27:26 -0000 1.12
@@ -873,8 +873,16 @@
siz += 32 + strlen(object);
}
templateentry = (char *)slapi_ch_malloc(siz);
- PR_snprintf(templateentry, siz,
- "dn: cn=template_%s_objectclass%s%s\n", object,
dn?",":"", dn?dn:"");
+ if (NULL != dn && strlen(dn) > 0)
+ {
+ PR_snprintf(templateentry, siz,
+ "dn: cn=template_%s_objectclass,%s\n", object, dn);
+ }
+ else
+ {
+ PR_snprintf(templateentry, siz,
+ "dn: cn=template_%s_objectclass\n", object);
+ }
for (--i; i >= 0; i--)
{
len = strlen(templateentry);