1 | #include <moira_schema.h> |
---|
2 | |
---|
3 | /* for MAXPATHLEN */ |
---|
4 | #include <sys/param.h> |
---|
5 | |
---|
6 | #include <stdio.h> |
---|
7 | |
---|
8 | void fix_file(char *targetfile); |
---|
9 | char *dequote(char *s); |
---|
10 | void db_error(int code); |
---|
11 | |
---|
12 | time_t unixtime(char *timestring); |
---|
13 | #define UNIXTIME_FMT "J HH24 MI SS" |
---|
14 | |
---|
15 | struct tarheader { |
---|
16 | char name[100]; |
---|
17 | char mode[8]; |
---|
18 | char uid[8]; |
---|
19 | char gid[8]; |
---|
20 | char size[12]; |
---|
21 | char mtime[12]; |
---|
22 | char chksum[8]; |
---|
23 | char typeflag[1]; |
---|
24 | char linkname[100]; |
---|
25 | char magic[6]; |
---|
26 | char version[2]; |
---|
27 | char uname[32]; |
---|
28 | char gname[32]; |
---|
29 | char devmajor[8]; |
---|
30 | char devminor[8]; |
---|
31 | char prefix[155]; |
---|
32 | char pad[12]; |
---|
33 | }; |
---|
34 | |
---|
35 | typedef struct _tarfile { |
---|
36 | FILE *fp; |
---|
37 | struct tarheader th; |
---|
38 | long offset; |
---|
39 | } TARFILE; |
---|
40 | |
---|
41 | TARFILE *tarfile_open(char *file); |
---|
42 | void tarfile_close(TARFILE *tf); |
---|
43 | FILE *tarfile_start(TARFILE *tf, char *name, mode_t mode, uid_t uid, gid_t gid, |
---|
44 | char *user, char *group, time_t mtime); |
---|
45 | void tarfile_end(TARFILE *tf); |
---|
46 | void tarfile_mkdir(TARFILE *tf, char *name, mode_t mode, uid_t uid, gid_t gid, |
---|
47 | char *user, char *group, time_t mtime); |
---|
48 | |
---|
49 | struct imember { |
---|
50 | char type; |
---|
51 | char *name, *tag; |
---|
52 | }; |
---|
53 | void freeimember(struct imember *m); |
---|
54 | |
---|
55 | void init_acls(void); |
---|
56 | void canon_krb(struct imember *m, int vers, char *buf, int len); |
---|
57 | struct save_queue *get_acl(char *type, int id, |
---|
58 | char *(merge_func)(char *, char *)); |
---|
59 | void dump_krb_acl(FILE *out, char *type, int id, int vers); |
---|
60 | void dump_user_list(FILE *out, char *type, int id); |
---|
61 | char *user_lookup(int users_id); |
---|
62 | char *string_lookup(int string_id); |
---|