chiark / gitweb /
Version number upped for release.
[userv.git] / spec.html / ch-ipass.html
1 <html><head>
2 <title>User service daemon and client specification - Information passed through the client/daemon combination</title>
3 <link rev=made href="mailto:ian@davenant.greenend.org.uk">
4 </head><body>
5 <h1>
6 User service daemon and client specification - chapter 5<br>
7 Information passed through the client/daemon combination
8 </h1>
9
10 The information described below is the only information which passes
11 between the caller and the service.
12
13 <ul>
14 <li>The service name supplied by the caller is available in the
15 configuration language for deciding whether and which service program
16 to invoke, in the <kbd>service</kbd> parameter, and is used by the
17 <kbd>execute-from-directory</kbd> and <kbd>execute-from-path</kbd>
18 configuration directives.  It is usually used to select which service
19 program to invoke.  It is also passed to the service program in the
20 <kbd>USERV_SERVICE</kbd> environment variable.
21 <p><li>File descriptors specified by the client and allowed according to the
22 configuration language will be connected.  Each file descriptor is
23 opened for reading or writing.  Communication is via pipes, one end of
24 each pipe being open on the appropriate file descriptor in the service
25 program (when it is invoked) and the other end being held by the
26 client process, which will read and write files it opens on behalf of
27 its caller or file descriptors it is passed by its caller.<P>
28
29 Data may be passed into the service through reading pipes and out of
30 it through writing pipes.  These pipes can remain open only until the
31 service and client have terminated, or can be made to stay open after
32 the client has terminated and (if the service program forks) the main
33 service process has exited; the behaviour is controlled by options
34 passed to the client by its caller.<P>
35
36 The caller can arrange that a writing pipe be connected to a pipe or
37 similar object and cause attempts to write to that descriptor by the
38 service to generate a <kbd>SIGPIPE</kbd> (or <kbd>EPIPE</kbd> if
39 <kbd>SIGPIPE</kbd> is caught or ignored) in the service.<P>
40
41 Likewise, the service can close filedescriptors specified for reading,
42 which will cause the corresponding filedescriptors passed by the
43 caller to be closed, so that if these are pipes processes which write
44 to them will receive <kbd>SIGPIPE</kbd> or <kbd>EPIPE</kbd>.
45 <p><li>If <kbd>no-suppress-args</kbd> is set then arguments passed to the client
46 by its caller will be passed on, verbatim, to the service.
47 <p><li>Fatal signals and system call failures experienced by the client will
48 result in the disconnection of the service from the client and
49 possibly some of the communication file descriptors described above;
50 if <kbd>disconnect-hup</kbd> is set then the service will also be sent a
51 <kbd>SIGHUP</kbd>.
52 <p><li>The value of the <kbd>LOGNAME</kbd> (or <kbd>USER</kbd>) environment variable
53 as passed to the client will be used as the login name of the calling
54 user if the uid of the calling process matches the uid corresponding
55 to that login name.  Otherwise the calling uid's password entry will
56 be used to determine the calling user's login name.<P>
57
58 This login name and the calling uid are available in the configuration
59 language in the <kbd>calling-user</kbd> parameter and are passed to the
60 service program in environment variables <kbd>USERV_USER</kbd> and
61 <kbd>USERV_UID</kbd>.<P>
62
63 The shell corresponding to that login name (according to the password
64 entry) is available as in the configuration language's
65 <kbd>calling-user-shell</kbd> parameter.<P>
66
67 If no relevant password entry can be found then no service will be
68 invoked.
69 <p><li>The numeric values and textual names for calling gid and supplementary
70 group list are available in the configuration language in the
71 <kbd>calling-group</kbd> parameter and are passed to the service in
72 environment variables.<P>
73
74 If no name can be found for a numeric group to which the calling
75 process belongs then no service will be invoked.
76 <p><li>The name of the current working directory in which the client was
77 invoked is passed, if available and not hidden using <kbd>--hidecwd</kbd>,
78 to the service program in the <kbd>USERV_CWD</kbd> variable.  This grants no
79 special access to that directory unless it is a subdirectory of a
80 directory which is executable (searchable) but not readable by the
81 service user.
82 <p><li>Settings specified by the caller using the <code>--defvar
83 </code><var>name</var><code>=</code><var>value</var><code></code> option to the client are available in the
84 configuration language as the corresponding <code>u-</code><var>name</var><code></code>
85 parameters and are passed to the service program in environment
86 variables <code>USERV_U_</code><var>name</var><code></code>.
87 <p><li>If the calling user is root or the same as the service user then
88 options may be given to the client which bypass the usual security
89 features; in this case other information may pass between the caller
90 and the service.
91 <p></ul>
92
93 <hr>
94 User service daemon and client specification
95 - <A href="index.html#copyright"><kbd>userv</kbd> is Copyright 1996-1999 Ian Jackson.</A>
96 <br>
97 <A href="index.html#toc">Contents</A>; <A href="index.html#abstract">abstract</A>; <A href="ch-notes.html">next</A>; <A href="ch-config.html">back</A>.
98 <br>
99 <address>0.62<br>
100 Ian Jackson <A href="mailto:ian@davenant.greenend.org.uk">ian@davenant.greenend.org.uk</A></address>
101 </body></html>