source: trunk/include/sh_hash.h@ 131

Last change on this file since 131 was 115, checked in by rainer, 17 years ago

Fix the problem that new suid/sgid file found by the file system check already will not be quarantined in the suid check (ticket #71).

File size: 4.2 KB
RevLine 
[1]1/* SAMHAIN file system integrity testing */
2/* Copyright (C) 1999 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
21#ifndef SH_HASH_H
22#define SH_HASH_H
23
24#include <limits.h>
25
26#include "samhain.h"
27#include "sh_unix.h"
28#include "sh_error.h"
29
30/* format a uint64
31 */
32char * sh_hash_size_format();
33
34/* report on a missing file
35 */
36int hashreport_missing( char *fullpath, int level);
37
38/* write database to stdout
39 */
[20]40int sh_hash_pushdata_stdout (const char * str);
[1]41
42/* version string for database
43 */
[22]44int sh_hash_version_string(const char * str);
[1]45
46/* List database content
47 */
[20]48int sh_hash_list_db (const char * db_file);
[1]49
50/* List database content with full detail
51 */
[20]52int set_full_detail (const char * c);
[1]53
54/* List database content with full detail, comma delimited
55 */
[20]56int set_list_delimited (const char * c);
[1]57
58/* Read the database from disk.
59 */
60void sh_hash_init (void);
61
62/* Check whether a file is present in the database.
63 */
64int sh_hash_have_it (char * newname);
65
66/* Get a file if it is present in the database.
67 */
68int sh_hash_get_it (char * newname, file_type * tmpFile);
69
70/* Delete the database from memory.
71 */
72void sh_hash_hashdelete (void);
73
74/* Insert a file into the database.
75 */
76void sh_hash_pushdata (file_type * buf, char * fileHash);
77
78/* reset sh_hash_pushdata to use 'update' in daemon mode
79 */
80void sh_hash_pushdata_reset ();
81
82/* Insert a file into the in-memory database.
83 */
84void sh_hash_pushdata_memory (file_type * theFile, char * fileHash);
85
[115]86/* Get file flags from in-memory database
87 */
88int sh_hash_getflags (char * filename);
89
90/* Set file flags in in-memory database
91 */
92int sh_hash_setflags (char * filename, int flags);
93
94/* Set a file flag in in-memory database
95 */
96void sh_hash_addflag (char * filename, int flag);
97
[1]98/* Compare a file with its status in the database.
99 */
100int sh_hash_compdata (int class, file_type * theFile, char * fileHash,
101 char * policy_override, int severity_override);
102
103/* Search for files in the database that have been deleted from disk.
104 */
105void sh_hash_unvisited (ShErrLevel level);
106
107/* Set a file's status to 'visited'. This is required for
108 * files that should be ignored, and may be present in the
109 * database, but not on disk.
110 */
111int sh_hash_set_visited (char * newname);
112
113/* As above, but only set the 'visited' flag
114 */
115int sh_hash_set_visited_true (char * newname);
116
117/* cause the record to be deleted without a 'missing' message
118 */
119int sh_hash_set_missing (char * newname);
120
121/* Make a complete directory tree invisible
122 */
123int hash_remove_tree (char * s);
124
125/* Make every entry visible
126 */
127int hash_full_tree (void);
128
129/* Insert data
130 */
131void sh_hash_push2db (char * key, unsigned long val1,
132 unsigned long val2, unsigned long val3,
133 unsigned char * str, int size);
134
135/* Retrieve data
136 */
137char * sh_hash_db2pop (char * key, unsigned long * val1,
138 unsigned long * val2, unsigned long * val3,
139 int * size);
140
141/* Write out database
142 */
143int sh_hash_writeout();
144#endif
Note: See TracBrowser for help on using the repository browser.