]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man7/user-session-keyring.7
keyrings.7, persistent-keyring.7, process-keyring.7, session-keyring.7, thread-keyrin...
[thirdparty/man-pages.git] / man7 / user-session-keyring.7
CommitLineData
9bb46110
MK
1.\"
2.\" Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
3.\" Written by David Howells (dhowells@redhat.com)
4.\"
1ba9d9e5 5.\" %%%LICENSE_START(GPLv2+_SW_ONEPARA)
9bb46110
MK
6.\" This program is free software; you can redistribute it and/or
7.\" modify it under the terms of the GNU General Public Licence
8.\" as published by the Free Software Foundation; either version
9.\" 2 of the Licence, or (at your option) any later version.
1ba9d9e5 10.\" %%%LICENSE_END
9bb46110 11.\"
e7ca6b3c 12.TH "USER-SESSION-KEYRING" 7 2016-11-01 Linux "Linux Programmer's Manual"
9bb46110
MK
13.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
14.SH NAME
8c5a425a 15user-session-keyring \- per-user default session keyring
9bb46110 16.SH DESCRIPTION
f437df79 17The user session keyring is a keyring used to anchor keys on behalf of a user.
a44454bc
MK
18Each UID the kernel
19deals with has its own user session keyring.
20This keyring is associated with
9bb46110 21the record that the kernel maintains for the UID and, once created, is retained
a44454bc
MK
22as long as that record persists.
23It is shared amongst all processes of that
9bb46110
MK
24UID.
25.P
a44454bc 26The user session keyring is created on demand when a thread requests it
f437df79
MK
27or when a thread asks for its
28.BR session-keyring (7)
29and that doesn't exist.
a44454bc
MK
30In the latter case,
31a user session keyring will be created and, if the session keyring
9bb46110
MK
32wasn't to be created, the user session keyring will be set as the process's
33actual session keyring.
34.P
35The user session keyring is searched by \fBrequest_key\fP() if the actual
36session keyring does not exist and is ignored otherwise.
37.P
f437df79
MK
38A special serial number value,
39.BR KEY_SPEC_USER_SESSION_KEYRING ,
40is defined
9bb46110
MK
41that can be used in lieu of the calling process's user session keyring's actual
42serial number.
43.P
44From the keyctl utility, '\fB@us\fP' can be used instead of a numeric key ID in
45much the same way.
46.P
f437df79
MK
47User session keyrings are independent of
48.BR clone (2),
49.BR fork (2),
50.BR vfork (2),
51.BR execve (2),
52and
53.BR exit (2)
54excepting that the keyring is destroyed when the UID record is destroyed
9bb46110
MK
55when the last process pinning it exits.
56.P
57If a user session keyring does not exist when it is accessed, it will be
58created.
59.P
f437df79
MK
60It is strongly recommended that a
61.BR session-keyring (7)
62be set explicitly, for
63example by
64.BR pam_keyinit (8),
65rather than relying on the user session keyring -
9bb46110
MK
66particularly if a process is running as root.
67.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
68.SH SEE ALSO
2aa9ab8b
MK
69.ad l
70.nh
9bb46110 71.BR keyctl (1),
9bb46110 72.BR keyctl (3),
9bb46110 73.BR keyrings (7),
2aa9ab8b
MK
74.BR persistent\-keyring (7),
75.BR process\-keyring (7),
76.BR session\-keyring (7),
77.BR thread\-keyring (7),
78.BR user\-keyring (7)