source: branches/samba-3.2.x/source/lib/audit.c@ 198

Last change on this file since 198 was 133, checked in by Paul Smedley, 18 years ago

Update trunk to 3.2.0pre3

File size: 4.2 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 Auditing helper functions.
4 Copyright (C) Guenther Deschner 2006
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 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, see <http://www.gnu.org/licenses/>.
18*/
19
20#include "includes.h"
21
22static const struct audit_category_tab {
23 uint32 category;
24 const char *category_str;
25 const char *param_str;
26 const char *description;
27} audit_category_tab [] = {
28 { LSA_AUDIT_CATEGORY_LOGON,
29 "LSA_AUDIT_CATEGORY_LOGON",
30 "LOGON", "Logon events" },
31 { LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS,
32 "LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS",
33 "PRIVILEGE", "Privilege Use" },
34 { LSA_AUDIT_CATEGORY_SYSTEM,
35 "LSA_AUDIT_CATEGORY_SYSTEM",
36 "SYSTEM", "System Events" },
37 { LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES,
38 "LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES",
39 "POLICY", "Policy Change" },
40 { LSA_AUDIT_CATEGORY_PROCCESS_TRACKING,
41 "LSA_AUDIT_CATEGORY_PROCCESS_TRACKING",
42 "PROCESS", "Process Tracking" },
43 { LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS,
44 "LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS",
45 "OBJECT", "Object Access" },
46 { LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT,
47 "LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT",
48 "SAM", "Account Management" },
49 { LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS,
50 "LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS",
51 "DIRECTORY", "Directory service access" },
52 { LSA_AUDIT_CATEGORY_ACCOUNT_LOGON,
53 "LSA_AUDIT_CATEGORY_ACCOUNT_LOGON",
54 "ACCOUNT", "Account logon events" },
55 { 0, NULL, NULL }
56};
57
58const char *audit_category_str(uint32 category)
59{
60 int i;
61 for (i=0; audit_category_tab[i].category_str; i++) {
62 if (category == audit_category_tab[i].category) {
63 return audit_category_tab[i].category_str;
64 }
65 }
66 return NULL;
67}