restore.h revision 2a1933d830aae615001e05fd5ca11a6fe0159f9d
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 <stdlib.h> 16#include <limits.h> 17 18#define STAR_COUNT 1000 19 20/* Things that need to be init'd */ 21struct restore_opts { 22 int add_assoc; /* Track inode associations for conflict detection. */ 23 int progress; 24 unsigned long long count; 25 int debug; 26 int change; 27 int hard_links; 28 int verbose; 29 int logging; 30 char *rootpath; 31 int rootpathlen; 32 char *progname; 33 FILE *outfile; 34 int force; 35 struct selabel_handle *hnd; 36 int expand_realpath; /* Expand paths via realpath. */ 37 int abort_on_error; /* Abort the file tree walk upon an error. */ 38 int quiet; 39 int fts_flags; /* Flags to fts, e.g. follow links, follow mounts */ 40 const char *selabel_opt_validate; 41 const char *selabel_opt_path; 42}; 43 44void restore_init(struct restore_opts *opts); 45void restore_finish(); 46int add_exclude(const char *directory); 47void remove_exclude(const char *directory); 48int process_one_realpath(char *name, int recurse); 49 50#endif 51