security/sandbox/win/src/policy_params.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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