[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);
|
---|
[415] | 24 | void sh_audit_commit ();
|
---|
[294] | 25 | void sh_audit_delete_all ();
|
---|
| 26 | char * sh_audit_fetch (char * file, time_t time, char * result, size_t rsize);
|
---|
| 27 |
|
---|
[131] | 28 | struct sh_dirent {
|
---|
| 29 | char * sh_d_name;
|
---|
| 30 | struct sh_dirent * next;
|
---|
| 31 | };
|
---|
| 32 |
|
---|
[294] | 33 |
|
---|
[131] | 34 | /* free a directory listing
|
---|
| 35 | */
|
---|
| 36 | void kill_sh_dirlist (struct sh_dirent * dirlist);
|
---|
| 37 |
|
---|
[138] | 38 | #ifdef NEED_ADD_DIRENT
|
---|
[131] | 39 | /* add an entry to a directory listing
|
---|
| 40 | */
|
---|
| 41 | struct sh_dirent * addto_sh_dirlist (struct dirent * thisEntry,
|
---|
| 42 | struct sh_dirent * dirlist);
|
---|
[138] | 43 | #endif
|
---|
| 44 |
|
---|
[1] | 45 | /* register exceptions to hardlink check
|
---|
| 46 | */
|
---|
[22] | 47 | int sh_files_hle_reg (const char * str);
|
---|
[1] | 48 |
|
---|
[371] | 49 | /* Check for new files/dirs matching configured glob patterns.
|
---|
[256] | 50 | */
|
---|
| 51 | void sh_files_check_globPatterns();
|
---|
| 52 |
|
---|
[371] | 53 | /* Check for new files (only) matching configured glob patterns.
|
---|
| 54 | */
|
---|
| 55 | void sh_files_check_globFilePatterns();
|
---|
| 56 |
|
---|
[1] | 57 | /* check the setup
|
---|
| 58 | */
|
---|
| 59 | int sh_files_test_setup (void);
|
---|
| 60 |
|
---|
| 61 | /* check if allignore
|
---|
| 62 | */
|
---|
| 63 | int sh_files_is_allignore (char * str);
|
---|
| 64 |
|
---|
| 65 | /* activate hardlink check
|
---|
| 66 | */
|
---|
[22] | 67 | int sh_files_check_hardlinks (const char * opt);
|
---|
[1] | 68 |
|
---|
[254] | 69 | /* check rsrc fork (Mac OS X)
|
---|
| 70 | */
|
---|
| 71 | int sh_files_use_rsrc(const char * str);
|
---|
| 72 |
|
---|
[1] | 73 | /* set recursion depth
|
---|
| 74 | */
|
---|
| 75 | int sh_files_setrec (void);
|
---|
| 76 |
|
---|
| 77 | /* report only once
|
---|
| 78 | */
|
---|
[22] | 79 | int sh_files_reportonce(const char * c);
|
---|
[1] | 80 |
|
---|
| 81 | /* report full details
|
---|
| 82 | */
|
---|
[22] | 83 | int sh_files_fulldetail(const char * c);
|
---|
[1] | 84 |
|
---|
| 85 | /* reset the 'checked' flag
|
---|
| 86 | */
|
---|
| 87 | void sh_dirs_reset(void);
|
---|
| 88 |
|
---|
| 89 | /* reset the 'checked' flag
|
---|
| 90 | */
|
---|
| 91 | void sh_files_reset(void);
|
---|
| 92 |
|
---|
| 93 | /* set maximum recursion level
|
---|
| 94 | */
|
---|
[20] | 95 | int sh_files_setrecursion (const char * flag_s);
|
---|
[1] | 96 |
|
---|
| 97 | /* select a directory stack 2=Two, else One (standard)
|
---|
| 98 | */
|
---|
| 99 | int set_dirList (int which);
|
---|
| 100 |
|
---|
| 101 | /* push a directory on the stack USER0
|
---|
| 102 | */
|
---|
[22] | 103 | int sh_files_pushdir_user0 (const char * dirName);
|
---|
[1] | 104 |
|
---|
| 105 | /* push a directory on the stack USER1
|
---|
| 106 | */
|
---|
[22] | 107 | int sh_files_pushdir_user1 (const char * dirName);
|
---|
[1] | 108 |
|
---|
[27] | 109 | /* push a directory on the stack USER2
|
---|
| 110 | */
|
---|
| 111 | int sh_files_pushdir_user2 (const char * dirName);
|
---|
| 112 |
|
---|
| 113 | /* push a directory on the stack USER3
|
---|
| 114 | */
|
---|
| 115 | int sh_files_pushdir_user3 (const char * dirName);
|
---|
| 116 |
|
---|
| 117 | /* push a directory on the stack USER4
|
---|
| 118 | */
|
---|
| 119 | int sh_files_pushdir_user4 (const char * dirName);
|
---|
| 120 |
|
---|
[1] | 121 | /* push a directory on the stack PRELINK
|
---|
| 122 | */
|
---|
[22] | 123 | int sh_files_pushdir_prelink (const char * dirName);
|
---|
[1] | 124 |
|
---|
| 125 | /* push a directory on the stack ATTR
|
---|
| 126 | */
|
---|
[22] | 127 | int sh_files_pushdir_attr (const char * dirName);
|
---|
[1] | 128 |
|
---|
| 129 | /* push a directory on the stack READONLY
|
---|
| 130 | */
|
---|
[22] | 131 | int sh_files_pushdir_ro (const char * dirName);
|
---|
[1] | 132 |
|
---|
| 133 | /* push a directory on the stack LOGFILE
|
---|
| 134 | */
|
---|
[22] | 135 | int sh_files_pushdir_log (const char * dirName);
|
---|
[1] | 136 |
|
---|
| 137 | /* push a directory on the stack GROWING LOGFILE
|
---|
| 138 | */
|
---|
[22] | 139 | int sh_files_pushdir_glog (const char * dirName);
|
---|
[1] | 140 |
|
---|
| 141 | /* push a directory on the stack IGNORE NONE
|
---|
| 142 | */
|
---|
[22] | 143 | int sh_files_pushdir_noig (const char * dirName);
|
---|
[1] | 144 |
|
---|
| 145 | /* push a directory on the stack IGNORE ALL
|
---|
| 146 | */
|
---|
[22] | 147 | int sh_files_pushdir_allig (const char * dirName);
|
---|
[1] | 148 |
|
---|
| 149 |
|
---|
| 150 | /* push a file on the stack USER0
|
---|
| 151 | */
|
---|
[22] | 152 | int sh_files_pushfile_user0 (const char * dirName);
|
---|
[1] | 153 |
|
---|
| 154 | /* push a file on the stack USER1
|
---|
| 155 | */
|
---|
[22] | 156 | int sh_files_pushfile_user1 (const char * dirName);
|
---|
[1] | 157 |
|
---|
[27] | 158 | /* push a file on the stack USER2
|
---|
| 159 | */
|
---|
| 160 | int sh_files_pushfile_user2 (const char * dirName);
|
---|
| 161 |
|
---|
| 162 | /* push a file on the stack USER3
|
---|
| 163 | */
|
---|
| 164 | int sh_files_pushfile_user3 (const char * dirName);
|
---|
| 165 |
|
---|
| 166 | /* push a file on the stack USER4
|
---|
| 167 | */
|
---|
| 168 | int sh_files_pushfile_user4 (const char * dirName);
|
---|
| 169 |
|
---|
[1] | 170 | /* push a file on the stack PRELINK
|
---|
| 171 | */
|
---|
[22] | 172 | int sh_files_pushfile_prelink (const char * dirName);
|
---|
[1] | 173 |
|
---|
| 174 | /* push a file on the stack ATTR
|
---|
| 175 | */
|
---|
[22] | 176 | int sh_files_pushfile_attr (const char * dirName);
|
---|
[1] | 177 |
|
---|
| 178 | /* push a file on the stack READONLY
|
---|
| 179 | */
|
---|
[22] | 180 | int sh_files_pushfile_ro (const char * dirName);
|
---|
[1] | 181 |
|
---|
| 182 | /* push a file on the stack LOGFILE
|
---|
| 183 | */
|
---|
[22] | 184 | int sh_files_pushfile_log (const char * dirName);
|
---|
[1] | 185 |
|
---|
| 186 | /* push a file on the stack GROWING LOGFILE
|
---|
| 187 | */
|
---|
[22] | 188 | int sh_files_pushfile_glog (const char * dirName);
|
---|
[1] | 189 |
|
---|
| 190 | /* push a file on the stack IGNORE NONE
|
---|
| 191 | */
|
---|
[22] | 192 | int sh_files_pushfile_noig (const char * dirName);
|
---|
[1] | 193 |
|
---|
| 194 | /* push a file on the stack IGNORE ALL
|
---|
| 195 | */
|
---|
[22] | 196 | int sh_files_pushfile_allig (const char * dirName);
|
---|
[1] | 197 |
|
---|
| 198 |
|
---|
| 199 | /* check directories on the stack
|
---|
| 200 | */
|
---|
| 201 | unsigned long sh_dirs_chk (int which);
|
---|
| 202 |
|
---|
| 203 | /* check files on the stack
|
---|
| 204 | */
|
---|
| 205 | unsigned long sh_files_chk (void);
|
---|
| 206 |
|
---|
[256] | 207 | int sh_files_delglobstack (void);
|
---|
| 208 |
|
---|
[1] | 209 | int sh_files_deldirstack (void);
|
---|
| 210 |
|
---|
| 211 | int sh_files_delfilestack (void);
|
---|
| 212 |
|
---|
| 213 | /* redefine policies
|
---|
| 214 | */
|
---|
[22] | 215 | int sh_files_redef_user0(const char * str);
|
---|
| 216 | int sh_files_redef_user1(const char * str);
|
---|
[27] | 217 | int sh_files_redef_user2(const char * str);
|
---|
| 218 | int sh_files_redef_user3(const char * str);
|
---|
| 219 | int sh_files_redef_user4(const char * str);
|
---|
[22] | 220 | int sh_files_redef_prelink(const char * str);
|
---|
| 221 | int sh_files_redef_readonly(const char * str);
|
---|
| 222 | int sh_files_redef_loggrow(const char * str);
|
---|
| 223 | int sh_files_redef_logfiles(const char * str);
|
---|
| 224 | int sh_files_redef_attributes(const char * str);
|
---|
| 225 | int sh_files_redef_noignore(const char * str);
|
---|
| 226 | int sh_files_redef_allignore(const char * str);
|
---|
[1] | 227 |
|
---|
[367] | 228 | ShFileType sh_files_filecheck (int class, unsigned long check_mask,
|
---|
[373] | 229 | const char * dirName,
|
---|
| 230 | const char * infileName,
|
---|
[367] | 231 | int * reported,
|
---|
| 232 | int rsrcflag);
|
---|
[1] | 233 |
|
---|
[373] | 234 | int sh_files_checkdir (int iclass, unsigned long check_mask,
|
---|
| 235 | int idepth, char * iname,
|
---|
| 236 | char * relativeName);
|
---|
[367] | 237 |
|
---|
[373] | 238 | int sh_files_search_file(char * name, int * class,
|
---|
| 239 | unsigned long *check_mask, int * reported);
|
---|
| 240 | int sh_files_search_dir(char * name, int * class,
|
---|
| 241 | unsigned long *check_mask, int *reported,
|
---|
| 242 | int * rdepth);
|
---|
| 243 | void sh_files_set_file_reported(const char * name);
|
---|
| 244 | void sh_files_clear_file_reported(const char * name);
|
---|
| 245 |
|
---|
[1] | 246 | #endif
|
---|
| 247 |
|
---|
| 248 |
|
---|
| 249 |
|
---|
| 250 |
|
---|