1 #ifndef RESTORE_H
2 #define RESTORE_H
3 #ifndef _GNU_SOURCE
4 #define _GNU_SOURCE
5 #endif
6 #include <fts.h>
7 #include <errno.h>
8 #include <string.h>
9 #include <stdio.h>
10 #include <syslog.h>
11 #include <sys/stat.h>
12 #include <sepol/sepol.h>
13 #include <selinux/selinux.h>
14 #include <selinux/label.h>
15 #include <selinux/restorecon.h>
16 #include <stdlib.h>
17 #include <limits.h>
18 #include <stdint.h>
19 
20 /* Things that need to be init'd */
21 struct restore_opts {
22 	unsigned int nochange;
23 	unsigned int verbose;
24 	unsigned int progress;
25 	unsigned int mass_relabel;
26 	unsigned int set_specctx;
27 	unsigned int add_assoc;
28 	unsigned int ignore_digest;
29 	unsigned int recurse;
30 	unsigned int userealpath;
31 	unsigned int xdev;
32 	unsigned int abort_on_error;
33 	unsigned int syslog_changes;
34 	unsigned int log_matches;
35 	unsigned int ignore_noent;
36 	unsigned int ignore_mounts;
37 	/* restorecon_flags holds | of above for restore_init() */
38 	unsigned int restorecon_flags;
39 	char *rootpath;
40 	char *progname;
41 	struct selabel_handle *hnd;
42 	const char *selabel_opt_validate;
43 	const char *selabel_opt_path;
44 	const char *selabel_opt_digest;
45 	int debug;
46 };
47 
48 void restore_init(struct restore_opts *opts);
49 void restore_finish(void);
50 void add_exclude(const char *directory);
51 int process_glob(char *name, struct restore_opts *opts);
52 extern char **exclude_list;
53 
54 #endif
55