2011-03-13 05:49:15 -07:00
|
|
|
/*
|
|
|
|
* (C) 2006, 2007 Andreas Gruenbacher <agruen@suse.de>
|
|
|
|
* Copyright (c) 2003-2008 Novell, Inc. (All rights reserved)
|
2012-02-24 04:21:59 -08:00
|
|
|
* Copyright 2009-2012 Canonical Ltd.
|
2011-03-13 05:49:15 -07:00
|
|
|
*
|
|
|
|
* The libapparmor library is licensed under the terms of the GNU
|
|
|
|
* Lesser General Public License, version 2.1. Please see the file
|
|
|
|
* COPYING.LGPL.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Wrapper around the dfa to convert aa rules into a dfa
|
|
|
|
*/
|
|
|
|
#ifndef __LIBAA_RE_RULES_H
|
|
|
|
#define __LIBAA_RE_RULES_H
|
|
|
|
|
2011-03-13 05:50:34 -07:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "apparmor_re.h"
|
2014-04-23 10:57:16 -07:00
|
|
|
#include "expr-tree.h"
|
2011-03-13 05:50:34 -07:00
|
|
|
|
2014-04-23 10:57:16 -07:00
|
|
|
class aare_rules {
|
|
|
|
Node *root;
|
2014-09-03 14:24:37 -07:00
|
|
|
void add_to_rules(Node *tree, Node *perms);
|
2014-04-23 10:57:16 -07:00
|
|
|
public:
|
|
|
|
int reverse;
|
|
|
|
int rule_count;
|
|
|
|
aare_rules(): root(NULL), reverse(0), rule_count(0) { };
|
|
|
|
aare_rules(int reverse): root(NULL), reverse(reverse), rule_count(0) { };
|
|
|
|
~aare_rules();
|
2011-03-13 05:49:15 -07:00
|
|
|
|
2014-04-23 10:57:16 -07:00
|
|
|
bool add_rule(const char *rule, int deny, uint32_t perms,
|
|
|
|
uint32_t audit, dfaflags_t flags);
|
|
|
|
bool add_rule_vec(int deny, uint32_t perms, uint32_t audit, int count,
|
|
|
|
const char **rulev, dfaflags_t flags);
|
|
|
|
void *create_dfa(size_t *size, dfaflags_t flags);
|
|
|
|
};
|
2011-03-13 05:49:15 -07:00
|
|
|
|
|
|
|
void aare_reset_matchflags(void);
|
|
|
|
|
2011-03-13 05:53:08 -07:00
|
|
|
#endif /* __LIBAA_RE_RULES_H */
|