Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: sandbox/linux/services/credentials.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/services/credentials.h ('k') | sandbox/linux/services/credentials_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/services/credentials.cc
diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
index c1283ea61a02b12fb53120444b320f89fa3d509f..06e1a6454218eff80669fea9b2591ae492d181b1 100644
--- a/sandbox/linux/services/credentials.cc
+++ b/sandbox/linux/services/credentials.cc
@@ -157,21 +157,16 @@ void CheckCloneNewUserErrno(int error) {
namespace sandbox {
-Credentials::Credentials() {
-}
-
-Credentials::~Credentials() {
-}
-
bool Credentials::DropAllCapabilities() {
ScopedCap cap(cap_init());
CHECK(cap);
PCHECK(0 == cap_set_proc(cap.get()));
+ CHECK(!HasAnyCapability());
// We never let this function fail.
return true;
}
-bool Credentials::HasAnyCapability() const {
+bool Credentials::HasAnyCapability() {
ScopedCap current_cap(cap_get_proc());
CHECK(current_cap);
ScopedCap empty_cap(cap_init());
@@ -179,7 +174,7 @@ bool Credentials::HasAnyCapability() const {
return cap_compare(current_cap.get(), empty_cap.get()) != 0;
}
-scoped_ptr<std::string> Credentials::GetCurrentCapString() const {
+scoped_ptr<std::string> Credentials::GetCurrentCapString() {
ScopedCap current_cap(cap_get_proc());
CHECK(current_cap);
ScopedCapText cap_text(cap_to_text(current_cap.get(), NULL));
« no previous file with comments | « sandbox/linux/services/credentials.h ('k') | sandbox/linux/services/credentials_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698