text
stringlengths
0
234
the
.i dest_keyring
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 (see
.br thread\-keyring (7)).
.tp
.b key_spec_process_keyring
this specifies the caller's process-specific keyring (see
.br process\-keyring (7)).
.tp
.b key_spec_session_keyring
this specifies the caller's session-specific keyring (see
.br session\-keyring (7)).
.tp
.b key_spec_user_keyring
this specifies the caller's uid-specific keyring (see
.br user\-keyring (7)).
.tp
.b key_spec_user_session_keyring
this specifies the caller's uid-session keyring (see
.br user\-session\-keyring (7)).
.pp
when the
.i dest_keyring
is specified as 0
and no key construction has been performed,
then no additional linking is done.
.pp
otherwise, if
.i dest_keyring
is 0 and a new key is constructed, the new key will be linked
to the "default" keyring.
more precisely, when the kernel tries to determine to which keyring the
newly constructed key should be linked,
it tries the following keyrings,
beginning with the keyring set via the
.br keyctl (2)
.br keyctl_set_reqkey_keyring
operation and continuing in the order shown below
until it finds the first keyring that exists:
.ip \(bu 3
.\" 8bbf4976b59fc9fc2861e79cab7beb3f6d647640
the requestor keyring
.rb ( key_reqkey_defl_requestor_keyring ,
since linux 2.6.29).
.\" fixme
.\" actually, is the preceding point correct?
.\" if i understand correctly, we'll only get here if
.\" 'dest_keyring' is zero, in which case key_reqkey_defl_requestor_keyring
.\" won't refer to a keyring. have i misunderstood?
.ip \(bu
the thread-specific keyring
.rb ( key_reqkey_defl_thread_keyring ;
see
.br thread\-keyring (7)).
.ip \(bu
the process-specific keyring
.rb ( key_reqkey_defl_process_keyring ;
see
.br process\-keyring (7)).
.ip \(bu
the session-specific keyring
.rb ( key_reqkey_defl_session_keyring ;
see
.br session\-keyring (7)).
.ip \(bu
the session keyring for the process's user id
.rb ( key_reqkey_defl_user_session_keyring ;
see
.br user\-session\-keyring (7)).
this keyring is expected to always exist.
.ip \(bu
the uid-specific keyring
.rb ( key_reqkey_defl_user_keyring ;
see
.br user\-keyring (7)).
this keyring is also expected to always exist.
.\" mtk: are there circumstances where the user sessions and uid-specific
.\" keyrings do not exist?
.\"
.\" david howells:
.\" the uid keyrings don't exist until someone tries to access them -
.\" at which point they're both created. when you log in, pam_keyinit
.\" creates a link to your user keyring in the session keyring it just
.\" created, thereby creating the user and user-session keyrings.
.\"
.\" and david elaborated that "access" means:
.\"
.\" it means lookup_user_key() was passed key_lookup_create. so:
.\"
.\" add_key() - destination keyring
.\" request_key() - destination keyring
.\" keyctl_get_keyring_id - if create arg is true
.\" keyctl_clear
.\" keyctl_link - both args
.\" keyctl_search - destination keyring