mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01: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 96718ea4d1
)
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
164526d16a
commit
d96d69a60c
1 changed files with 7 additions and 1 deletions
|
@ -313,11 +313,17 @@ static struct mnt_keyword_table mnt_conds_table[] = {
|
||||||
static ostream &dump_flags(ostream &os,
|
static ostream &dump_flags(ostream &os,
|
||||||
pair <unsigned int, unsigned int> flags)
|
pair <unsigned int, unsigned int> flags)
|
||||||
{
|
{
|
||||||
|
bool is_first = true;
|
||||||
for (int i = 0; mnt_opts_table[i].keyword; i++) {
|
for (int i = 0; mnt_opts_table[i].keyword; i++) {
|
||||||
if ((flags.first & mnt_opts_table[i].set) ||
|
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;
|
os << mnt_opts_table[i].keyword;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue