1 /* Authors: Jason Tang <jtang@tresys.com>
2  *
3  * Copyright (C) 2004-2005 Tresys Technology, LLC
4  *
5  *  This library is free software; you can redistribute it and/or
6  *  modify it under the terms of the GNU Lesser General Public
7  *  License as published by the Free Software Foundation; either
8  *  version 2.1 of the License, or (at your option) any later version.
9  *
10  *  This library is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *  Lesser General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Lesser General Public
16  *  License along with this library; if not, write to the Free Software
17  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #ifndef SEMANAGE_CONF_H
21 #define SEMANAGE_CONF_H
22 
23 #include <semanage/handle.h>
24 #include <sys/types.h>
25 #include <sys/stat.h>
26 
27 /* libsemanage has its own configuration file.	It has two main parts:
28  *  - single options
29  *  - external programs to execute whenever a policy is to be loaded
30  */
31 
32 typedef struct semanage_conf {
33 	enum semanage_connect_type store_type;
34 	char *store_path;	/* used for both socket path and policy dir */
35 	char *compiler_directory_path;
36 	int server_port;
37 	int policyvers;		/* version for server generated policies */
38 	int target_platform;
39 	int expand_check;
40 	int save_previous;
41 	int save_linked;
42 	int disable_genhomedircon;
43 	int usepasswd;
44 	int handle_unknown;
45 	mode_t file_mode;
46 	int bzip_blocksize;
47 	int bzip_small;
48 	int remove_hll;
49 	int ignore_module_cache;
50 	char *ignoredirs;	/* ";" separated of list for genhomedircon to ignore */
51 	struct external_prog *load_policy;
52 	struct external_prog *setfiles;
53 	struct external_prog *sefcontext_compile;
54 	struct external_prog *mod_prog, *linked_prog, *kernel_prog;
55 	char *store_root_path;
56 } semanage_conf_t;
57 
58 /* A linked list of verification programs.  Each one is called in
59  * order of appearance within the configuration file.
60  */
61 typedef struct external_prog {
62 	char *path;
63 	char *args;
64 	struct external_prog *next;
65 } external_prog_t;
66 
67 semanage_conf_t *semanage_conf_parse(const char *config_filename);
68 void semanage_conf_destroy(semanage_conf_t * conf);
69 
70 #endif
71