mirror of https://github.com/mkerrisk/man-pages
add_key.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
92624b070f
commit
6430ef0ab8
|
@ -21,33 +21,36 @@ add_key \- add a key to the kernel's key management facility
|
|||
.fi
|
||||
.SH DESCRIPTION
|
||||
.BR add_key ()
|
||||
asks the kernel to create or update a key of the given
|
||||
creates or updates a key of the given
|
||||
.I type
|
||||
and
|
||||
.IR description ,
|
||||
instantiate it with the
|
||||
instantiates it with the
|
||||
.I payload
|
||||
of length
|
||||
.IR plen ,
|
||||
and to attach it to the nominated
|
||||
.I keyring
|
||||
and to return its serial number.
|
||||
attaches it to the nominated
|
||||
.IR keyring ,
|
||||
and return the key's serial number.
|
||||
.P
|
||||
The key type may reject the data if it's in the wrong format or in some other
|
||||
way invalid.
|
||||
The key type may reject the data if it is in the wrong format or
|
||||
is in some other way invalid.
|
||||
.P
|
||||
If the destination
|
||||
.I keyring
|
||||
already contains a key that matches the specified
|
||||
.IR type " and " description,
|
||||
.IR type
|
||||
and
|
||||
.IR description ,
|
||||
then, if the key type supports it, that key will be updated rather than a new
|
||||
key being created; if not, a new key will be created and it will displace the
|
||||
link to the extant key from the keyring.
|
||||
.P
|
||||
The destination
|
||||
.I keyring
|
||||
serial number may be that of a valid keyring to which the caller has write
|
||||
permission, or it may be a special keyring ID:
|
||||
serial number may be that of a valid keyring for which the caller has
|
||||
.I write
|
||||
permission, or it may be one of the following special keyring IDs:
|
||||
.TP
|
||||
.B KEY_SPEC_THREAD_KEYRING
|
||||
This specifies the caller's thread-specific keyring.
|
||||
|
@ -63,7 +66,7 @@ This specifies the caller's UID-specific keyring.
|
|||
.TP
|
||||
.B KEY_SPEC_USER_SESSION_KEYRING
|
||||
This specifies the caller's UID-session keyring.
|
||||
.SH KEY TYPES
|
||||
.SS Key types
|
||||
There are a number of key types available in the core key management code, and
|
||||
these can be specified to this function:
|
||||
.TP
|
||||
|
@ -84,11 +87,12 @@ should be specified, and
|
|||
.I plen
|
||||
should be zero.
|
||||
.SH RETURN VALUE
|
||||
On success
|
||||
On success,
|
||||
.BR add_key ()
|
||||
returns the serial number of the key it created or updated.
|
||||
On error, the value \-1
|
||||
will be returned and errno will have been set to an appropriate error.
|
||||
On error, \-1 is returned and
|
||||
.I errno
|
||||
is set to indicate the cause of the error.
|
||||
.SH ERRORS
|
||||
.TP
|
||||
.B EACCES
|
||||
|
|
Loading…
Reference in New Issue