mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00:00
Add separator between mount flags in dump_flags
The previous code would concatenate all of them together without spacing. While dump_flags and the corresponding operator<< function aren't currently used, this will help for when dump_flags is used to debug parser problems. Signed-off-by: Ryan Lee <ryan.lee@canonical.com> (cherry picked from commit 96718ea4d15b0a4551fece1c36b8360c2e44fad3) Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
164526d16a
commit
d96d69a60c
@ -313,11 +313,17 @@ static struct mnt_keyword_table mnt_conds_table[] = {
|
||||
static ostream &dump_flags(ostream &os,
|
||||
pair <unsigned int, unsigned int> flags)
|
||||
{
|
||||
bool is_first = true;
|
||||
for (int i = 0; mnt_opts_table[i].keyword; i++) {
|
||||
if ((flags.first & mnt_opts_table[i].set) ||
|
||||
(flags.second & mnt_opts_table[i].clear))
|
||||
(flags.second & mnt_opts_table[i].clear)) {
|
||||
if (!is_first) {
|
||||
os << ", ";
|
||||
}
|
||||
is_first = false;
|
||||
os << mnt_opts_table[i].keyword;
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user