[1] | 1 | /* SAMHAIN file system integrity testing */
|
---|
| 2 | /* Copyright (C) 1999, 2000 Rainer Wichmann */
|
---|
| 3 | /* */
|
---|
| 4 | /* This program is free software; you can redistribute it */
|
---|
| 5 | /* and/or modify */
|
---|
| 6 | /* it under the terms of the GNU General Public License as */
|
---|
| 7 | /* published by */
|
---|
| 8 | /* the Free Software Foundation; either version 2 of the License, or */
|
---|
| 9 | /* (at your option) any later version. */
|
---|
| 10 | /* */
|
---|
| 11 | /* This program is distributed in the hope that it will be useful, */
|
---|
| 12 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
---|
| 13 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
---|
| 14 | /* GNU General Public License for more details. */
|
---|
| 15 | /* */
|
---|
| 16 | /* You should have received a copy of the GNU General Public License */
|
---|
| 17 | /* along with this program; if not, write to the Free Software */
|
---|
| 18 | /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
---|
| 19 |
|
---|
| 20 | #ifndef SH_FILES_H
|
---|
| 21 | #define SH_FILES_H
|
---|
| 22 |
|
---|
[373] | 23 | void sh_audit_mark (const char * file);
|
---|
[294] | 24 | void sh_audit_delete_all ();
|
---|
| 25 | char * sh_audit_fetch (char * file, time_t time, char * result, size_t rsize);
|
---|
| 26 |
|
---|
[131] | 27 | struct sh_dirent {
|
---|
| 28 | char * sh_d_name;
|
---|
| 29 | struct sh_dirent * next;
|
---|
| 30 | };
|
---|
| 31 |
|
---|
[294] | 32 |
|
---|
[131] | 33 | /* free a directory listing
|
---|
| 34 | */
|
---|
| 35 | void kill_sh_dirlist (struct sh_dirent * dirlist);
|
---|
| 36 |
|
---|
[138] | 37 | #ifdef NEED_ADD_DIRENT
|
---|
[131] | 38 | /* add an entry to a directory listing
|
---|
| 39 | */
|
---|
| 40 | struct sh_dirent * addto_sh_dirlist (struct dirent * thisEntry,
|
---|
| 41 | struct sh_dirent * dirlist);
|
---|
[138] | 42 | #endif
|
---|
| 43 |
|
---|
[1] | 44 | /* register exceptions to hardlink check
|
---|
| 45 | */
|
---|
[22] | 46 | int sh_files_hle_reg (const char * str);
|
---|
[1] | 47 |
|
---|
[371] | 48 | /* Check for new files/dirs matching configured glob patterns.
|
---|
[256] | 49 | */
|
---|
| 50 | void sh_files_check_globPatterns();
|
---|
| 51 |
|
---|
[371] | 52 | /* Check for new files (only) matching configured glob patterns.
|
---|
| 53 | */
|
---|
| 54 | void sh_files_check_globFilePatterns();
|
---|
| 55 |
|
---|
[1] | 56 | /* check the setup
|
---|
| 57 | */
|
---|
| 58 | int sh_files_test_setup (void);
|
---|
| 59 |
|
---|
| 60 | /* check if allignore
|
---|
| 61 | */
|
---|
| 62 | int sh_files_is_allignore (char * str);
|
---|
| 63 |
|
---|
| 64 | /* activate hardlink check
|
---|
| 65 | */
|
---|
[22] | 66 | int sh_files_check_hardlinks (const char * opt);
|
---|
[1] | 67 |
|
---|
[254] | 68 | /* check rsrc fork (Mac OS X)
|
---|
| 69 | */
|
---|
| 70 | int sh_files_use_rsrc(const char * str);
|
---|
| 71 |
|
---|
[1] | 72 | /* set recursion depth
|
---|
| 73 | */
|
---|
| 74 | int sh_files_setrec (void);
|
---|
| 75 |
|
---|
| 76 | /* report only once
|
---|
| 77 | */
|
---|
[22] | 78 | int sh_files_reportonce(const char * c);
|
---|
[1] | 79 |
|
---|
| 80 | /* report full details
|
---|
| 81 | */
|
---|
[22] | 82 | int sh_files_fulldetail(const char * c);
|
---|
[1] | 83 |
|
---|
| 84 | /* reset the 'checked' flag
|
---|
| 85 | */
|
---|
| 86 | void sh_dirs_reset(void);
|
---|
| 87 |
|
---|
| 88 | /* reset the 'checked' flag
|
---|
| 89 | */
|
---|
| 90 | void sh_files_reset(void);
|
---|
| 91 |
|
---|
| 92 | /* set maximum recursion level
|
---|
| 93 | */
|
---|
[20] | 94 | int sh_files_setrecursion (const char * flag_s);
|
---|
[1] | 95 |
|
---|
| 96 | /* select a directory stack 2=Two, else One (standard)
|
---|
| 97 | */
|
---|
| 98 | int set_dirList (int which);
|
---|
| 99 |
|
---|
| 100 | /* push a directory on the stack USER0
|
---|
| 101 | */
|
---|
[22] | 102 | int sh_files_pushdir_user0 (const char * dirName);
|
---|
[1] | 103 |
|
---|
| 104 | /* push a directory on the stack USER1
|
---|
| 105 | */
|
---|
[22] | 106 | int sh_files_pushdir_user1 (const char * dirName);
|
---|
[1] | 107 |
|
---|
[27] | 108 | /* push a directory on the stack USER2
|
---|
| 109 | */
|
---|
| 110 | int sh_files_pushdir_user2 (const char * dirName);
|
---|
| 111 |
|
---|
| 112 | /* push a directory on the stack USER3
|
---|
| 113 | */
|
---|
| 114 | int sh_files_pushdir_user3 (const char * dirName);
|
---|
| 115 |
|
---|
| 116 | /* push a directory on the stack USER4
|
---|
| 117 | */
|
---|
| 118 | int sh_files_pushdir_user4 (const char * dirName);
|
---|
| 119 |
|
---|
[1] | 120 | /* push a directory on the stack PRELINK
|
---|
| 121 | */
|
---|
[22] | 122 | int sh_files_pushdir_prelink (const char * dirName);
|
---|
[1] | 123 |
|
---|
| 124 | /* push a directory on the stack ATTR
|
---|
| 125 | */
|
---|
[22] | 126 | int sh_files_pushdir_attr (const char * dirName);
|
---|
[1] | 127 |
|
---|
| 128 | /* push a directory on the stack READONLY
|
---|
| 129 | */
|
---|
[22] | 130 | int sh_files_pushdir_ro (const char * dirName);
|
---|
[1] | 131 |
|
---|
| 132 | /* push a directory on the stack LOGFILE
|
---|
| 133 | */
|
---|
[22] | 134 | int sh_files_pushdir_log (const char * dirName);
|
---|
[1] | 135 |
|
---|
| 136 | /* push a directory on the stack GROWING LOGFILE
|
---|
| 137 | */
|
---|
[22] | 138 | int sh_files_pushdir_glog (const char * dirName);
|
---|
[1] | 139 |
|
---|
| 140 | /* push a directory on the stack IGNORE NONE
|
---|
| 141 | */
|
---|
[22] | 142 | int sh_files_pushdir_noig (const char * dirName);
|
---|
[1] | 143 |
|
---|
| 144 | /* push a directory on the stack IGNORE ALL
|
---|
| 145 | */
|
---|
[22] | 146 | int sh_files_pushdir_allig (const char * dirName);
|
---|
[1] | 147 |
|
---|
| 148 |
|
---|
| 149 | /* push a file on the stack USER0
|
---|
| 150 | */
|
---|
[22] | 151 | int sh_files_pushfile_user0 (const char * dirName);
|
---|
[1] | 152 |
|
---|
| 153 | /* push a file on the stack USER1
|
---|
| 154 | */
|
---|
[22] | 155 | int sh_files_pushfile_user1 (const char * dirName);
|
---|
[1] | 156 |
|
---|
[27] | 157 | /* push a file on the stack USER2
|
---|
| 158 | */
|
---|
| 159 | int sh_files_pushfile_user2 (const char * dirName);
|
---|
| 160 |
|
---|
| 161 | /* push a file on the stack USER3
|
---|
| 162 | */
|
---|
| 163 | int sh_files_pushfile_user3 (const char * dirName);
|
---|
| 164 |
|
---|
| 165 | /* push a file on the stack USER4
|
---|
| 166 | */
|
---|
| 167 | int sh_files_pushfile_user4 (const char * dirName);
|
---|
| 168 |
|
---|
[1] | 169 | /* push a file on the stack PRELINK
|
---|
| 170 | */
|
---|
[22] | 171 | int sh_files_pushfile_prelink (const char * dirName);
|
---|
[1] | 172 |
|
---|
| 173 | /* push a file on the stack ATTR
|
---|
| 174 | */
|
---|
[22] | 175 | int sh_files_pushfile_attr (const char * dirName);
|
---|
[1] | 176 |
|
---|
| 177 | /* push a file on the stack READONLY
|
---|
| 178 | */
|
---|
[22] | 179 | int sh_files_pushfile_ro (const char * dirName);
|
---|
[1] | 180 |
|
---|
| 181 | /* push a file on the stack LOGFILE
|
---|
| 182 | */
|
---|
[22] | 183 | int sh_files_pushfile_log (const char * dirName);
|
---|
[1] | 184 |
|
---|
| 185 | /* push a file on the stack GROWING LOGFILE
|
---|
| 186 | */
|
---|
[22] | 187 | int sh_files_pushfile_glog (const char * dirName);
|
---|
[1] | 188 |
|
---|
| 189 | /* push a file on the stack IGNORE NONE
|
---|
| 190 | */
|
---|
[22] | 191 | int sh_files_pushfile_noig (const char * dirName);
|
---|
[1] | 192 |
|
---|
| 193 | /* push a file on the stack IGNORE ALL
|
---|
| 194 | */
|
---|
[22] | 195 | int sh_files_pushfile_allig (const char * dirName);
|
---|
[1] | 196 |
|
---|
| 197 |
|
---|
| 198 | /* check directories on the stack
|
---|
| 199 | */
|
---|
| 200 | unsigned long sh_dirs_chk (int which);
|
---|
| 201 |
|
---|
| 202 | /* check files on the stack
|
---|
| 203 | */
|
---|
| 204 | unsigned long sh_files_chk (void);
|
---|
| 205 |
|
---|
[256] | 206 | int sh_files_delglobstack (void);
|
---|
| 207 |
|
---|
[1] | 208 | int sh_files_deldirstack (void);
|
---|
| 209 |
|
---|
| 210 | int sh_files_delfilestack (void);
|
---|
| 211 |
|
---|
| 212 | /* redefine policies
|
---|
| 213 | */
|
---|
[22] | 214 | int sh_files_redef_user0(const char * str);
|
---|
| 215 | int sh_files_redef_user1(const char * str);
|
---|
[27] | 216 | int sh_files_redef_user2(const char * str);
|
---|
| 217 | int sh_files_redef_user3(const char * str);
|
---|
| 218 | int sh_files_redef_user4(const char * str);
|
---|
[22] | 219 | int sh_files_redef_prelink(const char * str);
|
---|
| 220 | int sh_files_redef_readonly(const char * str);
|
---|
| 221 | int sh_files_redef_loggrow(const char * str);
|
---|
| 222 | int sh_files_redef_logfiles(const char * str);
|
---|
| 223 | int sh_files_redef_attributes(const char * str);
|
---|
| 224 | int sh_files_redef_noignore(const char * str);
|
---|
| 225 | int sh_files_redef_allignore(const char * str);
|
---|
[1] | 226 |
|
---|
[367] | 227 | ShFileType sh_files_filecheck (int class, unsigned long check_mask,
|
---|
[373] | 228 | const char * dirName,
|
---|
| 229 | const char * infileName,
|
---|
[367] | 230 | int * reported,
|
---|
| 231 | int rsrcflag);
|
---|
[1] | 232 |
|
---|
[373] | 233 | int sh_files_checkdir (int iclass, unsigned long check_mask,
|
---|
| 234 | int idepth, char * iname,
|
---|
| 235 | char * relativeName);
|
---|
[367] | 236 |
|
---|
[373] | 237 | int sh_files_search_file(char * name, int * class,
|
---|
| 238 | unsigned long *check_mask, int * reported);
|
---|
| 239 | int sh_files_search_dir(char * name, int * class,
|
---|
| 240 | unsigned long *check_mask, int *reported,
|
---|
| 241 | int * rdepth);
|
---|
| 242 | void sh_files_set_file_reported(const char * name);
|
---|
| 243 | void sh_files_clear_file_reported(const char * name);
|
---|
| 244 |
|
---|
[1] | 245 | #endif
|
---|
| 246 |
|
---|
| 247 |
|
---|
| 248 |
|
---|
| 249 |
|
---|