[Fedora-directory-commits] ldapserver/ldap/admin/src cfg_sspt.c, 1.7, 1.8

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Thu Feb 16 17:39:55 UTC 2006


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/admin/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7463/ldapserver/ldap/admin/src

Modified Files:
	cfg_sspt.c 
Log Message:
Bug(s) fixed: 181776
Bug Description: 64bit issues with normalize_path(), make_dn(), and 
add_aci_v()
Reviewed by: Nathan and Noriko (Thanks!)
Fix Description: 1) use sizeof(char *) as the elemsize to pass to 
slapi_ch_calloc(). 2) create a variable const char *NULLSTR = 0 to pass 
as the last argument to the varargs functions.
Platforms tested: RHEL4 64
Flag Day: no
Doc impact: no



Index: cfg_sspt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/cfg_sspt.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cfg_sspt.c	19 Apr 2005 22:06:55 -0000	1.7
+++ cfg_sspt.c	16 Feb 2006 17:39:47 -0000	1.8
@@ -54,6 +54,8 @@
 
 #define TEST_CONFIG /* for testing cn=config40 dummy entry instead of real one */
 
+char* const NULLSTR = 0;
+
 char* const class_top                    = "top";
 char* const class_organization           = "organization";
 char* const class_organizationalUnit     = "organizationalunit";
@@ -754,7 +756,7 @@
 	if (!base)
 		entrydn = strdup(unit);
 	else
-		entrydn = make_dn("%s=%s, %s", name_ou, unit, base, 0);
+		entrydn = make_dn("%s=%s, %s", name_ou, unit, base, NULLSTR);
 
 	if (!entry_exists(ld, entrydn))
 	{
@@ -1062,7 +1064,7 @@
 		return -1;
 	}
 
-	entrydn = make_dn("%s=%s", name_cn, value_config40, 0);
+	entrydn = make_dn("%s=%s", name_cn, value_config40, NULLSTR);
 	if (!entry_exists(ld, entrydn))
 	{
 		LDAPMod* attrs[3];
@@ -1130,7 +1132,7 @@
 		return -1;
 	}
 
-	entrydn = make_dn("%s=%s, %s", name_cn, group, base, 0);
+	entrydn = make_dn("%s=%s, %s", name_cn, group, base, NULLSTR);
 
 	if (!entry_exists(ld, entrydn)) 
 	{
@@ -1379,7 +1381,7 @@
 {
 	/* initial ACIs for o=NetscapeRoot */
 
-	int ret = add_aci_v (connection, value_config40DN, ACI_self_allow, 0);
+	int ret = add_aci_v (connection, value_config40DN, ACI_self_allow, NULLSTR);
 	return ret;
 }
 
@@ -1418,7 +1420,7 @@
 	/* parent dn of admin uid entry */
 	if (query->netscaperoot) {
 		parentDN = make_dn("%s, %s, %s", name_administratorsRDN,
-						   name_topologyRDN, query->netscaperoot, 0);
+						   name_topologyRDN, query->netscaperoot, NULLSTR);
 	}
 
 	if (query->config_admin_uid) {
@@ -1428,12 +1430,12 @@
 			configAdminDN = strdup(query->config_admin_uid);
 		} else if (parentDN) {
 			/* create a DN for admid */
-			configAdminDN = make_dn(DN_formatUID, query->config_admin_uid, parentDN, 0);
+			configAdminDN = make_dn(DN_formatUID, query->config_admin_uid, parentDN, NULLSTR);
 		} else {
 			/* create one from scratch */
 			configAdminDN = make_dn("%s=%s, %s, %s, %s", name_uid, query->config_admin_uid,
 									name_administratorsRDN, name_topologyRDN,
-									name_netscaperootDN, 0);
+									name_netscaperootDN, NULLSTR);
 		}
 	}
 
@@ -1444,7 +1446,7 @@
 		{
 			if (configAdminDN && !is_root_user(configAdminDN, query)) {
 				add_aci_v(connection, query->suffix, ACI_user_allow_2,
-						  "all", configAdminDN, 0);
+						  "all", configAdminDN, NULLSTR);
 			}
 
 			status = create_group(connection, query->suffix, name_localDAGroup);
@@ -1465,13 +1467,13 @@
 			adminGroupDN = make_dn("%s, %s=%s, %s, %s", value_configAdminGroupRDN,
 								   name_ou, value_groupsOU,
 								   name_topologyRDN,
-								   query->netscaperoot, 0);
+								   query->netscaperoot, NULLSTR);
 		}
 
 		if (query->suffix)
 		{
 			localDAGroupDN = make_dn("cn=%s, %s", name_localDAGroup,
- 							   query->suffix, 0);
+ 							   query->suffix, NULLSTR);
 		}
 		else 
 		{
@@ -1483,20 +1485,20 @@
 				add_aci_v(connection, entryAndAccessList[ii].entryDN,
 						  ACI_config_admin_group_allow,
 						  entryAndAccessList[ii].access,
-						  adminGroupDN, 0);
+						  adminGroupDN, NULLSTR);
 			}
 			if (configAdminDN && !is_root_user(configAdminDN, query)) {
 				add_aci_v(connection, entryAndAccessList[ii].entryDN,
 						  ACI_user_allow_2,
 						  entryAndAccessList[ii].access,
-						  configAdminDN, 0);
+						  configAdminDN, NULLSTR);
 			}
 			if (localDAGroupDN)
 			{
 				add_aci_v(connection, entryAndAccessList[ii].entryDN,
 						  ACI_local_DA_allow,
 						  entryAndAccessList[ii].access,
-						  localDAGroupDN, 0);
+						  localDAGroupDN, NULLSTR);
 			}
 		}
 	}
@@ -1512,22 +1514,22 @@
 							   ACI_config_admin_group_allow_all,
 							   value_configAdminGroupRDN,
 							   name_ou, value_groupsOU, name_topologyRDN,
-							   query->netscaperoot, 0);
+							   query->netscaperoot, NULLSTR);
 
 		if (!status)
 			status = add_aci_v(connection, query->netscaperoot,
 							   ACI_anonymous_allow_with_filter,
-							   query->netscaperoot, 0);
+							   query->netscaperoot, NULLSTR);
 
 		if (!status)
 			status = add_aci_v(connection, query->netscaperoot, ACI_group_expansion,
-							   query->netscaperoot, 0);
+							   query->netscaperoot, NULLSTR);
 
 		/* create "topologyOU, netscaperoot" entry and set ACIs */
 		if (!status)
 		{
 			char *dn = make_dn("%s, %s", name_topologyRDN,
-							   query->netscaperoot, 0);
+							   query->netscaperoot, NULLSTR);
 			status = create_organizational_unit(connection, NULL, dn,
 												value_topologyDESC,
 												0, 0, 0);
@@ -1542,7 +1544,7 @@
 		if (!status)
 		{
 			char *dn = make_dn("%s=%s, %s, %s", name_ou, value_groupsOU,
-							   name_topologyRDN, query->netscaperoot, 0);
+							   name_topologyRDN, query->netscaperoot, NULLSTR);
 			status = create_organizational_unit (connection, NULL, dn,
 												 value_groupsDesc, 0, 0, 0);
 			free(dn);
@@ -1552,7 +1554,7 @@
 		if (!status)
 		{
 			char *dn = make_dn("%s, %s, %s", name_administratorsRDN,
-							   name_topologyRDN, query->netscaperoot, 0);
+							   name_topologyRDN, query->netscaperoot, NULLSTR);
 			status = create_organizational_unit (connection, NULL, dn,
 												 value_administratorsDESC,
 												 0, 0, 0);
@@ -1564,7 +1566,7 @@
 		{
 			char *dn = make_dn("%s=%s, %s, %s", name_ou, value_groupsOU,
 							   name_topologyRDN,
-							   query->netscaperoot, 0);
+							   query->netscaperoot, NULLSTR);
 			status = create_group (connection, dn, value_configAdminGroupCN);
 			free(dn);
 		}
@@ -1575,7 +1577,7 @@
 			/* group to add the uid to */
 			char *groupdn = make_dn("%s, %s=%s, %s, %s", value_configAdminGroupRDN,
 									name_ou, value_groupsOU, name_topologyRDN,
-									query->netscaperoot, 0);
+									query->netscaperoot, NULLSTR);
 			create_ssadmin_user(connection, parentDN,
 								query->ssAdmID, query->ssAdmPW1);
 
@@ -1585,7 +1587,7 @@
 		}
 
 		admin_domainDN = make_dn("%s=%s, %s", name_ou, query->admin_domain,
-								 query->netscaperoot, 0);
+								 query->netscaperoot, NULLSTR);
 
 		if (!status)
 			status = create_organizational_unit (connection, 0,




More information about the Fedora-directory-commits mailing list