mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
parser: replace duplicate warn_once() with common function
The warn_once() function is duplicated in 6 different places. A common, reusable version has been added to parser_common.c. Signed-off-by: Mike Salvatore <mike.salvatore@canonical.com>
This commit is contained in:
@@ -461,16 +461,7 @@ char *get_xattr_value(struct cond_entry *entry)
|
||||
static void warn_once_xattr(const char *name)
|
||||
{
|
||||
static const char *warned_name = NULL;
|
||||
|
||||
if ((warnflags & WARN_RULE_DOWNGRADED) && warned_name != name) {
|
||||
cerr << "Warning from profile " << name << " (";
|
||||
if (current_filename)
|
||||
cerr << current_filename;
|
||||
else
|
||||
cerr << "stdin";
|
||||
cerr << ") xattr attachment conditional ignored\n";
|
||||
warned_name = name;
|
||||
}
|
||||
common_warn_once(name, "xattr attachment conditional ignored", &warned_name);
|
||||
}
|
||||
|
||||
static int process_profile_name_xmatch(Profile *prof)
|
||||
|
Reference in New Issue
Block a user