Date: Fri, 23 Feb 2007 17:10:28 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 114883 for review Message-ID: <200702231710.l1NHASiG046373@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=114883 Change 114883 by millert@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702231710.l1NHASiG046373>