File: db_line.h

package info (click to toggle)
aide 0.19.2-3exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,528 kB
  • sloc: ansic: 12,399; sh: 6,718; lex: 635; makefile: 139; yacc: 138
file content (101 lines) | stat: -rw-r--r-- 2,219 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
 * AIDE (Advanced Intrusion Detection Environment)
 *
 * Copyright (C) 1999-2002, 2004-2006, 2010, 2013, 2019-2022, 2024, 2025
 *               Rami Lehti, Pablo Virolainen, Richard van den Berg,
 *               Hannes von Haugwitz
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef _DB_LINE_H_INCLUDED
#define _DB_LINE_H_INCLUDED

#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
#include "config.h"
#include "attributes.h"
#ifdef HAVE_FSTYPE
#include "file.h"
#endif
#include "hashsum.h"
#include "util.h"

#ifdef WITH_POSIX_ACL
typedef struct acl_type {
 char *acl_a; /* ACCESS */
 char *acl_d; /* DEFAULT, directories only */
} acl_type;
#endif

#ifdef WITH_XATTR
typedef struct xattr_node
{
 char *key;
 byte *val;
 size_t vsz;
} xattr_node;

typedef struct xattrs_type
{
  size_t num;
  size_t sz;
  struct xattr_node *ents;
} xattrs_type;
#endif

typedef struct db_line {
  byte* hashsums[num_hashes];

#ifdef WITH_POSIX_ACL
  acl_type* acl;
#endif

  mode_t perm;
  mode_t perm_o; /* Permission for tree traverse */
#ifdef HAVE_FSTYPE
  FS_TYPE fs_type;
#endif
  long uid; /* uid_t */
  long gid; /* gid_t */
  time_t atime;
  time_t ctime;
  time_t mtime;
  long inode; /* ino_t */
  long nlink; /* nlink_t */

  long long size; /* off_t */
  long long bcount; /* blkcnt_t */
  char* filename;
  char* fullpath;
  char* linkname;

  char *cntx;

#ifdef WITH_XATTR
  xattrs_type* xattrs;
#endif

  unsigned long e2fsattrs;

  char* capabilities;

  /* Attributes .... */
  DB_ATTR_TYPE attr;

} db_line;

#endif