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