Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/selinux
File: restorecon.h
#ifndef _RESTORECON_H_
[0] Fix | Delete
#define _RESTORECON_H_
[1] Fix | Delete
[2] Fix | Delete
#include <sys/types.h>
[3] Fix | Delete
#include <stdarg.h>
[4] Fix | Delete
[5] Fix | Delete
#ifdef __cplusplus
[6] Fix | Delete
extern "C" {
[7] Fix | Delete
#endif
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* selinux_restorecon - Relabel files.
[11] Fix | Delete
* @pathname: specifies file/directory to relabel.
[12] Fix | Delete
* @restorecon_flags: specifies the actions to be performed when relabeling.
[13] Fix | Delete
*
[14] Fix | Delete
* selinux_restorecon(3) will automatically call
[15] Fix | Delete
* selinux_restorecon_default_handle(3) and selinux_restorecon_set_sehandle(3)
[16] Fix | Delete
* first time through to set the selabel_open(3) parameters to use the
[17] Fix | Delete
* currently loaded policy file_contexts and request their computed digest.
[18] Fix | Delete
*
[19] Fix | Delete
* Should other selabel_open(3) parameters be required see
[20] Fix | Delete
* selinux_restorecon_set_sehandle(3).
[21] Fix | Delete
*/
[22] Fix | Delete
extern int selinux_restorecon(const char *pathname,
[23] Fix | Delete
unsigned int restorecon_flags);
[24] Fix | Delete
/*
[25] Fix | Delete
* restorecon_flags options
[26] Fix | Delete
*/
[27] Fix | Delete
/*
[28] Fix | Delete
* Force the checking of labels even if the stored SHA1
[29] Fix | Delete
* digest matches the specfiles SHA1 digest.
[30] Fix | Delete
*/
[31] Fix | Delete
#define SELINUX_RESTORECON_IGNORE_DIGEST 0x0001
[32] Fix | Delete
/*
[33] Fix | Delete
* Do not change file labels.
[34] Fix | Delete
*/
[35] Fix | Delete
#define SELINUX_RESTORECON_NOCHANGE 0x0002
[36] Fix | Delete
/*
[37] Fix | Delete
* If set, change file label to that in spec file.
[38] Fix | Delete
* If not, only change type component to that in spec file.
[39] Fix | Delete
*/
[40] Fix | Delete
#define SELINUX_RESTORECON_SET_SPECFILE_CTX 0x0004
[41] Fix | Delete
/*
[42] Fix | Delete
* Recursively descend directories.
[43] Fix | Delete
*/
[44] Fix | Delete
#define SELINUX_RESTORECON_RECURSE 0x0008
[45] Fix | Delete
/*
[46] Fix | Delete
* Log changes to selinux log. Note that if VERBOSE and
[47] Fix | Delete
* PROGRESS are set, then PROGRESS will take precedence.
[48] Fix | Delete
*/
[49] Fix | Delete
#define SELINUX_RESTORECON_VERBOSE 0x0010
[50] Fix | Delete
/*
[51] Fix | Delete
* If SELINUX_RESTORECON_PROGRESS is true and
[52] Fix | Delete
* SELINUX_RESTORECON_MASS_RELABEL is true, then output approx % complete,
[53] Fix | Delete
* else output the number of files in 1k blocks processed to stdout.
[54] Fix | Delete
*/
[55] Fix | Delete
#define SELINUX_RESTORECON_PROGRESS 0x0020
[56] Fix | Delete
/*
[57] Fix | Delete
* Convert passed-in pathname to canonical pathname.
[58] Fix | Delete
*/
[59] Fix | Delete
#define SELINUX_RESTORECON_REALPATH 0x0040
[60] Fix | Delete
/*
[61] Fix | Delete
* Prevent descending into directories that have a different
[62] Fix | Delete
* device number than the pathname from which the descent began.
[63] Fix | Delete
*/
[64] Fix | Delete
#define SELINUX_RESTORECON_XDEV 0x0080
[65] Fix | Delete
/*
[66] Fix | Delete
* Attempt to add an association between an inode and a specification.
[67] Fix | Delete
* If there is already an association for the inode and it conflicts
[68] Fix | Delete
* with the specification, then use the last matching specification.
[69] Fix | Delete
*/
[70] Fix | Delete
#define SELINUX_RESTORECON_ADD_ASSOC 0x0100
[71] Fix | Delete
/*
[72] Fix | Delete
* Abort on errors during the file tree walk.
[73] Fix | Delete
*/
[74] Fix | Delete
#define SELINUX_RESTORECON_ABORT_ON_ERROR 0x0200
[75] Fix | Delete
/*
[76] Fix | Delete
* Log any label changes to syslog.
[77] Fix | Delete
*/
[78] Fix | Delete
#define SELINUX_RESTORECON_SYSLOG_CHANGES 0x0400
[79] Fix | Delete
/*
[80] Fix | Delete
* Log what spec matched each file.
[81] Fix | Delete
*/
[82] Fix | Delete
#define SELINUX_RESTORECON_LOG_MATCHES 0x0800
[83] Fix | Delete
/*
[84] Fix | Delete
* Ignore files that do not exist.
[85] Fix | Delete
*/
[86] Fix | Delete
#define SELINUX_RESTORECON_IGNORE_NOENTRY 0x1000
[87] Fix | Delete
/*
[88] Fix | Delete
* Do not read /proc/mounts to obtain a list of non-seclabel
[89] Fix | Delete
* mounts to be excluded from relabeling checks.
[90] Fix | Delete
*/
[91] Fix | Delete
#define SELINUX_RESTORECON_IGNORE_MOUNTS 0x2000
[92] Fix | Delete
/*
[93] Fix | Delete
* Set if there is a mass relabel required.
[94] Fix | Delete
* See SELINUX_RESTORECON_PROGRESS flag for details.
[95] Fix | Delete
*/
[96] Fix | Delete
#define SELINUX_RESTORECON_MASS_RELABEL 0x4000
[97] Fix | Delete
[98] Fix | Delete
/**
[99] Fix | Delete
* selinux_restorecon_set_sehandle - Set the global fc handle.
[100] Fix | Delete
* @hndl: specifies handle to set as the global fc handle.
[101] Fix | Delete
*
[102] Fix | Delete
* Called by a process that has already called selabel_open(3) with it's
[103] Fix | Delete
* required parameters, or if selinux_restorecon_default_handle(3) has been
[104] Fix | Delete
* called to set the default selabel_open(3) parameters.
[105] Fix | Delete
*/
[106] Fix | Delete
extern void selinux_restorecon_set_sehandle(struct selabel_handle *hndl);
[107] Fix | Delete
[108] Fix | Delete
/**
[109] Fix | Delete
* selinux_restorecon_default_handle - Sets default selabel_open(3) parameters
[110] Fix | Delete
* to use the currently loaded policy and
[111] Fix | Delete
* file_contexts, also requests the digest.
[112] Fix | Delete
*
[113] Fix | Delete
* Return value is the created handle on success or NULL with @errno set on
[114] Fix | Delete
* failure.
[115] Fix | Delete
*/
[116] Fix | Delete
extern struct selabel_handle *selinux_restorecon_default_handle(void);
[117] Fix | Delete
[118] Fix | Delete
/**
[119] Fix | Delete
* selinux_restorecon_set_exclude_list - Add a list of directories that are
[120] Fix | Delete
* to be excluded from relabeling.
[121] Fix | Delete
* @exclude_list: containing a NULL terminated list of one or more
[122] Fix | Delete
* directories not to be relabeled.
[123] Fix | Delete
*/
[124] Fix | Delete
extern void selinux_restorecon_set_exclude_list(const char **exclude_list);
[125] Fix | Delete
[126] Fix | Delete
/**
[127] Fix | Delete
* selinux_restorecon_set_alt_rootpath - Use alternate rootpath.
[128] Fix | Delete
* @alt_rootpath: containing the alternate rootpath to be used.
[129] Fix | Delete
*
[130] Fix | Delete
* Return %0 on success, -%1 with @errno set on failure.
[131] Fix | Delete
*/
[132] Fix | Delete
extern int selinux_restorecon_set_alt_rootpath(const char *alt_rootpath);
[133] Fix | Delete
[134] Fix | Delete
/**
[135] Fix | Delete
* selinux_restorecon_xattr - Read/remove RESTORECON_LAST xattr entries.
[136] Fix | Delete
* @pathname: specifies directory path to check.
[137] Fix | Delete
* @xattr_flags: specifies the actions to be performed.
[138] Fix | Delete
* @xattr_list: a linked list of struct dir_xattr structures containing
[139] Fix | Delete
* the directory, digest and result of the action on the
[140] Fix | Delete
* RESTORECON_LAST entry.
[141] Fix | Delete
*
[142] Fix | Delete
* selinux_restorecon_xattr(3) will automatically call
[143] Fix | Delete
* selinux_restorecon_default_handle(3) and selinux_restorecon_set_sehandle(3)
[144] Fix | Delete
* first time through to set the selabel_open(3) parameters to use the
[145] Fix | Delete
* currently loaded policy file_contexts and request their computed digest.
[146] Fix | Delete
*
[147] Fix | Delete
* Should other selabel_open(3) parameters be required see
[148] Fix | Delete
* selinux_restorecon_set_sehandle(3), however note that a file_contexts
[149] Fix | Delete
* computed digest is required for selinux_restorecon_xattr().
[150] Fix | Delete
*/
[151] Fix | Delete
enum digest_result {
[152] Fix | Delete
MATCH = 0,
[153] Fix | Delete
NOMATCH,
[154] Fix | Delete
DELETED_MATCH,
[155] Fix | Delete
DELETED_NOMATCH,
[156] Fix | Delete
ERROR
[157] Fix | Delete
};
[158] Fix | Delete
[159] Fix | Delete
struct dir_xattr {
[160] Fix | Delete
char *directory;
[161] Fix | Delete
char *digest; /* A hex encoded string that can be printed. */
[162] Fix | Delete
enum digest_result result;
[163] Fix | Delete
struct dir_xattr *next;
[164] Fix | Delete
};
[165] Fix | Delete
[166] Fix | Delete
extern int selinux_restorecon_xattr(const char *pathname,
[167] Fix | Delete
unsigned int xattr_flags,
[168] Fix | Delete
struct dir_xattr ***xattr_list);
[169] Fix | Delete
[170] Fix | Delete
/*
[171] Fix | Delete
* xattr_flags options
[172] Fix | Delete
*/
[173] Fix | Delete
/* Recursively descend directories. */
[174] Fix | Delete
#define SELINUX_RESTORECON_XATTR_RECURSE 0x0001
[175] Fix | Delete
/* Delete non-matching digests from each directory in pathname. */
[176] Fix | Delete
#define SELINUX_RESTORECON_XATTR_DELETE_NONMATCH_DIGESTS 0x0002
[177] Fix | Delete
/* Delete all digests found in pathname. */
[178] Fix | Delete
#define SELINUX_RESTORECON_XATTR_DELETE_ALL_DIGESTS 0x0004
[179] Fix | Delete
/* Do not read /proc/mounts. */
[180] Fix | Delete
#define SELINUX_RESTORECON_XATTR_IGNORE_MOUNTS 0x0008
[181] Fix | Delete
[182] Fix | Delete
#ifdef __cplusplus
[183] Fix | Delete
}
[184] Fix | Delete
#endif
[185] Fix | Delete
#endif
[186] Fix | Delete
[187] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function