Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/sepol
File: policydb.h
#ifndef _SEPOL_POLICYDB_H_
[0] Fix | Delete
#define _SEPOL_POLICYDB_H_
[1] Fix | Delete
[2] Fix | Delete
#include <stddef.h>
[3] Fix | Delete
#include <stdio.h>
[4] Fix | Delete
[5] Fix | Delete
#include <sepol/handle.h>
[6] Fix | Delete
[7] Fix | Delete
#ifdef __cplusplus
[8] Fix | Delete
extern "C" {
[9] Fix | Delete
#endif
[10] Fix | Delete
[11] Fix | Delete
struct sepol_policy_file;
[12] Fix | Delete
typedef struct sepol_policy_file sepol_policy_file_t;
[13] Fix | Delete
[14] Fix | Delete
struct sepol_policydb;
[15] Fix | Delete
typedef struct sepol_policydb sepol_policydb_t;
[16] Fix | Delete
[17] Fix | Delete
/* Policy file public interfaces. */
[18] Fix | Delete
[19] Fix | Delete
/* Create and free memory associated with a policy file. */
[20] Fix | Delete
extern int sepol_policy_file_create(sepol_policy_file_t ** pf);
[21] Fix | Delete
extern void sepol_policy_file_free(sepol_policy_file_t * pf);
[22] Fix | Delete
[23] Fix | Delete
/*
[24] Fix | Delete
* Set the policy file to represent a binary policy memory image.
[25] Fix | Delete
* Subsequent operations using the policy file will read and write
[26] Fix | Delete
* the image located at the specified address with the specified length.
[27] Fix | Delete
* If 'len' is 0, then merely compute the necessary length upon
[28] Fix | Delete
* subsequent policydb write operations in order to determine the
[29] Fix | Delete
* necessary buffer size to allocate.
[30] Fix | Delete
*/
[31] Fix | Delete
extern void sepol_policy_file_set_mem(sepol_policy_file_t * pf,
[32] Fix | Delete
char *data, size_t len);
[33] Fix | Delete
[34] Fix | Delete
/*
[35] Fix | Delete
* Get the size of the buffer needed to store a policydb write
[36] Fix | Delete
* previously done on this policy file.
[37] Fix | Delete
*/
[38] Fix | Delete
extern int sepol_policy_file_get_len(sepol_policy_file_t * pf, size_t * len);
[39] Fix | Delete
[40] Fix | Delete
/*
[41] Fix | Delete
* Set the policy file to represent a FILE.
[42] Fix | Delete
* Subsequent operations using the policy file will read and write
[43] Fix | Delete
* to the FILE.
[44] Fix | Delete
*/
[45] Fix | Delete
extern void sepol_policy_file_set_fp(sepol_policy_file_t * pf, FILE * fp);
[46] Fix | Delete
[47] Fix | Delete
/*
[48] Fix | Delete
* Associate a handle with a policy file, for use in
[49] Fix | Delete
* error reporting from subsequent calls that take the
[50] Fix | Delete
* policy file as an argument.
[51] Fix | Delete
*/
[52] Fix | Delete
extern void sepol_policy_file_set_handle(sepol_policy_file_t * pf,
[53] Fix | Delete
sepol_handle_t * handle);
[54] Fix | Delete
[55] Fix | Delete
/* Policydb public interfaces. */
[56] Fix | Delete
[57] Fix | Delete
/* Create and free memory associated with a policydb. */
[58] Fix | Delete
extern int sepol_policydb_create(sepol_policydb_t ** p);
[59] Fix | Delete
extern void sepol_policydb_free(sepol_policydb_t * p);
[60] Fix | Delete
[61] Fix | Delete
/* Legal types of policies that the policydb can represent. */
[62] Fix | Delete
#define SEPOL_POLICY_KERN 0
[63] Fix | Delete
#define SEPOL_POLICY_BASE 1
[64] Fix | Delete
#define SEPOL_POLICY_MOD 2
[65] Fix | Delete
[66] Fix | Delete
/*
[67] Fix | Delete
* Range of policy versions for the kernel policy type supported
[68] Fix | Delete
* by this library.
[69] Fix | Delete
*/
[70] Fix | Delete
extern int sepol_policy_kern_vers_min(void);
[71] Fix | Delete
extern int sepol_policy_kern_vers_max(void);
[72] Fix | Delete
[73] Fix | Delete
/*
[74] Fix | Delete
* Set the policy type as specified, and automatically initialize the
[75] Fix | Delete
* policy version accordingly to the maximum version supported for the
[76] Fix | Delete
* policy type.
[77] Fix | Delete
* Returns -1 if the policy type is not legal.
[78] Fix | Delete
*/
[79] Fix | Delete
extern int sepol_policydb_set_typevers(sepol_policydb_t * p, unsigned int type);
[80] Fix | Delete
[81] Fix | Delete
/*
[82] Fix | Delete
* Set the policy version to a different value.
[83] Fix | Delete
* Returns -1 if the policy version is not in the supported range for
[84] Fix | Delete
* the (previously set) policy type.
[85] Fix | Delete
*/
[86] Fix | Delete
extern int sepol_policydb_set_vers(sepol_policydb_t * p, unsigned int vers);
[87] Fix | Delete
[88] Fix | Delete
/* Set how to handle unknown class/perms. */
[89] Fix | Delete
#define SEPOL_DENY_UNKNOWN 0
[90] Fix | Delete
#define SEPOL_REJECT_UNKNOWN 2
[91] Fix | Delete
#define SEPOL_ALLOW_UNKNOWN 4
[92] Fix | Delete
extern int sepol_policydb_set_handle_unknown(sepol_policydb_t * p,
[93] Fix | Delete
unsigned int handle_unknown);
[94] Fix | Delete
[95] Fix | Delete
/* Set the target platform */
[96] Fix | Delete
#define SEPOL_TARGET_SELINUX 0
[97] Fix | Delete
#define SEPOL_TARGET_XEN 1
[98] Fix | Delete
extern int sepol_policydb_set_target_platform(sepol_policydb_t * p,
[99] Fix | Delete
int target_platform);
[100] Fix | Delete
[101] Fix | Delete
/*
[102] Fix | Delete
* Read a policydb from a policy file.
[103] Fix | Delete
* This automatically sets the type and version based on the
[104] Fix | Delete
* image contents.
[105] Fix | Delete
*/
[106] Fix | Delete
extern int sepol_policydb_read(sepol_policydb_t * p, sepol_policy_file_t * pf);
[107] Fix | Delete
[108] Fix | Delete
/*
[109] Fix | Delete
* Write a policydb to a policy file.
[110] Fix | Delete
* The generated image will be in the binary format corresponding
[111] Fix | Delete
* to the policy version associated with the policydb.
[112] Fix | Delete
*/
[113] Fix | Delete
extern int sepol_policydb_write(sepol_policydb_t * p, sepol_policy_file_t * pf);
[114] Fix | Delete
[115] Fix | Delete
/*
[116] Fix | Delete
* Extract a policydb from a binary policy memory image.
[117] Fix | Delete
* This is equivalent to sepol_policydb_read with a policy file
[118] Fix | Delete
* set to refer to memory.
[119] Fix | Delete
*/
[120] Fix | Delete
extern int sepol_policydb_from_image(sepol_handle_t * handle,
[121] Fix | Delete
void *data, size_t len,
[122] Fix | Delete
sepol_policydb_t * p);
[123] Fix | Delete
[124] Fix | Delete
/*
[125] Fix | Delete
* Generate a binary policy memory image from a policydb.
[126] Fix | Delete
* This is equivalent to sepol_policydb_write with a policy file
[127] Fix | Delete
* set to refer to memory, but internally handles computing the
[128] Fix | Delete
* necessary length and allocating an appropriately sized memory
[129] Fix | Delete
* buffer for the caller.
[130] Fix | Delete
*/
[131] Fix | Delete
extern int sepol_policydb_to_image(sepol_handle_t * handle,
[132] Fix | Delete
sepol_policydb_t * p,
[133] Fix | Delete
void **newdata, size_t * newlen);
[134] Fix | Delete
[135] Fix | Delete
/*
[136] Fix | Delete
* Check whether the policydb has MLS enabled.
[137] Fix | Delete
*/
[138] Fix | Delete
extern int sepol_policydb_mls_enabled(const sepol_policydb_t * p);
[139] Fix | Delete
[140] Fix | Delete
/*
[141] Fix | Delete
* Check whether the compatibility mode for SELinux network
[142] Fix | Delete
* checks should be enabled when using this policy.
[143] Fix | Delete
*/
[144] Fix | Delete
extern int sepol_policydb_compat_net(const sepol_policydb_t * p);
[145] Fix | Delete
[146] Fix | Delete
#ifdef __cplusplus
[147] Fix | Delete
}
[148] Fix | Delete
#endif
[149] Fix | Delete
[150] Fix | Delete
#endif
[151] Fix | Delete
[152] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function