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

Side by Side Diff: client/site_tests/platform_MiniJailRootCapabilities/src/platform_MiniJailRootCapabilities.cc

Issue 3110010: [autotest] Update to compile against new libchrome (Closed) Base URL: http://src.chromium.org/git/autotest.git
Patch Set: Created 10 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h>
6 #include <stdlib.h>
5 #include <string.h> 7 #include <string.h>
6 #include <sys/capability.h> 8 #include <sys/capability.h>
7 9
8 #include "base/command_line.h" 10 #include "base/command_line.h"
9 11
10 // Checks that the capabilities mask of the current process is as expected. 12 // Checks that the capabilities mask of the current process is as expected.
11 // It mirrors the minijail code in considering CAP_SETPCAP acceptable 13 // It mirrors the minijail code in considering CAP_SETPCAP acceptable
12 // regardless of the mask passed into the function. 14 // regardless of the mask passed into the function.
13 void CheckRootCaps(uint64_t effective_capmask) { 15 void CheckRootCaps(uint64_t effective_capmask) {
14 cap_t caps = cap_get_proc(); 16 cap_t caps = cap_get_proc();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 57 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
56 58
57 if(cmd_line->HasSwitch("checkRootCaps")) { 59 if(cmd_line->HasSwitch("checkRootCaps")) {
58 uint64_t caps = 60 uint64_t caps =
59 atol(cmd_line->GetSwitchValueASCII("checkRootCaps").c_str()); 61 atol(cmd_line->GetSwitchValueASCII("checkRootCaps").c_str());
60 CheckRootCaps(caps); 62 CheckRootCaps(caps);
61 } 63 }
62 64
63 return 0; 65 return 0;
64 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698