summaryrefslogtreecommitdiff
path: root/zen/privilege.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zen/privilege.cpp')
-rw-r--r--zen/privilege.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/zen/privilege.cpp b/zen/privilege.cpp
index 44318517..d4f956a8 100644
--- a/zen/privilege.cpp
+++ b/zen/privilege.cpp
@@ -104,13 +104,15 @@ private:
~Privileges() //clean up: deactivate all privileges that have been activated by this application
{
- for (auto it = activePrivileges.begin(); it != activePrivileges.end(); ++it)
- if (it->second)
+ for (const auto& priv : activePrivileges)
+ if (priv.second)
+ {
try
{
- setPrivilege(it->first.c_str(), false); //throw FileError
+ setPrivilege(priv.first.c_str(), false); //throw FileError
}
- catch (...) {}
+ catch (FileError&) {}
+ }
}
std::map<Zstring, bool> activePrivileges; //bool: enabled by this application
bgstack15