text
stringlengths
0
234
.ir setattr " (since linux 2.6.15)."
this permission allows a key's uid, gid, and permissions mask to be changed.
.ip
this permission is required for the
.br keyctl_revoke ,
.br keyctl_chown ,
and
.br keyctl_setperm
operations.
.ip
the permission bits for each category are
.br key_pos_setattr ,
.br key_usr_setattr ,
.br key_grp_setattr ,
and
.br key_oth_setattr .
.re
.ip
as a convenience, the following macros are defined as masks for
all of the permission bits in each of the user categories:
.br key_pos_all ,
.br key_usr_all ,
.br key_grp_all ,
and
.br key_oth_all .
.ip
the
.ir arg4 " and " arg5
arguments are ignored.
.ip
this operation is exposed by
.i libkeyutils
via the function
.br keyctl_setperm (3).
.tp
.br keyctl_describe " (since linux 2.6.10)"
obtain a string describing the attributes of a specified key.
.ip
the id of the key to be described is specified in
.i arg2
(cast to
.ir key_serial_t ).
the descriptive string is returned in the buffer pointed to by
.i arg3
(cast to
.ir "char\ *" );
.i arg4
(cast to
.ir size_t )
specifies the size of that buffer in bytes.
.ip
the key must grant the caller
.i view
permission.
.ip
the returned string is null-terminated and
contains the following information about the key:
.ip
.in +4n
.ir type ; uid ; gid ; perm ; description
.in
.ip
in the above,
.ir type
and
.ir description
are strings,
.ir uid
and
.ir gid
are decimal strings, and
.i perm
is a hexadecimal permissions mask.
the descriptive string is written with the following format:
.ip
%s;%d;%d;%08x;%s
.ip
.br "note: the intention is that the descriptive string should"
.br "be extensible in future kernel versions".
in particular, the
.ir description
field will not contain semicolons;
.\" fixme but, the kernel does not enforce the requirement
.\" that the key description contains no semicolons!
.\" so, user space has no guarantee here??
.\" either something more needs to be said here,
.\" or a kernel fix is required.
it should be parsed by working backwards from the end of the string
to find the last semicolon.
this allows future semicolon-delimited fields to be inserted
in the descriptive string in the future.
.ip
writing to the buffer is attempted only when
.ir arg3
is non-null and the specified buffer size
is large enough to accept the descriptive string
(including the terminating null byte).
.\" function commentary says it copies up to buflen bytes, but see the
.\" (buffer && buflen >= ret) condition in keyctl_describe_key() in
.\" security/keyctl.c