Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00045 #ifndef _SYS_CREDS_H
00046 #define _SYS_CREDS_H
00047
00048 #include <sys/types.h>
00049 #include <stdint.h>
00050
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054
00058 typedef int creds_type_t;
00059
00060 #define CREDS_BAD -1
00061
00065 typedef long creds_value_t;
00066
00075 typedef struct _creds_struct *creds_t;
00076
00077
00089 creds_t creds_getpeer(int socket);
00090
00105 creds_t creds_gettask(pid_t pid);
00106
00119 creds_t creds_init();
00120
00130 void creds_clear(creds_t creds);
00131
00145 void creds_free(creds_t creds);
00146
00163 int creds_set(const creds_t creds);
00164
00182 int creds_set2(const creds_t creds, int flags);
00183
00198 int creds_add(creds_t *creds, creds_type_t type, creds_value_t value);
00199
00210 void creds_sub(creds_t creds, creds_type_t type, creds_value_t value);
00211
00220 creds_type_t creds_list(const creds_t creds, int index, creds_value_t *value);
00221
00244 int creds_find(const creds_t creds, const char *pattern, char *buf, size_t size);
00245
00254 int creds_have_p(const creds_t creds, creds_type_t type, creds_value_t value);
00255
00256
00270 int creds_have_access(const creds_t creds, creds_type_t type, creds_value_t value, const char *access_type);
00271
00298 long creds_str2creds(const char *credential, creds_value_t *value);
00299
00313 int creds_creds2str(creds_type_t type, creds_value_t value, char *buf, size_t size);
00314
00325 const uint32_t *creds_export(creds_t creds, size_t *length);
00326
00336 creds_t creds_import(const uint32_t *list, size_t length);
00337
00354 long creds_load(int flags, const char *path, const creds_t creds);
00355
00386 long creds_confine(const char *path);
00387
00419 long creds_confine2(const char *path, int flags, const creds_t creds);
00420
00446 int credp_str2flags(const char *str, int *mask);
00447
00461 size_t credp_flags2str(int flags, int mask, char *buf, size_t size);
00462
00463 #ifdef __cplusplus
00464 }
00465 #endif
00466 #endif