File: privilege.h

package info (click to toggle)
systemtap 5.1-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 47,964 kB
  • sloc: cpp: 80,838; ansic: 54,757; xml: 49,725; exp: 43,665; sh: 11,527; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (37 lines) | stat: -rw-r--r-- 1,266 bytes parent folder | download | duplicates (8)
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
#ifndef PRIVILEGE_H
#define PRIVILEGE_H

typedef enum privilege_t {
  // NOTE:
  //   - Values must be a power of 2 between 0x1 and 0x80000000 inclusive, since they will be used
  //     to form a bit set.
  //   - These values cannot change in the future because they will be encoded into the generated
  //     modules in order to identify their required privilege level now and in the future.
  pr_none    = 0x00000000,  // No privileges
  pr_unknown = 0x00000001,  // Unknown privileges
  pr_stapusr = 0x00000002,  // Member of stapusr
  pr_stapsys = 0x00000004,  // Member of stapsys
  pr_stapdev = 0x00000008,  // Member of stapdev

  // Predefined sets
  pr_highest = pr_stapdev,
  pr_unprivileged = pr_stapusr,
  pr_privileged = pr_stapsys | pr_stapdev,
  pr_all = pr_stapusr | pr_stapsys | pr_stapdev
} privilege_t;

// Name of the section in the module used to store privilege information.
#define STAP_PRIVILEGE_SECTION ".stap_privilege"

// Privilege management.
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
const char *pr_name (privilege_t p);
int pr_contains (privilege_t actual, privilege_t required);
privilege_t get_privilege_credentials (void);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif

#endif // PRIVILEGE_H