Current File : //usr/include/selinux/label.h
/*
 * Labeling interface for userspace object managers and others.
 *
 * Author : Eamon Walsh <[email protected]>
 */
#ifndef _SELABEL_H_
#define _SELABEL_H_

#include <stdbool.h>
#include <sys/types.h>
#include <selinux/selinux.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Opaque type used for all label handles.
 */

struct selabel_handle;

/* 
 * Available backends.
 */

/* file contexts */
#define SELABEL_CTX_FILE	0
/* media contexts */
#define SELABEL_CTX_MEDIA	1
/* x contexts */
#define SELABEL_CTX_X		2
/* db objects */
#define SELABEL_CTX_DB		3
/* Android property service contexts */
#define SELABEL_CTX_ANDROID_PROP 4

/*
 * Available options
 */

/* no-op option, useful for unused slots in an array of options */
#define SELABEL_OPT_UNUSED	0
/* validate contexts before returning them (boolean value) */
#define SELABEL_OPT_VALIDATE	1
/* don't use local customizations to backend data (boolean value) */
#define SELABEL_OPT_BASEONLY	2
/* specify an alternate path to use when loading backend data */
#define SELABEL_OPT_PATH	3
/* select a subset of the search space as an optimization (file backend) */
#define SELABEL_OPT_SUBSET	4
/* require a hash calculation on spec files */
#define SELABEL_OPT_DIGEST	5
/* total number of options */
#define SELABEL_NOPT		6

/*
 * Label operations
 */

/**
 * selabel_open - Create a labeling handle.
 * @backend: one of the constants specifying a supported labeling backend.
 * @opts: array of selabel_opt structures specifying label options or NULL.
 * @nopts: number of elements in opts array or zero for no options.
 *
 * Open a labeling backend for use.  The available backend identifiers are
 * listed above.  Options may be provided via the opts parameter; available
 * options are listed above.  Not all options may be supported by every
 * backend.  Return value is the created handle on success or NULL with
 * @errno set on failure.
 */
struct selabel_handle *selabel_open(unsigned int backend,
				    const struct selinux_opt *opts,
				    unsigned nopts);

/**
 * selabel_close - Close a labeling handle.
 * @handle: specifies handle to close
 *
 * Destroy the specified handle, closing files, freeing allocated memory,
 * etc.  The handle may not be further used after it has been closed.
 */
void selabel_close(struct selabel_handle *handle);

/**
 * selabel_lookup - Perform labeling lookup operation.
 * @handle: specifies backend instance to query
 * @con: returns the appropriate context with which to label the object
 * @key: string input to lookup operation
 * @type: numeric input to the lookup operation
 *
 * Perform a labeling lookup operation.  Return %0 on success, -%1 with
 * @errno set on failure.  The key and type arguments are the inputs to the
 * lookup operation; appropriate values are dictated by the backend in use.
 * The result is returned in the memory pointed to by @con and must be freed
 * by the user with freecon().
 */
int selabel_lookup(struct selabel_handle *handle, char **con,
		   const char *key, int type);
int selabel_lookup_raw(struct selabel_handle *handle, char **con,
		       const char *key, int type);

bool selabel_partial_match(struct selabel_handle *handle, const char *key);

int selabel_lookup_best_match(struct selabel_handle *rec, char **con,
			      const char *key, const char **aliases, int type);
int selabel_lookup_best_match_raw(struct selabel_handle *rec, char **con,
			      const char *key, const char **aliases, int type);

/**
 * selabel_digest - Retrieve the SHA1 digest and the list of specfiles used to
 *		    generate the digest. The SELABEL_OPT_DIGEST option must
 *		    be set in selabel_open() to initiate the digest generation.
 * @handle: specifies backend instance to query
 * @digest: returns a pointer to the SHA1 digest.
 * @digest_len: returns length of digest in bytes.
 * @specfiles: a list of specfiles used in the SHA1 digest generation.
 *	       The list is NULL terminated and will hold @num_specfiles entries.
 * @num_specfiles: number of specfiles in the list.
 *
 * Return %0 on success, -%1 with @errno set on failure.
 */
int selabel_digest(struct selabel_handle *rec,
			    unsigned char **digest, size_t *digest_len,
			    char ***specfiles, size_t *num_specfiles);

enum selabel_cmp_result {
	SELABEL_SUBSET,
	SELABEL_EQUAL,
	SELABEL_SUPERSET,
	SELABEL_INCOMPARABLE
};

/**
 * selabel_cmp - Compare two label configurations.
 * @h1: handle for the first label configuration
 * @h2: handle for the first label configuration
 *
 * Compare two label configurations.
 * Return %SELABEL_SUBSET if @h1 is a subset of @h2, %SELABEL_EQUAL
 * if @h1 is identical to @h2, %SELABEL_SUPERSET if @h1 is a superset
 * of @h2, and %SELABEL_INCOMPARABLE if @h1 and @h2 are incomparable.
 */
enum selabel_cmp_result selabel_cmp(struct selabel_handle *h1,
				    struct selabel_handle *h2);

/**
 * selabel_stats - log labeling operation statistics.
 * @handle: specifies backend instance to query
 *
 * Log a message with information about the number of queries performed,
 * number of unused matching entries, or other operational statistics.
 * Message is backend-specific, some backends may not output a message.
 */
void selabel_stats(struct selabel_handle *handle);

/*
 * Type codes used by specific backends
 */

/* X backend */
#define SELABEL_X_PROP		1
#define SELABEL_X_EXT		2
#define SELABEL_X_CLIENT	3
#define SELABEL_X_EVENT		4
#define SELABEL_X_SELN		5
#define SELABEL_X_POLYPROP	6
#define SELABEL_X_POLYSELN	7

/* DB backend */
#define SELABEL_DB_DATABASE	1
#define SELABEL_DB_SCHEMA	2
#define SELABEL_DB_TABLE	3
#define SELABEL_DB_COLUMN	4
#define SELABEL_DB_SEQUENCE	5
#define SELABEL_DB_VIEW		6
#define SELABEL_DB_PROCEDURE	7
#define SELABEL_DB_BLOB		8
#define SELABEL_DB_TUPLE	9
#define SELABEL_DB_LANGUAGE	10
#define SELABEL_DB_EXCEPTION 11
#define SELABEL_DB_DATATYPE 12

#ifdef __cplusplus
}
#endif
#endif	/* _SELABEL_H_ */
blog

blog

– Официальный сайт Pinco Casino.2090 (2)

Пинко Казино – Официальный сайт Pinco Casino ▶️ ИГРАТЬ Содержимое Преимущества игры на официальном сайте Pinco Casino Безопасность и конфиденциальность Как начать играть на официальном сайте Pinco Casino Конечно, безопасность и конфиденциальность игроков Как мы обеспечиваем безопасность и конфиденциальность В современном мире азартных игр, где каждый день появляются новые онлайн-казино, …

Read More »

Nine Casino Avis Bonus sur NineCasino en Ligne.1624

Nine Casino Avis — Bonus sur NineCasino en Ligne ▶️ JOUER Содержимое Les avantages de jouer sur Nine Casino Un code bonus attrayant Une plateforme de jeu sécurisée Les bonus sur Nine Casino : comment les obtenir Les avantages de jouer sur Nine Casino Les bonus sur Nine Casino : …

Read More »

Mostbet (9668)

Официальный сайт Мостбет – ставки на спорт и слоты в казино Mostbet ▶️ ИГРАТЬ Содержимое Преимущества официального сайта Mostbet Как зарегистрироваться и начать играть на Mostbet Возможности казино Mostbet: играть на деньги и бесплатно Играть на деньги Играть бесплатно Безопасность и надежность официального сайта Mostbet В современном мире азартных игр …

Read More »

Mostbet (5587)

Мостбет зеркало – Букмекерская контора Mostbet ▶️ ИГРАТЬ Содержимое Описание и функции Mostbet Преимущества и преимущества Mostbet Преимущества Mostbet Преимущества Mostbet Casino Как зарегистрироваться и начать играть на Mostbet Регистрация с помощью социальных сетей Бонусы и акции Mostbet Отзывы и оценки пользователей Mostbet Положительные отзывы Негативные отзывы В современном мире …

Read More »

Mostbet (2640)

Mostbet зеркало рабочее – Вход на официальный сайт Мостбет ▶️ ИГРАТЬ Содержимое Мостбет: надежный партнер для ставок Вход на официальный сайт Мостбет Как зарегистрироваться на официальном сайте Мостбет Как найти рабочее зеркало Мостбет Почему игроки ищут рабочие зеркала Мостбет Как найти рабочее зеркало Мостбет Преимущества использования зеркала Мостбет Безопасность и …

Read More »

1win — казино и БК.3867

1win — казино и БК ▶️ ИГРАТЬ Содержимое 1вин: Казино и БК Преимущества и функции 1win Функции 1win: Как начать играть и ставить в 1вин В мире азарта всегда было важно найти надежный и надежный партнера, который обеспечит вам лучшие условия для игры и ставок. В последние годы, 1вин – …

Read More »

1win — зеркало сайта букмекерской конторы 1вин.1431

1win — зеркало сайта букмекерской конторы 1вин ▶️ ИГРАТЬ Содержимое Преимущества использования зеркала 1win Как найти зеркало 1win Шаг 1: Установите браузер Шаг 2: Найдите зеркало 1win Безопасность и надежность зеркала 1win Защита данных Проверка и сертификация Букмекерская контора 1вин является одним из лидеров на рынке азартных игр. Компания была …

Read More »

1win официальный сайт букмекера — Обзор и зеркало для входа.2917

1win официальный сайт букмекера — Обзор и зеркало для входа ▶️ ИГРАТЬ Содержимое 1win Официальный Сайт Букмекера Официальный Сайт 1win Зеркало 1win для Входа Обзор и Зеркало для Входа Преимущества 1вин Зеркало 1вин: почему это не лучший выбор Преимущества и Функции 1вин Функции 1вин: Как Зарегистрироваться и Начать Играть на …

Read More »

казино – Официальный сайт Pin up играть онлайн Зеркало и вход.4032

Пин Ап казино – Официальный сайт Pin up играть онлайн | Зеркало и вход ▶️ ИГРАТЬ Содержимое Пин Ап Казино – Официальный Сайт Играть Онлайн Зеркало и Вход Pin Up Casino – Официальный сайт Описание и функции Pin Up Казино Как играть онлайн и вход в Pin Up Казино Шаги …

Read More »

1win официальный сайт букмекера — Обзор и зеркало для входа.3479

1win официальный сайт букмекера — Обзор и зеркало для входа ▶️ ИГРАТЬ Содержимое 1win Официальный Сайт Букмекера Обзор и Зеркало для Входа Преимущества и Функции 1win Бонусы и Промокоды В мире ставок и азарта 1win является одним из самых популярных букмекеров, предлагающих широкий спектр услуг для игроков. Компания была основана …

Read More »