Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include
File: keyutils.h
/* keyutils.h: key utility library interface
[0] Fix | Delete
*
[1] Fix | Delete
* Copyright (C) 2005,2011 Red Hat, Inc. All Rights Reserved.
[2] Fix | Delete
* Written by David Howells (dhowells@redhat.com)
[3] Fix | Delete
*
[4] Fix | Delete
* This program is free software; you can redistribute it and/or
[5] Fix | Delete
* modify it under the terms of the GNU Lesser General Public License
[6] Fix | Delete
* as published by the Free Software Foundation; either version
[7] Fix | Delete
* 2 of the License, or (at your option) any later version.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
#ifndef KEYUTILS_H
[11] Fix | Delete
#define KEYUTILS_H
[12] Fix | Delete
[13] Fix | Delete
#include <sys/types.h>
[14] Fix | Delete
#include <stdint.h>
[15] Fix | Delete
[16] Fix | Delete
extern const char keyutils_version_string[];
[17] Fix | Delete
extern const char keyutils_build_string[];
[18] Fix | Delete
[19] Fix | Delete
/* key serial number */
[20] Fix | Delete
typedef int32_t key_serial_t;
[21] Fix | Delete
[22] Fix | Delete
/* special process keyring shortcut IDs */
[23] Fix | Delete
#define KEY_SPEC_THREAD_KEYRING -1 /* - key ID for thread-specific keyring */
[24] Fix | Delete
#define KEY_SPEC_PROCESS_KEYRING -2 /* - key ID for process-specific keyring */
[25] Fix | Delete
#define KEY_SPEC_SESSION_KEYRING -3 /* - key ID for session-specific keyring */
[26] Fix | Delete
#define KEY_SPEC_USER_KEYRING -4 /* - key ID for UID-specific keyring */
[27] Fix | Delete
#define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */
[28] Fix | Delete
#define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */
[29] Fix | Delete
#define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */
[30] Fix | Delete
[31] Fix | Delete
/* request-key default keyrings */
[32] Fix | Delete
#define KEY_REQKEY_DEFL_NO_CHANGE -1
[33] Fix | Delete
#define KEY_REQKEY_DEFL_DEFAULT 0
[34] Fix | Delete
#define KEY_REQKEY_DEFL_THREAD_KEYRING 1
[35] Fix | Delete
#define KEY_REQKEY_DEFL_PROCESS_KEYRING 2
[36] Fix | Delete
#define KEY_REQKEY_DEFL_SESSION_KEYRING 3
[37] Fix | Delete
#define KEY_REQKEY_DEFL_USER_KEYRING 4
[38] Fix | Delete
#define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
[39] Fix | Delete
#define KEY_REQKEY_DEFL_GROUP_KEYRING 6
[40] Fix | Delete
[41] Fix | Delete
/* key handle permissions mask */
[42] Fix | Delete
typedef uint32_t key_perm_t;
[43] Fix | Delete
[44] Fix | Delete
#define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */
[45] Fix | Delete
#define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */
[46] Fix | Delete
#define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */
[47] Fix | Delete
#define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */
[48] Fix | Delete
#define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */
[49] Fix | Delete
#define KEY_POS_SETATTR 0x20000000 /* possessor can set key attributes */
[50] Fix | Delete
#define KEY_POS_ALL 0x3f000000
[51] Fix | Delete
[52] Fix | Delete
#define KEY_USR_VIEW 0x00010000 /* user permissions... */
[53] Fix | Delete
#define KEY_USR_READ 0x00020000
[54] Fix | Delete
#define KEY_USR_WRITE 0x00040000
[55] Fix | Delete
#define KEY_USR_SEARCH 0x00080000
[56] Fix | Delete
#define KEY_USR_LINK 0x00100000
[57] Fix | Delete
#define KEY_USR_SETATTR 0x00200000
[58] Fix | Delete
#define KEY_USR_ALL 0x003f0000
[59] Fix | Delete
[60] Fix | Delete
#define KEY_GRP_VIEW 0x00000100 /* group permissions... */
[61] Fix | Delete
#define KEY_GRP_READ 0x00000200
[62] Fix | Delete
#define KEY_GRP_WRITE 0x00000400
[63] Fix | Delete
#define KEY_GRP_SEARCH 0x00000800
[64] Fix | Delete
#define KEY_GRP_LINK 0x00001000
[65] Fix | Delete
#define KEY_GRP_SETATTR 0x00002000
[66] Fix | Delete
#define KEY_GRP_ALL 0x00003f00
[67] Fix | Delete
[68] Fix | Delete
#define KEY_OTH_VIEW 0x00000001 /* third party permissions... */
[69] Fix | Delete
#define KEY_OTH_READ 0x00000002
[70] Fix | Delete
#define KEY_OTH_WRITE 0x00000004
[71] Fix | Delete
#define KEY_OTH_SEARCH 0x00000008
[72] Fix | Delete
#define KEY_OTH_LINK 0x00000010
[73] Fix | Delete
#define KEY_OTH_SETATTR 0x00000020
[74] Fix | Delete
#define KEY_OTH_ALL 0x0000003f
[75] Fix | Delete
[76] Fix | Delete
/* keyctl commands */
[77] Fix | Delete
#define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */
[78] Fix | Delete
#define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */
[79] Fix | Delete
#define KEYCTL_UPDATE 2 /* update a key */
[80] Fix | Delete
#define KEYCTL_REVOKE 3 /* revoke a key */
[81] Fix | Delete
#define KEYCTL_CHOWN 4 /* set ownership of a key */
[82] Fix | Delete
#define KEYCTL_SETPERM 5 /* set perms on a key */
[83] Fix | Delete
#define KEYCTL_DESCRIBE 6 /* describe a key */
[84] Fix | Delete
#define KEYCTL_CLEAR 7 /* clear contents of a keyring */
[85] Fix | Delete
#define KEYCTL_LINK 8 /* link a key into a keyring */
[86] Fix | Delete
#define KEYCTL_UNLINK 9 /* unlink a key from a keyring */
[87] Fix | Delete
#define KEYCTL_SEARCH 10 /* search for a key in a keyring */
[88] Fix | Delete
#define KEYCTL_READ 11 /* read a key or keyring's contents */
[89] Fix | Delete
#define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */
[90] Fix | Delete
#define KEYCTL_NEGATE 13 /* negate a partially constructed key */
[91] Fix | Delete
#define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */
[92] Fix | Delete
#define KEYCTL_SET_TIMEOUT 15 /* set timeout on a key */
[93] Fix | Delete
#define KEYCTL_ASSUME_AUTHORITY 16 /* assume authority to instantiate key */
[94] Fix | Delete
#define KEYCTL_GET_SECURITY 17 /* get key security label */
[95] Fix | Delete
#define KEYCTL_SESSION_TO_PARENT 18 /* set my session keyring on my parent process */
[96] Fix | Delete
#define KEYCTL_REJECT 19 /* reject a partially constructed key */
[97] Fix | Delete
#define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */
[98] Fix | Delete
#define KEYCTL_INVALIDATE 21 /* invalidate a key */
[99] Fix | Delete
#define KEYCTL_GET_PERSISTENT 22 /* get a user's persistent keyring */
[100] Fix | Delete
#define KEYCTL_DH_COMPUTE 23 /* Compute Diffie-Hellman values */
[101] Fix | Delete
[102] Fix | Delete
/* keyctl structures */
[103] Fix | Delete
struct keyctl_dh_params {
[104] Fix | Delete
key_serial_t priv;
[105] Fix | Delete
key_serial_t prime;
[106] Fix | Delete
key_serial_t base;
[107] Fix | Delete
};
[108] Fix | Delete
[109] Fix | Delete
/*
[110] Fix | Delete
* syscall wrappers
[111] Fix | Delete
*/
[112] Fix | Delete
extern key_serial_t add_key(const char *type,
[113] Fix | Delete
const char *description,
[114] Fix | Delete
const void *payload,
[115] Fix | Delete
size_t plen,
[116] Fix | Delete
key_serial_t ringid);
[117] Fix | Delete
[118] Fix | Delete
extern key_serial_t request_key(const char *type,
[119] Fix | Delete
const char *description,
[120] Fix | Delete
const char *callout_info,
[121] Fix | Delete
key_serial_t destringid);
[122] Fix | Delete
[123] Fix | Delete
extern long keyctl(int cmd, ...);
[124] Fix | Delete
[125] Fix | Delete
/*
[126] Fix | Delete
* keyctl function wrappers
[127] Fix | Delete
*/
[128] Fix | Delete
extern key_serial_t keyctl_get_keyring_ID(key_serial_t id, int create);
[129] Fix | Delete
extern key_serial_t keyctl_join_session_keyring(const char *name);
[130] Fix | Delete
extern long keyctl_update(key_serial_t id, const void *payload, size_t plen);
[131] Fix | Delete
extern long keyctl_revoke(key_serial_t id);
[132] Fix | Delete
extern long keyctl_chown(key_serial_t id, uid_t uid, gid_t gid);
[133] Fix | Delete
extern long keyctl_setperm(key_serial_t id, key_perm_t perm);
[134] Fix | Delete
extern long keyctl_describe(key_serial_t id, char *buffer, size_t buflen);
[135] Fix | Delete
extern long keyctl_clear(key_serial_t ringid);
[136] Fix | Delete
extern long keyctl_link(key_serial_t id, key_serial_t ringid);
[137] Fix | Delete
extern long keyctl_unlink(key_serial_t id, key_serial_t ringid);
[138] Fix | Delete
extern long keyctl_search(key_serial_t ringid,
[139] Fix | Delete
const char *type,
[140] Fix | Delete
const char *description,
[141] Fix | Delete
key_serial_t destringid);
[142] Fix | Delete
extern long keyctl_read(key_serial_t id, char *buffer, size_t buflen);
[143] Fix | Delete
extern long keyctl_instantiate(key_serial_t id,
[144] Fix | Delete
const void *payload,
[145] Fix | Delete
size_t plen,
[146] Fix | Delete
key_serial_t ringid);
[147] Fix | Delete
extern long keyctl_negate(key_serial_t id, unsigned timeout, key_serial_t ringid);
[148] Fix | Delete
extern long keyctl_set_reqkey_keyring(int reqkey_defl);
[149] Fix | Delete
extern long keyctl_set_timeout(key_serial_t key, unsigned timeout);
[150] Fix | Delete
extern long keyctl_assume_authority(key_serial_t key);
[151] Fix | Delete
extern long keyctl_get_security(key_serial_t key, char *buffer, size_t buflen);
[152] Fix | Delete
extern long keyctl_session_to_parent(void);
[153] Fix | Delete
extern long keyctl_reject(key_serial_t id, unsigned timeout, unsigned error,
[154] Fix | Delete
key_serial_t ringid);
[155] Fix | Delete
struct iovec;
[156] Fix | Delete
extern long keyctl_instantiate_iov(key_serial_t id,
[157] Fix | Delete
const struct iovec *payload_iov,
[158] Fix | Delete
unsigned ioc,
[159] Fix | Delete
key_serial_t ringid);
[160] Fix | Delete
extern long keyctl_invalidate(key_serial_t id);
[161] Fix | Delete
extern long keyctl_get_persistent(uid_t uid, key_serial_t id);
[162] Fix | Delete
extern long keyctl_dh_compute(key_serial_t priv, key_serial_t prime,
[163] Fix | Delete
key_serial_t base, char *buffer, size_t buflen);
[164] Fix | Delete
[165] Fix | Delete
/*
[166] Fix | Delete
* utilities
[167] Fix | Delete
*/
[168] Fix | Delete
extern int keyctl_describe_alloc(key_serial_t id, char **_buffer);
[169] Fix | Delete
extern int keyctl_read_alloc(key_serial_t id, void **_buffer);
[170] Fix | Delete
extern int keyctl_get_security_alloc(key_serial_t id, char **_buffer);
[171] Fix | Delete
extern int keyctl_dh_compute_alloc(key_serial_t priv, key_serial_t prime,
[172] Fix | Delete
key_serial_t base, void **_buffer);
[173] Fix | Delete
[174] Fix | Delete
typedef int (*recursive_key_scanner_t)(key_serial_t parent, key_serial_t key,
[175] Fix | Delete
char *desc, int desc_len, void *data);
[176] Fix | Delete
extern int recursive_key_scan(key_serial_t key, recursive_key_scanner_t func, void *data);
[177] Fix | Delete
extern int recursive_session_key_scan(recursive_key_scanner_t func, void *data);
[178] Fix | Delete
extern key_serial_t find_key_by_type_and_desc(const char *type, const char *desc,
[179] Fix | Delete
key_serial_t destringid);
[180] Fix | Delete
[181] Fix | Delete
#endif /* KEYUTILS_H */
[182] Fix | Delete
[183] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function