mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Rename and invert logic of is_null to is_accept to better reflect its use
Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-By: Steve Beattie <sbeattie@ubuntu.com>
This commit is contained in:
parent
8eaeb44f56
commit
f4240fcc74
2 changed files with 9 additions and 9 deletions
|
@ -340,7 +340,7 @@ void DFA::remove_unreachable(dfaflags_t flags)
|
|||
cerr << "unreachable: " << **i;
|
||||
if (*i == start)
|
||||
cerr << " <==";
|
||||
if (!(*i)->perms.is_null())
|
||||
if ((*i)->perms.is_accept())
|
||||
(*i)->perms.dump(cerr);
|
||||
cerr << "\n";
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ void DFA::minimize(dfaflags_t flags)
|
|||
(*i)->label = -1;
|
||||
rep->perms.add((*i)->perms);
|
||||
}
|
||||
if (!rep->perms.is_null())
|
||||
if (rep->perms.is_accept())
|
||||
final_accept++;
|
||||
//if ((*p)->size() > 1)
|
||||
//cerr << "\n";
|
||||
|
@ -611,11 +611,11 @@ out:
|
|||
void DFA::dump(ostream & os)
|
||||
{
|
||||
for (Partition::iterator i = states.begin(); i != states.end(); i++) {
|
||||
if (*i == start || !(*i)->perms.is_null()) {
|
||||
if (*i == start || (*i)->perms.is_accept()) {
|
||||
os << **i;
|
||||
if (*i == start)
|
||||
os << " <== (allow/deny/audit/quiet)";
|
||||
if (!(*i)->perms.is_null())
|
||||
if ((*i)->perms.is_accept())
|
||||
(*i)->perms.dump(os);
|
||||
os << "\n";
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ void DFA::dump(ostream & os)
|
|||
excluded.insert(j->first);
|
||||
} else {
|
||||
os << **i;
|
||||
if (!(*i)->perms.is_null())
|
||||
if ((*i)->perms.is_accept())
|
||||
os << " ", (*i)->perms.dump(os);
|
||||
os << " -> " << *(j)->second << ": 0x"
|
||||
<< hex << (int) j->first;
|
||||
|
@ -643,7 +643,7 @@ void DFA::dump(ostream & os)
|
|||
|
||||
if ((*i)->otherwise != nonmatching) {
|
||||
os << **i;
|
||||
if (!(*i)->perms.is_null())
|
||||
if ((*i)->perms.is_accept())
|
||||
os << " ", (*i)->perms.dump(os);
|
||||
os << " -> " << *(*i)->otherwise << ": [";
|
||||
if (!excluded.empty()) {
|
||||
|
@ -677,7 +677,7 @@ void DFA::dump_dot_graph(ostream & os)
|
|||
if (*i == start) {
|
||||
os << "\t\tstyle=bold" << "\n";
|
||||
}
|
||||
if (!(*i)->perms.is_null()) {
|
||||
if ((*i)->perms.is_accept()) {
|
||||
os << "\t\tlabel=\"" << **i << "\\n";
|
||||
(*i)->perms.dump(os);
|
||||
os << "\"\n";
|
||||
|
|
|
@ -43,7 +43,7 @@ class perms_t {
|
|||
public:
|
||||
perms_t(void) throw(int): allow(0), deny(0), audit(0), quiet(0), exact(0) { };
|
||||
|
||||
bool is_null(void) { return !(allow | audit | quiet); }
|
||||
bool is_accept(void) { return (allow | audit | quiet); }
|
||||
|
||||
void dump(ostream &os)
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
allow &= ~deny;
|
||||
quiet &= deny;
|
||||
deny = 0;
|
||||
return is_null();
|
||||
return !is_accept();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue