Add PIE compilation flags
[platform/upstream/keyutils.git] / request-key.conf.5
1 .\" -*- nroff -*-
2 .\" Copyright (C) 2005 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 REQUEST-KEY.CONF 5 "11 July 2005" Linux "Linux Key Management Utilities"
11 .SH NAME
12 request-key.conf - Instantiation handler configuration file
13 .SH DESCRIPTION
14 .P
15 This file is used by the /sbin/request-key program to determine which program
16 it should run to instantiate a key.
17 .P
18 request-key works scans through the file a line at a time until it finds a
19 match, which it will then use. If it doesn't find a match, it'll return an
20 error and the kernel will automatically negate the key.
21 .P
22 Any blank line or line beginning with a hash mark '#' is considered to be a
23 comment and ignored.
24 .P
25 All other lines are assumed to be command lines with a number of white space
26 separated fields:
27 .P
28 <op> <type> <description> <callout-info> <prog> <arg1> <arg2> ...
29 .P
30 The first four fields are used to match the parameters passed to request-key by
31 the kernel. \fIop\fR is the operation type; currently the only supported
32 operation is "create".
33 .P
34 \fItype\fR, \fIdescription\fR and \fIcallout-info\fR match the three parameters
35 passed to \fBkeyctl request2\fR or the \fBrequest_key()\fR system call. Each of
36 these may contain one or more asterisk '*' characters as wildcards anywhere
37 within the string.
38 .P
39 Should a match be made, the program specified by <prog> will be exec'd. This
40 must have a fully qualified path name. argv[0] will be set from the part of the
41 program name that follows the last slash '/' character.
42 .P
43 If the program name is prefixed with a pipe bar character '|', then the program
44 will be forked and exec'd attached to three pipes. The callout information will
45 be piped to it on it's stdin and the intended payload data will be retrieved
46 from its stdout. Anything sent to stderr will be posted in syslog. If the
47 program exits 0, then /sbin/request-key will attempt to instantiate the key
48 with the data read from stdout. If it fails in any other way, then request-key
49 will attempt to execute the appropriate 'negate' operation command.
50 .P
51 The program arguments can be substituted with various macros. Only complete
52 argument substitution is supported - macro substitutions can't be embedded. All
53 macros begin with a percent character '%'. An argument beginning with two
54 percent characters will have one of them discarded.
55 .P
56 The following macros are supported:
57 .P
58 .RS
59 %o    Operation type
60 .br
61 %k    Key ID
62 .br
63 %t    Key type
64 .br
65 %d    Key description
66 .br
67 %c    Callout information
68 .br
69 %u    Key UID
70 .br
71 %g    Key GID
72 .br
73 %T    Requestor's thread keyring
74 .br
75 %P    Requestor's process keyring
76 .br
77 %S    Requestor's session keyring
78 .RE
79 .P
80 There's another macro substitution too that permits the interpolation of the
81 contents of a key:
82 .P
83 .RS
84 %{<type>:<description>}
85 .RE
86 .P
87 This performs a lookup for a key of the given type and description on the
88 requestor's keyrings, and if found, substitutes the contents for the macro. If
89 not found an error will be logged and the key under construction will be
90 negated.
91 .SH EXAMPLE
92 .P
93 A basic file will be installed in the /etc. This will contain two debugging
94 lines that can be used to test the installation:
95 .P
96 .RS
97 create user debug:* negate /bin/keyctl negate %k 30 %S
98 .br
99 create user debug:loop:* * |/bin/cat
100 .br
101 create user debug:* * /usr/share/keyutils/request-key-debug.sh %k %d %c %S
102 .br
103 negate * * * /bin/keyctl negate %k 30 %S
104 .RE
105 .P
106 This is set up so that something like:
107 .P
108 .RS
109 keyctl request2 user debug:xxxx negate
110 .RE
111 .P
112 will create a negative user-defined key, something like:
113 .P
114 .RS
115 keyctl request2 user debug:yyyy spoon
116 .RE
117 .P
118 will create an instantiated user-defined key with "Debug spoon" as the payload,
119 and something like:
120 .P
121 .RS
122 keyctl request2 user debug:loop:zzzz abcdefghijkl
123 .RE
124 .P
125 will create an instantiated user-defined key with the callout information as
126 the payload.
127 .SH FILES
128 .ul
129 /etc/request-key.conf
130 .ul 0
131 .SH SEE ALSO
132 \fBkeyctl\fR(1), \fBrequest-key.conf\fR(5)