security/sandbox/win/src/policy_params.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
michael@0 2 // Use of this source code is governed by a BSD-style license that can be
michael@0 3 // found in the LICENSE file.
michael@0 4
michael@0 5 #ifndef SANDBOX_SRC_POLICY_PARAMS_H__
michael@0 6 #define SANDBOX_SRC_POLICY_PARAMS_H__
michael@0 7
michael@0 8 #include "sandbox/win/src/policy_engine_params.h"
michael@0 9
michael@0 10 namespace sandbox {
michael@0 11
michael@0 12 class ParameterSet;
michael@0 13
michael@0 14 // Warning: The following macros store the address to the actual variables, in
michael@0 15 // other words, the values are not copied.
michael@0 16 #define POLPARAMS_BEGIN(type) class type { public: enum Args {
michael@0 17 #define POLPARAM(arg) arg,
michael@0 18 #define POLPARAMS_END(type) PolParamLast }; }; \
michael@0 19 typedef sandbox::ParameterSet type##Array [type::PolParamLast];
michael@0 20
michael@0 21 // Policy parameters for file open / create.
michael@0 22 POLPARAMS_BEGIN(OpenFile)
michael@0 23 POLPARAM(NAME)
michael@0 24 POLPARAM(BROKER) // TRUE if called from the broker.
michael@0 25 POLPARAM(ACCESS)
michael@0 26 POLPARAM(OPTIONS)
michael@0 27 POLPARAMS_END(OpenFile)
michael@0 28
michael@0 29 // Policy parameter for name-based policies.
michael@0 30 POLPARAMS_BEGIN(FileName)
michael@0 31 POLPARAM(NAME)
michael@0 32 POLPARAM(BROKER) // TRUE if called from the broker.
michael@0 33 POLPARAMS_END(FileName)
michael@0 34
michael@0 35 COMPILE_ASSERT(OpenFile::NAME == static_cast<int>(FileName::NAME),
michael@0 36 to_simplify_fs_policies);
michael@0 37 COMPILE_ASSERT(OpenFile::BROKER == static_cast<int>(FileName::BROKER),
michael@0 38 to_simplify_fs_policies);
michael@0 39
michael@0 40 // Policy parameter for name-based policies.
michael@0 41 POLPARAMS_BEGIN(NameBased)
michael@0 42 POLPARAM(NAME)
michael@0 43 POLPARAMS_END(NameBased)
michael@0 44
michael@0 45 // Policy parameters for open event.
michael@0 46 POLPARAMS_BEGIN(OpenEventParams)
michael@0 47 POLPARAM(NAME)
michael@0 48 POLPARAM(ACCESS)
michael@0 49 POLPARAMS_END(OpenEventParams)
michael@0 50
michael@0 51 // Policy Parameters for reg open / create.
michael@0 52 POLPARAMS_BEGIN(OpenKey)
michael@0 53 POLPARAM(NAME)
michael@0 54 POLPARAM(ACCESS)
michael@0 55 POLPARAMS_END(OpenKey)
michael@0 56
michael@0 57 // Policy parameter for name-based policies.
michael@0 58 POLPARAMS_BEGIN(HandleTarget)
michael@0 59 POLPARAM(NAME)
michael@0 60 POLPARAM(TARGET)
michael@0 61 POLPARAMS_END(HandleTarget)
michael@0 62
michael@0 63
michael@0 64 } // namespace sandbox
michael@0 65
michael@0 66 #endif // SANDBOX_SRC_POLICY_PARAMS_H__

mercurial