mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-21 17:47:10 +00:00
parser: fix coverity's "not restoring ostream format"
Save the ostream flags and restore them after the std::hex modification. Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
parent
05458768cf
commit
3faddfcf46
@ -570,6 +570,8 @@ ostream &mnt_rule::dump(ostream &os)
|
||||
{
|
||||
prefix_rule_t::dump(os);
|
||||
|
||||
std::ios::fmtflags fmt(os.flags());
|
||||
|
||||
if (perms & AA_MAY_MOUNT)
|
||||
os << "mount";
|
||||
else if (perms & AA_MAY_UMOUNT)
|
||||
@ -603,6 +605,7 @@ ostream &mnt_rule::dump(ostream &os)
|
||||
os << " " << "(0x" << hex << perms << "/0x" << (audit != AUDIT_UNSPECIFIED ? perms : 0) << ")";
|
||||
os << ",\n";
|
||||
|
||||
os.flags(fmt);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
@ -431,11 +431,14 @@ public:
|
||||
ostream &dump(ostream &os) override {
|
||||
class_rule_t::dump(os);
|
||||
|
||||
std::ios::fmtflags fmt(os.flags());
|
||||
|
||||
if (saved)
|
||||
os << "(0x" << std::hex << perms << "/orig " << saved << ") ";
|
||||
else
|
||||
os << "(0x" << std::hex << perms << ") ";
|
||||
|
||||
os.flags(fmt);
|
||||
return os;
|
||||
}
|
||||
|
||||
@ -460,7 +463,11 @@ public:
|
||||
ostream &dump(ostream &os) override {
|
||||
class_rule_t::dump(os);
|
||||
|
||||
std::ios::fmtflags fmt(os.flags());
|
||||
|
||||
os << "(0x" << std::hex << perms << ") ";
|
||||
|
||||
os.flags(fmt);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user