1KEYCTL_SESSION_TO_PARENT(3)Linux Key Management CallsKEYCTL_SESSION_TO_PARENT(3)
2
3
4
6 keyctl_session_to_parent - Set the parent process's session keyring
7
9 #include <keyutils.h>
10
11 long keyctl_session_to_parent();
12
14 keyctl_session_to_parent() changes the session keyring to which the
15 calling process's parent subscribes to be the that of the calling
16 process.
17
18 The keyring must have link permission available to the calling process,
19 the parent process must have the same UIDs/GIDs as the calling process,
20 and the LSM must not reject the replacement. Furthermore, this may not
21 be used to affect init or a kernel thread.
22
23 Note that the replacement will not take immediate effect upon the par‐
24 ent process, but will rather be deferred to the next time it returns to
25 userspace from kernel space.
26
28 On success keyctl_session_to_parent() returns 0. On error, the value
29 -1 will be returned and errno will have been set to an appropriate
30 error.
31
33 ENOMEM Insufficient memory to create a key.
34
35 EPERM The credentials of the parent don't match those of the caller.
36
37 EACCES The named keyring exists, but is not linkable by the calling
38 process.
39
41 This is a library function that can be found in libkeyutils. When
42 linking, -lkeyutils should be specified to the linker.
43
45 keyctl(1),
46 add_key(2),
47 keyctl(2),
48 request_key(2),
49 keyctl(3),
50 request-key(8)
51
52
53
54Linux 26 Jun 2010 KEYCTL_SESSION_TO_PARENT(3)