chiark / gitweb /
version 1.0.3; updated and reformatted docs using Debian woody
[userv.git] / spec.html / ch-ipass.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2
3 <html>
4
5 <head>
6
7 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
8
9 <title>User service daemon and client specification - Information passed through the client/daemon combination</title>
10
11 </head>
12
13 <body>
14
15 <a name="ch-ipass"></a>
16 <hr>
17
18 [ <a href="ch-config.html">previous</a> ]
19 [ <a href="index.html#contents">Contents</a> ]
20 [ <a href="ch-intro.html">1</a> ]
21 [ <a href="ch-client.html">2</a> ]
22 [ <a href="ch-envir.html">3</a> ]
23 [ <a href="ch-config.html">4</a> ]
24 [ 5 ]
25 [ <a href="ch-notes.html">6</a> ]
26 [ <a href="ch-notes.html">next</a> ]
27
28 <hr>
29
30 <h1>
31 User service daemon and client specification
32 <br>Chapter 5 - Information passed through the client/daemon combination
33 </h1>
34
35
36 <hr>
37
38
39 <p>
40 The information described below is the only information which passes between
41 the caller and the service.
42 <ul>
43 <li>
44 The service name supplied by the caller is available in the configuration
45 language for deciding whether and which service program to invoke, in the
46 <code>service</code> parameter, and is used by the
47 <code>execute-from-directory</code> and <code>execute-from-path</code>
48 configuration directives.  It is usually used to select which service program
49 to invoke.  It is also passed to the service program in the
50 <code>USERV_SERVICE</code> environment variable.
51 </li>
52 </ul>
53 <ul>
54 <li>
55 File descriptors specified by the client and allowed according to the
56 configuration language will be connected.  Each file descriptor is opened for
57 reading or writing.  Communication is via pipes, one end of each pipe being
58 open on the appropriate file descriptor in the service program (when it is
59 invoked) and the other end being held by the client process, which will read
60 and write files it opens on behalf of its caller or file descriptors it is
61 passed by its caller.
62
63 <p>
64 Data may be passed into the service through reading pipes and out of it through
65 writing pipes.  These pipes can remain open only until the service and client
66 have terminated, or can be made to stay open after the client has terminated
67 and (if the service program forks) the main service process has exited; the
68 behaviour is controlled by options passed to the client by its caller.
69
70 <p>
71 The caller can arrange that a writing pipe be connected to a pipe or similar
72 object and cause attempts to write to that descriptor by the service to
73 generate a <code>SIGPIPE</code> (or <code>EPIPE</code> if <code>SIGPIPE</code>
74 is caught or ignored) in the service.
75
76 <p>
77 Likewise, the service can close filedescriptors specified for reading, which
78 will cause the corresponding filedescriptors passed by the caller to be closed,
79 so that if these are pipes processes which write to them will receive
80 <code>SIGPIPE</code> or <code>EPIPE</code>.
81 </li>
82 </ul>
83 <ul>
84 <li>
85 If <code>no-suppress-args</code> is set then arguments passed to the client by
86 its caller will be passed on, verbatim, to the service.
87 </li>
88 </ul>
89 <ul>
90 <li>
91 Fatal signals and system call failures experienced by the client will result in
92 the disconnection of the service from the client and possibly some of the
93 communication file descriptors described above; if <code>disconnect-hup</code>
94 is set then the service will also be sent a <code>SIGHUP</code>.
95 </li>
96 </ul>
97 <ul>
98 <li>
99 The value of the <code>LOGNAME</code> (or <code>USER</code>) environment
100 variable as passed to the client will be used as the login name of the calling
101 user if the uid of the calling process matches the uid corresponding to that
102 login name.  Otherwise the calling uid's password entry will be used to
103 determine the calling user's login name.
104
105 <p>
106 This login name and the calling uid are available in the configuration language
107 in the <code>calling-user</code> parameter and are passed to the service
108 program in environment variables <code>USERV_USER</code> and
109 <code>USERV_UID</code>.
110
111 <p>
112 The shell corresponding to that login name (according to the password entry) is
113 available as in the configuration language's <code>calling-user-shell</code>
114 parameter.
115
116 <p>
117 If no relevant password entry can be found then no service will be invoked.
118 </li>
119 </ul>
120 <ul>
121 <li>
122 The numeric values and textual names for calling gid and supplementary group
123 list are available in the configuration language in the
124 <code>calling-group</code> parameter and are passed to the service in
125 environment variables.
126
127 <p>
128 If no name can be found for a numeric group to which the calling process
129 belongs then no service will be invoked.
130 </li>
131 </ul>
132 <ul>
133 <li>
134 The name of the current working directory in which the client was invoked is
135 passed, if available and not hidden using <code>--hidecwd</code>, to the
136 service program in the <code>USERV_CWD</code> variable.  This grants no special
137 access to that directory unless it is a subdirectory of a directory which is
138 executable (searchable) but not readable by the service user.
139 </li>
140 </ul>
141 <ul>
142 <li>
143 Settings specified by the caller using the <samp>--defvar
144 <var>name</var>=<var>value</var></samp> option to the client are available in
145 the configuration language as the corresponding <samp>u-<var>name</var></samp>
146 parameters and are passed to the service program in environment variables
147 <samp>USERV_U_<var>name</var></samp>.
148 </li>
149 </ul>
150 <ul>
151 <li>
152 If the calling user is root or the same as the service user then options may be
153 given to the client which bypass the usual security features; in this case
154 other information may pass between the caller and the service.
155 </li>
156 </ul>
157
158 <hr>
159
160 [ <a href="ch-config.html">previous</a> ]
161 [ <a href="index.html#contents">Contents</a> ]
162 [ <a href="ch-intro.html">1</a> ]
163 [ <a href="ch-client.html">2</a> ]
164 [ <a href="ch-envir.html">3</a> ]
165 [ <a href="ch-config.html">4</a> ]
166 [ 5 ]
167 [ <a href="ch-notes.html">6</a> ]
168 [ <a href="ch-notes.html">next</a> ]
169
170 <hr>
171
172 <p>
173 User service daemon and client specification
174
175 <address>
176 1.0.3<br>
177 Ian Jackson <code><a href="mailto:ian@davenant.greenend.org.uk">ian@davenant.greenend.org.uk</a></code>
178 </address>
179
180 <hr>
181
182 </body>
183
184 </html>
185