2009-09-10 18:54:35 +00:00
|
|
|
#ifndef RESTORE_H
|
|
|
|
#define RESTORE_H
|
|
|
|
#ifndef _GNU_SOURCE
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#endif
|
|
|
|
#include <fts.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <syslog.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sepol/sepol.h>
|
|
|
|
#include <selinux/selinux.h>
|
|
|
|
#include <selinux/label.h>
|
2016-07-26 08:44:44 +00:00
|
|
|
#include <selinux/restorecon.h>
|
2009-09-10 18:54:35 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <limits.h>
|
2012-02-03 16:56:39 +00:00
|
|
|
#include <stdint.h>
|
2009-09-10 18:54:35 +00:00
|
|
|
|
|
|
|
/* Things that need to be init'd */
|
|
|
|
struct restore_opts {
|
2016-07-26 08:44:44 +00:00
|
|
|
unsigned int nochange;
|
|
|
|
unsigned int verbose;
|
|
|
|
unsigned int progress;
|
2017-01-27 12:47:49 +00:00
|
|
|
unsigned int mass_relabel;
|
2016-07-26 08:44:44 +00:00
|
|
|
unsigned int set_specctx;
|
|
|
|
unsigned int add_assoc;
|
|
|
|
unsigned int ignore_digest;
|
|
|
|
unsigned int recurse;
|
|
|
|
unsigned int userealpath;
|
|
|
|
unsigned int xdev;
|
|
|
|
unsigned int abort_on_error;
|
|
|
|
unsigned int syslog_changes;
|
|
|
|
unsigned int log_matches;
|
|
|
|
unsigned int ignore_noent;
|
|
|
|
unsigned int ignore_mounts;
|
2020-04-02 15:45:09 +00:00
|
|
|
unsigned int conflict_error;
|
2022-05-03 08:23:26 +00:00
|
|
|
unsigned int count_errors;
|
2016-07-26 08:44:44 +00:00
|
|
|
/* restorecon_flags holds | of above for restore_init() */
|
|
|
|
unsigned int restorecon_flags;
|
2009-09-10 18:54:35 +00:00
|
|
|
char *rootpath;
|
|
|
|
char *progname;
|
|
|
|
struct selabel_handle *hnd;
|
|
|
|
const char *selabel_opt_validate;
|
|
|
|
const char *selabel_opt_path;
|
2016-07-26 08:44:44 +00:00
|
|
|
const char *selabel_opt_digest;
|
|
|
|
int debug;
|
2009-09-10 18:54:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void restore_init(struct restore_opts *opts);
|
2014-09-14 21:41:49 +00:00
|
|
|
void restore_finish(void);
|
2016-07-26 08:44:44 +00:00
|
|
|
void add_exclude(const char *directory);
|
2022-05-03 08:23:26 +00:00
|
|
|
int process_glob(char *name, struct restore_opts *opts, size_t nthreads,
|
|
|
|
long unsigned *skipped_errors);
|
2016-09-26 15:30:30 +00:00
|
|
|
extern char **exclude_list;
|
2009-09-10 18:54:35 +00:00
|
|
|
|
|
|
|
#endif
|