Revert "libsepol: fix checkpolicy dontaudit compiler bug"

This reverts commit 6201bb5e25.
This commit is contained in:
William Roberts 2016-11-15 11:40:00 -08:00 committed by Stephen Smalley
parent d0c82f8fb9
commit 5862ac5dfe

View file

@ -1604,8 +1604,7 @@ static int expand_range_trans(expand_state_t * state,
static avtab_ptr_t find_avtab_node(sepol_handle_t * handle,
avtab_t * avtab, avtab_key_t * key,
cond_av_list_t ** cond,
av_extended_perms_t *xperms,
char *alloced)
av_extended_perms_t *xperms)
{
avtab_ptr_t node;
avtab_datum_t avdatum;
@ -1659,11 +1658,6 @@ static avtab_ptr_t find_avtab_node(sepol_handle_t * handle,
nl->next = *cond;
*cond = nl;
}
if (alloced)
*alloced = 1;
} else {
if (alloced)
*alloced = 0;
}
return node;
@ -1756,7 +1750,7 @@ static int expand_terule_helper(sepol_handle_t * handle,
return EXPAND_RULE_CONFLICT;
}
node = find_avtab_node(handle, avtab, &avkey, cond, NULL, NULL);
node = find_avtab_node(handle, avtab, &avkey, cond, NULL);
if (!node)
return -1;
if (enabled) {
@ -1796,7 +1790,6 @@ static int expand_avrule_helper(sepol_handle_t * handle,
class_perm_node_t *cur;
uint32_t spec = 0;
unsigned int i;
char alloced;
if (specified & AVRULE_ALLOWED) {
spec = AVTAB_ALLOWED;
@ -1831,8 +1824,7 @@ static int expand_avrule_helper(sepol_handle_t * handle,
avkey.target_class = cur->tclass;
avkey.specified = spec;
node = find_avtab_node(handle, avtab, &avkey, cond,
extended_perms, &alloced);
node = find_avtab_node(handle, avtab, &avkey, cond, extended_perms);
if (!node)
return EXPAND_RULE_ERROR;
if (enabled) {
@ -1858,7 +1850,7 @@ static int expand_avrule_helper(sepol_handle_t * handle,
*/
avdatump->data &= cur->data;
} else if (specified & AVRULE_DONTAUDIT) {
if (!alloced)
if (avdatump->data)
avdatump->data &= ~cur->data;
else
avdatump->data = ~cur->data;