2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

parser: int mode to perms

Move from using and int for permissions bit mask to a perms_t type.
Also move any perms mask that uses the name mode to perms to avoid
confusing it with other uses of mode.

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen
2021-06-09 00:56:59 -07:00
parent b255ff8831
commit fd9a6fe133
26 changed files with 356 additions and 353 deletions

View File

@@ -101,32 +101,32 @@ ostream &af_rule::dump_prefix(ostream &os)
ostream &af_rule::dump_local(ostream &os)
{
if (mode != AA_VALID_NET_PERMS) {
if (perms != AA_VALID_NET_PERMS) {
os << " (";
if (mode & AA_NET_SEND)
if (perms & AA_NET_SEND)
os << "send ";
if (mode & AA_NET_RECEIVE)
if (perms & AA_NET_RECEIVE)
os << "receive ";
if (mode & AA_NET_CREATE)
if (perms & AA_NET_CREATE)
os << "create ";
if (mode & AA_NET_SHUTDOWN)
if (perms & AA_NET_SHUTDOWN)
os << "shutdown ";
if (mode & AA_NET_CONNECT)
if (perms & AA_NET_CONNECT)
os << "connect ";
if (mode & AA_NET_SETATTR)
if (perms & AA_NET_SETATTR)
os << "setattr ";
if (mode & AA_NET_GETATTR)
if (perms & AA_NET_GETATTR)
os << "getattr ";
if (mode & AA_NET_BIND)
if (perms & AA_NET_BIND)
os << "bind ";
if (mode & AA_NET_ACCEPT)
if (perms & AA_NET_ACCEPT)
os << "accept ";
if (mode & AA_NET_LISTEN)
if (perms & AA_NET_LISTEN)
os << "listen ";
if (mode & AA_NET_SETOPT)
if (perms & AA_NET_SETOPT)
os << "setopt ";
if (mode & AA_NET_GETOPT)
if (perms & AA_NET_GETOPT)
os << "getopt ";
os << ")";
}