text
stringlengths
0
234
.i write
permission on the keyring from which the key is being removed.
.ip
if the last link to a key is removed,
then that key will be scheduled for destruction.
.ip
the arguments
.ir arg4
and
.ir arg5
are ignored.
.ip
this operation is exposed by
.i libkeyutils
via the function
.br keyctl_unlink (3).
.tp
.br keyctl_search " (since linux 2.6.10)"
search for a key in a keyring tree,
returning its id and optionally linking it to a specified keyring.
.ip
the tree to be searched is specified by passing
the id of the head keyring in
.ir arg2
(cast to
.ir key_serial_t ).
the search is performed breadth-first and recursively.
.ip
the
.i arg3
and
.i arg4
arguments specify the key to be searched for:
.i arg3
(cast as
.ir "char\ *" )
contains the key type
(a null-terminated character string up to 32 bytes in size,
including the terminating null byte), and
.i arg4
(cast as
.ir "char\ *" )
contains the description of the key
(a null-terminated character string up to 4096 bytes in size,
including the terminating null byte).
.ip
the source keyring must grant
.i search
permission to the caller.
when performing the recursive search, only keyrings that grant the caller
.i search
permission will be searched.
only keys with for which the caller has
.i search
permission can be found.
.ip
if the key is found, its id is returned as the function result.
.ip
if the key is found and
.i arg5
(cast to
.ir key_serial_t )
is nonzero, then, subject to the same constraints and rules as
.br keyctl_link ,
the key is linked into the keyring whose id is specified in
.ir arg5 .
if the destination keyring specified in
.i arg5
already contains a link to a key that has the same type and description,
then that link will be displaced by a link to
the key found by this operation.
.ip
instead of valid existing keyring ids, the source
.ri ( arg2 )
and destination
.ri ( arg5 )
keyrings can be one of the special keyring ids listed under
.br keyctl_get_keyring_id .
.ip
this operation is exposed by
.i libkeyutils
via the function
.br keyctl_search (3).
.tp
.br keyctl_read " (since linux 2.6.10)"
read the payload data of a key.
.ip
the id of the key whose payload is to be read is specified in
.i arg2
(cast to
.ir key_serial_t ).
this can be the id of an existing key,
or any of the special key ids listed for
.br keyctl_get_keyring_id .
.\" including key_spec_reqkey_auth_key
.ip
the payload is placed in the buffer pointed by
.i arg3
(cast to
.ir "char\ *" );