~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to module-deprecated/capabilities.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *      Copyright (C) 2005 Novell/SUSE
3
 
 *
4
 
 *      This program is free software; you can redistribute it and/or
5
 
 *      modify it under the terms of the GNU General Public License as
6
 
 *      published by the Free Software Foundation, version 2 of the
7
 
 *      License.
8
 
 *
9
 
 *      AppArmor capability definitions
10
 
 */
11
 
 
12
 
#include "apparmor.h"
13
 
 
14
 
static const char *capnames[] = {
15
 
        "chown",
16
 
        "dac_override",
17
 
        "dac_read_search",
18
 
        "fowner",
19
 
        "fsetid",
20
 
        "kill",
21
 
        "setgid",
22
 
        "setuid",
23
 
        "setpcap",
24
 
        "linux_immutable",
25
 
        "net_bind_service",
26
 
        "net_broadcast",
27
 
        "net_admin",
28
 
        "net_raw",
29
 
        "ipc_lock",
30
 
        "ipc_owner",
31
 
        "sys_module",
32
 
        "sys_rawio",
33
 
        "sys_chroot",
34
 
        "sys_ptrace",
35
 
        "sys_pacct",
36
 
        "sys_admin",
37
 
        "sys_boot",
38
 
        "sys_nice",
39
 
        "sys_resource",
40
 
        "sys_time",
41
 
        "sys_tty_config",
42
 
        "mknod",
43
 
        "lease",
44
 
        "audit_write",
45
 
        "audit_control"
46
 
};
47
 
 
48
 
const char *capability_to_name(unsigned int cap)
49
 
{
50
 
        const char *capname;
51
 
 
52
 
        capname = (cap < (sizeof(capnames) / sizeof(char *))
53
 
                   ? capnames[cap] : "invalid-capability");
54
 
 
55
 
        return capname;
56
 
}
57
 
 
58
 
static const char *syscall_names[] = {
59
 
        "ptrace",
60
 
        "sysctl (write)",
61
 
        "mount",
62
 
        "umount"
63
 
};
64
 
 
65
 
const char *syscall_to_name(enum aasyscall call)
66
 
{
67
 
        const char *name;
68
 
        name = (call < (sizeof(syscall_names) / sizeof(char *))
69
 
                ? syscall_names[call] : "invalid-syscall");
70
 
        return name;
71
 
}