Преглед на файлове

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.

Noriko Hosoi преди 17 години
родител
ревизия
e0e27852ef
променени са 1 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 10 2
      ldap/servers/plugins/acl/acleffectiverights.c

+ 10 - 2
ldap/servers/plugins/acl/acleffectiverights.c

@@ -873,8 +873,16 @@ _ger_generate_template_entry (
 		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);