PERFORCE change 114883 for review

Todd Miller millert at FreeBSD.org
Fri Feb 23 17:10:31 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=114883

Change 114883 by millert at millert_macbook on 2007/02/23 17:10:05

	g/c unused security_get_bools()

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/sedarwin/ss/services.c#7 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/sedarwin/ss/services.c#7 (text+ko) ====

@@ -1960,51 +1960,6 @@
 	return (ENOENT);
 }
 
-static __unused int security_get_bools(int *len, char ***names, int **values)
-{
-	int i, rc = ENOMEM;
-
-	POLICY_RDLOCK;
-	*names = NULL;
-	*values = NULL;
-
-	*len = policydb.p_bools.nprim;
-	if (!*len) {
-		rc = 0;
-		goto out;
-	}
-
-       *names = kcalloc(*len, sizeof(char*), GFP_ATOMIC);
-	if (!*names)
-		goto err;
-
-       *values = kcalloc(*len, sizeof(int), GFP_ATOMIC);
-	if (!*values)
-		goto err;
-
-	for (i = 0; i < *len; i++) {
-		size_t name_len;
-		(*values)[i] = policydb.bool_val_to_struct[i]->state;
-		name_len = strlen(policydb.p_bool_val_to_name[i]) + 1;
-               (*names)[i] = kmalloc(sizeof(char) * name_len, GFP_ATOMIC);
-		if (!(*names)[i])
-			goto err;
-		strncpy((*names)[i], policydb.p_bool_val_to_name[i], name_len);
-		(*names)[i][name_len - 1] = 0;
-	}
-	rc = 0;
-out:
-	POLICY_RDUNLOCK;
-	return rc;
-err:
-	if (*names) {
-		for (i = 0; i < *len; i++)
-			kfree((*names)[i]);
-	}
-	kfree(*values);
-	goto out;
-}
-
 int security_commit_pending_bools(void)
 {
 	u32 i;


More information about the p4-projects mailing list