Add PIE compilation flags
[platform/upstream/keyutils.git] / keyctl_session_to_parent.3
1 .\"
2 .\" Copyright (C) 2010 Red Hat, Inc. All Rights Reserved.
3 .\" Written by David Howells (dhowells@redhat.com)
4 .\"
5 .\" This program is free software; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License
7 .\" as published by the Free Software Foundation; either version
8 .\" 2 of the License, or (at your option) any later version.
9 .\"
10 .TH KEYCTL_SESSION_TO_PARENT 3 "26 Jun 2010" Linux "Linux Key Management Calls"
11 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
12 .SH NAME
13 keyctl_session_to_parent \- Set the parent process's session keyring
14 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
15 .SH SYNOPSIS
16 .nf
17 .B #include <keyutils.h>
18 .sp
19 .BI "long keyctl_session_to_parent();"
20 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
21 .SH DESCRIPTION
22 .BR keyctl_session_to_parent ()
23 changes the session keyring to which the calling process's parent subscribes
24 to be the that of the calling process.
25 .P
26 The keyring must have
27 .B link
28 permission available to the calling process, the parent process must have the
29 same UIDs/GIDs as the calling process, and the LSM must not reject the
30 replacement.  Furthermore, this may not be used to affect init or a kernel
31 thread.
32 .P
33 Note that the replacement will not take immediate effect upon the parent
34 process, but will rather be deferred to the next time it returns to userspace
35 from kernel space.
36 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
37 .SH RETURN VALUE
38 On success
39 .BR keyctl_session_to_parent ()
40 returns 0.  On error, the value
41 .B -1
42 will be returned and errno will have been set to an appropriate error.
43 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
44 .SH ERRORS
45 .TP
46 .B ENOMEM
47 Insufficient memory to create a key.
48 .TP
49 .B EPERM
50 The credentials of the parent don't match those of the caller.
51 .TP
52 .B EACCES
53 The named keyring exists, but is not
54 .B linkable
55 by the calling process.
56 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
57 .SH LINKING
58 This is a library function that can be found in
59 .IR libkeyutils .
60 When linking,
61 .B -lkeyutils
62 should be specified to the linker.
63 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
64 .SH SEE ALSO
65 .BR keyctl (1),
66 .br
67 .BR add_key (2),
68 .br
69 .BR keyctl (2),
70 .br
71 .BR request_key (2),
72 .br
73 .BR keyctl (3),
74 .br
75 .BR request-key (8)