2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 01:57:43 +00:00

parser: convert valid_prefix and add_prefix to use const

The prefix can passed as a parameter can be const so it should be.

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen 2022-09-01 09:56:45 -07:00
parent 355730d8c7
commit b3bb74c33c
8 changed files with 9 additions and 9 deletions

View File

@ -46,7 +46,7 @@ public:
free(peer_addr);
};
virtual bool valid_prefix(prefixes &p, const char *&error) {
virtual bool valid_prefix(const prefixes &p, const char *&error) {
if (p.owner) {
error = "owner prefix not allowed on unix rules";
return false;

View File

@ -50,7 +50,7 @@ public:
free(interface);
free(member);
};
virtual bool valid_prefix(prefixes &p, const char *&error) {
virtual bool valid_prefix(const prefixes &p, const char *&error) {
if (p.owner) {
error = "owner prefix not allowed on dbus rules";
return false;

View File

@ -156,7 +156,7 @@ public:
free(trans);
}
virtual bool valid_prefix(prefixes &p, const char *&error) {
virtual bool valid_prefix(const prefixes &p, const char *&error) {
if (p.owner) {
error = "owner prefix not allowed on mount rules";
return false;

View File

@ -95,7 +95,7 @@ public:
free(label);
};
virtual bool valid_prefix(prefixes &p, const char *&error) {
virtual bool valid_prefix(const prefixes &p, const char *&error) {
// not yet, but soon
if (p.owner) {
error = _("owner prefix not allowed on mqueue rules");

View File

@ -44,7 +44,7 @@ public:
virtual int expand_variables(void);
virtual int gen_policy_re(Profile &prof);
virtual bool valid_prefix(prefixes &p, const char *&error) {
virtual bool valid_prefix(const prefixes &p, const char *&error) {
if (p.owner) {
error = "owner prefix not allowed on ptrace rules";
return false;

View File

@ -135,9 +135,9 @@ public:
owner = 0;
};
virtual bool valid_prefix(prefixes &p, const char *&error) = 0;
virtual bool valid_prefix(const prefixes &p, const char *&error) = 0;
virtual bool add_prefix(prefixes &p, const char *&error) {
virtual bool add_prefix(const prefixes &p, const char *&error) {
if (!valid_prefix(p, error))
return false;
if (p.audit != AUDIT_UNSPECIFIED && audit != p.audit) {

View File

@ -45,7 +45,7 @@ public:
signals.clear();
free(peer_label);
};
virtual bool valid_prefix(prefixes &p, const char *&error) {
virtual bool valid_prefix(const prefixes &p, const char *&error) {
if (p.owner) {
error = "owner prefix not allowed on signal rules";
return false;

View File

@ -31,7 +31,7 @@ public:
{
};
virtual bool valid_prefix(prefixes &p, const char *&error) {
virtual bool valid_prefix(const prefixes &p, const char *&error) {
if (p.owner) {
error = _("owner prefix not allowed on userns rules");
return false;