Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/sys
File: capability.h
/*
[0] Fix | Delete
* <sys/capability.h>
[1] Fix | Delete
*
[2] Fix | Delete
* Copyright (C) 1997 Aleph One
[3] Fix | Delete
* Copyright (C) 1997,8, 2008,19,20 Andrew G. Morgan <morgan@kernel.org>
[4] Fix | Delete
*
[5] Fix | Delete
* defunct POSIX.1e Standard: 25.2 Capabilities <sys/capability.h>
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
#ifndef _SYS_CAPABILITY_H
[9] Fix | Delete
#define _SYS_CAPABILITY_H
[10] Fix | Delete
[11] Fix | Delete
#ifdef __cplusplus
[12] Fix | Delete
extern "C" {
[13] Fix | Delete
#endif
[14] Fix | Delete
[15] Fix | Delete
/*
[16] Fix | Delete
* This file complements the kernel file by providing prototype
[17] Fix | Delete
* information for the user library.
[18] Fix | Delete
*/
[19] Fix | Delete
[20] Fix | Delete
#include <sys/types.h>
[21] Fix | Delete
#include <stdint.h>
[22] Fix | Delete
#include <linux/types.h>
[23] Fix | Delete
[24] Fix | Delete
#ifndef __user
[25] Fix | Delete
#define __user
[26] Fix | Delete
#endif
[27] Fix | Delete
#include <linux/capability.h>
[28] Fix | Delete
[29] Fix | Delete
/*
[30] Fix | Delete
* POSIX capability types
[31] Fix | Delete
*/
[32] Fix | Delete
[33] Fix | Delete
/*
[34] Fix | Delete
* Opaque capability handle (defined internally by libcap)
[35] Fix | Delete
* internal capability representation
[36] Fix | Delete
*/
[37] Fix | Delete
typedef struct _cap_struct *cap_t;
[38] Fix | Delete
[39] Fix | Delete
/* "external" capability representation is a (void *) */
[40] Fix | Delete
[41] Fix | Delete
/*
[42] Fix | Delete
* This is the type used to identify capabilities
[43] Fix | Delete
*/
[44] Fix | Delete
[45] Fix | Delete
typedef int cap_value_t;
[46] Fix | Delete
[47] Fix | Delete
/*
[48] Fix | Delete
* libcap initialized first unnamed capability of the running kernel.
[49] Fix | Delete
* capsh includes a runtime test to flag when this is larger than
[50] Fix | Delete
* what is known to libcap... Time for a new libcap release!
[51] Fix | Delete
*/
[52] Fix | Delete
extern cap_value_t cap_max_bits(void);
[53] Fix | Delete
[54] Fix | Delete
/*
[55] Fix | Delete
* Set identifiers
[56] Fix | Delete
*/
[57] Fix | Delete
typedef enum {
[58] Fix | Delete
CAP_EFFECTIVE = 0, /* Specifies the effective flag */
[59] Fix | Delete
CAP_PERMITTED = 1, /* Specifies the permitted flag */
[60] Fix | Delete
CAP_INHERITABLE = 2 /* Specifies the inheritable flag */
[61] Fix | Delete
} cap_flag_t;
[62] Fix | Delete
[63] Fix | Delete
typedef enum {
[64] Fix | Delete
CAP_IAB_INH = 2,
[65] Fix | Delete
CAP_IAB_AMB = 3,
[66] Fix | Delete
CAP_IAB_BOUND = 4
[67] Fix | Delete
} cap_iab_vector_t;
[68] Fix | Delete
[69] Fix | Delete
/*
[70] Fix | Delete
* An opaque generalization of the inheritable bits that includes both
[71] Fix | Delete
* what ambient bits to raise and what bounding bits to *lower* (aka
[72] Fix | Delete
* drop). None of these bits once set, using cap_iab_set(), affect
[73] Fix | Delete
* the running process but are consulted, through the execve() system
[74] Fix | Delete
* call, by the kernel. Note, the ambient bits ('A') of the running
[75] Fix | Delete
* process are fragile with respect to other aspects of the "posix"
[76] Fix | Delete
* (cap_t) operations: most importantly, 'A' cannot ever hold bits not
[77] Fix | Delete
* present in the intersection of 'pI' and 'pP'. The kernel
[78] Fix | Delete
* immediately drops all ambient caps whenever such a situation
[79] Fix | Delete
* arises. Typically, the ambient bits are used to support a naive
[80] Fix | Delete
* capability inheritance model - at odds with the POSIX (sic) model
[81] Fix | Delete
* of inheritance where inherited (pI) capabilities need to also be
[82] Fix | Delete
* wanted by the executed binary (fI) in order to become raised
[83] Fix | Delete
* through exec.
[84] Fix | Delete
*/
[85] Fix | Delete
typedef struct cap_iab_s *cap_iab_t;
[86] Fix | Delete
[87] Fix | Delete
/*
[88] Fix | Delete
* These are the states available to each capability
[89] Fix | Delete
*/
[90] Fix | Delete
typedef enum {
[91] Fix | Delete
CAP_CLEAR=0, /* The flag is cleared/disabled */
[92] Fix | Delete
CAP_SET=1 /* The flag is set/enabled */
[93] Fix | Delete
} cap_flag_value_t;
[94] Fix | Delete
[95] Fix | Delete
/*
[96] Fix | Delete
* User-space capability manipulation routines
[97] Fix | Delete
*/
[98] Fix | Delete
typedef unsigned cap_mode_t;
[99] Fix | Delete
#define CAP_MODE_UNCERTAIN ((cap_mode_t) 0)
[100] Fix | Delete
#define CAP_MODE_NOPRIV ((cap_mode_t) 1)
[101] Fix | Delete
#define CAP_MODE_PURE1E_INIT ((cap_mode_t) 2)
[102] Fix | Delete
#define CAP_MODE_PURE1E ((cap_mode_t) 3)
[103] Fix | Delete
[104] Fix | Delete
/* libcap/cap_alloc.c */
[105] Fix | Delete
extern cap_t cap_dup(cap_t);
[106] Fix | Delete
extern int cap_free(void *);
[107] Fix | Delete
extern cap_t cap_init(void);
[108] Fix | Delete
extern cap_iab_t cap_iab_init(void);
[109] Fix | Delete
[110] Fix | Delete
/* libcap/cap_flag.c */
[111] Fix | Delete
extern int cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
[112] Fix | Delete
extern int cap_set_flag(cap_t, cap_flag_t, int, const cap_value_t *,
[113] Fix | Delete
cap_flag_value_t);
[114] Fix | Delete
extern int cap_clear(cap_t);
[115] Fix | Delete
extern int cap_clear_flag(cap_t, cap_flag_t);
[116] Fix | Delete
[117] Fix | Delete
extern cap_flag_value_t cap_iab_get_vector(cap_iab_t, cap_iab_vector_t,
[118] Fix | Delete
cap_value_t);
[119] Fix | Delete
extern int cap_iab_set_vector(cap_iab_t, cap_iab_vector_t, cap_value_t,
[120] Fix | Delete
cap_flag_value_t);
[121] Fix | Delete
extern int cap_iab_fill(cap_iab_t, cap_iab_vector_t, cap_t, cap_flag_t);
[122] Fix | Delete
[123] Fix | Delete
/* libcap/cap_file.c */
[124] Fix | Delete
extern cap_t cap_get_fd(int);
[125] Fix | Delete
extern cap_t cap_get_file(const char *);
[126] Fix | Delete
extern uid_t cap_get_nsowner(cap_t);
[127] Fix | Delete
extern int cap_set_fd(int, cap_t);
[128] Fix | Delete
extern int cap_set_file(const char *, cap_t);
[129] Fix | Delete
extern int cap_set_nsowner(cap_t, uid_t);
[130] Fix | Delete
[131] Fix | Delete
/* libcap/cap_proc.c */
[132] Fix | Delete
extern cap_t cap_get_proc(void);
[133] Fix | Delete
extern cap_t cap_get_pid(pid_t);
[134] Fix | Delete
extern int cap_set_proc(cap_t);
[135] Fix | Delete
[136] Fix | Delete
extern int cap_get_bound(cap_value_t);
[137] Fix | Delete
extern int cap_drop_bound(cap_value_t);
[138] Fix | Delete
#define CAP_IS_SUPPORTED(cap) (cap_get_bound(cap) >= 0)
[139] Fix | Delete
[140] Fix | Delete
extern int cap_get_ambient(cap_value_t);
[141] Fix | Delete
extern int cap_set_ambient(cap_value_t, cap_flag_value_t);
[142] Fix | Delete
extern int cap_reset_ambient(void);
[143] Fix | Delete
#define CAP_AMBIENT_SUPPORTED() (cap_get_ambient(CAP_CHOWN) >= 0)
[144] Fix | Delete
[145] Fix | Delete
/* libcap/cap_extint.c */
[146] Fix | Delete
extern ssize_t cap_size(cap_t);
[147] Fix | Delete
extern ssize_t cap_copy_ext(void *, cap_t, ssize_t);
[148] Fix | Delete
extern cap_t cap_copy_int(const void *);
[149] Fix | Delete
[150] Fix | Delete
/* libcap/cap_text.c */
[151] Fix | Delete
extern cap_t cap_from_text(const char *);
[152] Fix | Delete
extern char * cap_to_text(cap_t, ssize_t *);
[153] Fix | Delete
extern int cap_from_name(const char *, cap_value_t *);
[154] Fix | Delete
extern char * cap_to_name(cap_value_t);
[155] Fix | Delete
[156] Fix | Delete
extern char * cap_iab_to_text(cap_iab_t iab);
[157] Fix | Delete
extern cap_iab_t cap_iab_from_text(const char *text);
[158] Fix | Delete
[159] Fix | Delete
#define CAP_DIFFERS(result, flag) (((result) & (1 << (flag))) != 0)
[160] Fix | Delete
extern int cap_compare(cap_t, cap_t);
[161] Fix | Delete
[162] Fix | Delete
/* libcap/cap_proc.c */
[163] Fix | Delete
extern void cap_set_syscall(long int (*new_syscall)(long int,
[164] Fix | Delete
long int, long int, long int),
[165] Fix | Delete
long int (*new_syscall6)(long int,
[166] Fix | Delete
long int, long int, long int,
[167] Fix | Delete
long int, long int, long int));
[168] Fix | Delete
[169] Fix | Delete
extern int cap_set_mode(cap_mode_t flavor);
[170] Fix | Delete
extern cap_mode_t cap_get_mode(void);
[171] Fix | Delete
extern const char *cap_mode_name(cap_mode_t flavor);
[172] Fix | Delete
[173] Fix | Delete
extern unsigned cap_get_secbits(void);
[174] Fix | Delete
extern int cap_set_secbits(unsigned bits);
[175] Fix | Delete
[176] Fix | Delete
extern int cap_prctl(long int pr_cmd, long int arg1, long int arg2,
[177] Fix | Delete
long int arg3, long int arg4, long int arg5);
[178] Fix | Delete
extern int cap_prctlw(long int pr_cmd, long int arg1, long int arg2,
[179] Fix | Delete
long int arg3, long int arg4, long int arg5);
[180] Fix | Delete
[181] Fix | Delete
extern int cap_setuid(uid_t uid);
[182] Fix | Delete
extern int cap_setgroups(gid_t gid, size_t ngroups, const gid_t groups[]);
[183] Fix | Delete
[184] Fix | Delete
extern cap_iab_t cap_iab_get_proc(void);
[185] Fix | Delete
extern int cap_iab_set_proc(cap_iab_t iab);
[186] Fix | Delete
[187] Fix | Delete
typedef struct cap_launch_s *cap_launch_t;
[188] Fix | Delete
[189] Fix | Delete
extern cap_launch_t cap_new_launcher(const char *arg0, const char * const *argv,
[190] Fix | Delete
const char * const *envp);
[191] Fix | Delete
extern void cap_launcher_callback(cap_launch_t attr,
[192] Fix | Delete
int (callback_fn)(void *detail));
[193] Fix | Delete
extern void cap_launcher_setuid(cap_launch_t attr, uid_t uid);
[194] Fix | Delete
extern void cap_launcher_setgroups(cap_launch_t attr, gid_t gid,
[195] Fix | Delete
int ngroups, const gid_t *groups);
[196] Fix | Delete
extern void cap_launcher_set_mode(cap_launch_t attr, cap_mode_t flavor);
[197] Fix | Delete
extern cap_iab_t cap_launcher_set_iab(cap_launch_t attr, cap_iab_t iab);
[198] Fix | Delete
extern void cap_launcher_set_chroot(cap_launch_t attr, const char *chroot);
[199] Fix | Delete
extern pid_t cap_launch(cap_launch_t attr, void *data);
[200] Fix | Delete
[201] Fix | Delete
/*
[202] Fix | Delete
* system calls - look to libc for function to system call
[203] Fix | Delete
* mapping. Note, libcap does not use capset directly, but permits the
[204] Fix | Delete
* cap_set_syscall() to redirect the system call function.
[205] Fix | Delete
*/
[206] Fix | Delete
extern int capget(cap_user_header_t header, cap_user_data_t data);
[207] Fix | Delete
extern int capset(cap_user_header_t header, const cap_user_data_t data);
[208] Fix | Delete
[209] Fix | Delete
/* deprecated - use cap_get_pid() */
[210] Fix | Delete
extern int capgetp(pid_t pid, cap_t cap_d);
[211] Fix | Delete
[212] Fix | Delete
/* not valid with filesystem capability support - use cap_set_proc() */
[213] Fix | Delete
extern int capsetp(pid_t pid, cap_t cap_d);
[214] Fix | Delete
[215] Fix | Delete
#ifdef __cplusplus
[216] Fix | Delete
}
[217] Fix | Delete
#endif
[218] Fix | Delete
[219] Fix | Delete
#endif /* _SYS_CAPABILITY_H */
[220] Fix | Delete
[221] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function