/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/usplash.xml

  • Committer: Teddy Hogeborn
  • Date: 2008-10-03 09:32:30 UTC
  • Revision ID: teddy@fukt.bsnet.se-20081003093230-rshn19e0c19zz12i
* .bzrignore (plugins.d/askpass-fifo): Added.

* Makefile (FORTIFY): Added "-fstack-protector-all".
  (mandos, mandos-keygen): Use more strict regexps when updating the
                           version number.

* mandos (Client.__init__): Use os.path.expandvars() and
                            os.path.expanduser() on the "secfile"
                            config value.

* plugins.d/splashy.c: Update comments and order of #include's.
  (main): Check user and group when looking for running splashy
          process.  Do not ignore ENOENT from execl().  Use _exit()
          instead of "return" when an error happens in child
          processes.  Bug fix: Only wait for splashy_update
          completion if it was started.  Bug fix: detect failing
          waitpid().  Only kill splashy_update if it is running.  Do
          the killing of the old splashy process before the fork().
          Do setsid() and setuid(geteuid()) before starting the new
          splashy.  Report failing execl().

* plugins.d/usplash.c: Update comments and order of #include's.
  (main): Check user and group when looking for running usplash
          process.  Do not report execv() error if interrupted by a
          signal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="UTF-8"?>
2
 
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3
 
        "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4
 
<!ENTITY COMMANDNAME "usplash">
5
 
<!ENTITY TIMESTAMP "2008-10-04">
6
 
<!ENTITY % common SYSTEM "../common.ent">
7
 
%common;
8
 
]>
9
 
 
10
 
<refentry xmlns:xi="http://www.w3.org/2001/XInclude">
11
 
  <refentryinfo>
12
 
    <title>Mandos Manual</title>
13
 
    <!-- NWalsh’s docbook scripts use this to generate the footer: -->
14
 
    <productname>Mandos</productname>
15
 
    <productnumber>&version;</productnumber>
16
 
    <date>&TIMESTAMP;</date>
17
 
    <authorgroup>
18
 
      <author>
19
 
        <firstname>Björn</firstname>
20
 
        <surname>Påhlsson</surname>
21
 
        <address>
22
 
          <email>belorn@fukt.bsnet.se</email>
23
 
        </address>
24
 
      </author>
25
 
      <author>
26
 
        <firstname>Teddy</firstname>
27
 
        <surname>Hogeborn</surname>
28
 
        <address>
29
 
          <email>teddy@fukt.bsnet.se</email>
30
 
        </address>
31
 
      </author>
32
 
    </authorgroup>
33
 
    <copyright>
34
 
      <year>2008</year>
35
 
      <holder>Teddy Hogeborn</holder>
36
 
      <holder>Björn Påhlsson</holder>
37
 
    </copyright>
38
 
    <xi:include href="../legalnotice.xml"/>
39
 
  </refentryinfo>
40
 
  
41
 
  <refmeta>
42
 
    <refentrytitle>&COMMANDNAME;</refentrytitle>
43
 
    <manvolnum>8mandos</manvolnum>
44
 
  </refmeta>
45
 
  
46
 
  <refnamediv>
47
 
    <refname><command>&COMMANDNAME;</command></refname>
48
 
    <refpurpose>Mandos plugin to use usplash to get a
49
 
    password.</refpurpose>
50
 
  </refnamediv>
51
 
  
52
 
  <refsynopsisdiv>
53
 
    <cmdsynopsis>
54
 
      <command>&COMMANDNAME;</command>
55
 
    </cmdsynopsis>
56
 
  </refsynopsisdiv>
57
 
  
58
 
  <refsect1 id="description">
59
 
    <title>DESCRIPTION</title>
60
 
    <para>
61
 
      This program prompts for a password using <citerefentry>
62
 
      <refentrytitle>usplash</refentrytitle><manvolnum>8</manvolnum>
63
 
      </citerefentry> and outputs any given password to standard
64
 
      output.  If no <citerefentry><refentrytitle
65
 
      >usplash</refentrytitle><manvolnum>8</manvolnum></citerefentry>
66
 
      process can be found, this program will immediately exit with an
67
 
      exit code indicating failure.
68
 
    </para>
69
 
    <para>
70
 
      This program is not very useful on its own.  This program is
71
 
      really meant to run as a plugin in the <application
72
 
      >Mandos</application> client-side system, where it is used as a
73
 
      fallback and alternative to retrieving passwords from a
74
 
      <application >Mandos</application> server.
75
 
    </para>
76
 
    <para>
77
 
      If this program is killed (presumably by
78
 
      <citerefentry><refentrytitle>plugin-runner</refentrytitle>
79
 
      <manvolnum>8mandos</manvolnum></citerefentry> because some other
80
 
      plugin provided the password), it cannot tell <citerefentry>
81
 
      <refentrytitle>usplash</refentrytitle><manvolnum>8</manvolnum>
82
 
      </citerefentry> to abort requesting a password, because
83
 
      <citerefentry><refentrytitle>usplash</refentrytitle>
84
 
      <manvolnum>8</manvolnum></citerefentry> does not support this.
85
 
      Therefore, this program will then <emphasis>kill</emphasis> the
86
 
      running <citerefentry><refentrytitle>usplash</refentrytitle>
87
 
      <manvolnum>8</manvolnum></citerefentry> process and start a
88
 
      <emphasis>new</emphasis> one using the same command line
89
 
      arguments as the old one was using.
90
 
    </para>
91
 
  </refsect1>
92
 
  
93
 
  <refsect1 id="options">
94
 
    <title>OPTIONS</title>
95
 
    <para>
96
 
      This program takes no options.
97
 
    </para>
98
 
  </refsect1>
99
 
  
100
 
  <refsect1 id="exit_status">
101
 
    <title>EXIT STATUS</title>
102
 
    <para>
103
 
      If exit status is 0, the output from the program is the password
104
 
      as it was read.  Otherwise, if exit status is other than 0, the
105
 
      program was interrupted or encountered an error, and any output
106
 
      so far could be corrupt and/or truncated, and should therefore
107
 
      be ignored.
108
 
    </para>
109
 
  </refsect1>
110
 
  
111
 
  <refsect1 id="environment">
112
 
    <title>ENVIRONMENT</title>
113
 
    <variablelist>
114
 
      <varlistentry>
115
 
        <term><envar>cryptsource</envar></term>
116
 
        <term><envar>crypttarget</envar></term>
117
 
        <listitem>
118
 
          <para>
119
 
            If set, these environment variables will be assumed to
120
 
            contain the source device name and the target device
121
 
            mapper name, respectively, and will be shown as part of
122
 
            the prompt.
123
 
        </para>
124
 
        <para>
125
 
          These variables will normally be inherited from
126
 
          <citerefentry><refentrytitle>plugin-runner</refentrytitle>
127
 
          <manvolnum>8mandos</manvolnum></citerefentry>, which will
128
 
          normally have inherited them from
129
 
          <filename>/scripts/local-top/cryptroot</filename> in the
130
 
          initial <acronym>RAM</acronym> disk environment, which will
131
 
          have set them from parsing kernel arguments and
132
 
          <filename>/conf/conf.d/cryptroot</filename> (also in the
133
 
          initial RAM disk environment), which in turn will have been
134
 
          created when the initial RAM disk image was created by
135
 
          <filename
136
 
          >/usr/share/initramfs-tools/hooks/cryptroot</filename>, by
137
 
          extracting the information of the root file system from
138
 
          <filename >/etc/crypttab</filename>.
139
 
        </para>
140
 
        <para>
141
 
          This behavior is meant to exactly mirror the behavior of
142
 
          <command>askpass</command>, the default password prompter.
143
 
        </para>
144
 
        </listitem>
145
 
      </varlistentry>
146
 
    </variablelist>
147
 
  </refsect1>
148
 
  
149
 
  <refsect1 id="files">
150
 
    <title>FILES</title>
151
 
    <variablelist>
152
 
      <varlistentry>
153
 
        <term><filename>/dev/.initramfs/usplash_fifo</filename></term>
154
 
        <listitem>
155
 
          <para>
156
 
            This is the <acronym>FIFO</acronym> to where this program
157
 
            will write the commands for <citerefentry><refentrytitle
158
 
            >usplash</refentrytitle><manvolnum>8</manvolnum>
159
 
            </citerefentry>.  See <citerefentry><refentrytitle
160
 
            >fifo</refentrytitle><manvolnum>7</manvolnum>
161
 
            </citerefentry>.
162
 
          </para>
163
 
        </listitem>
164
 
      </varlistentry>
165
 
      <varlistentry>
166
 
        <term><filename>/dev/.initramfs/usplash_outfifo</filename></term>
167
 
        <listitem>
168
 
          <para>
169
 
            This is the <acronym>FIFO</acronym> where this program
170
 
            will read the password from <citerefentry><refentrytitle
171
 
            >usplash</refentrytitle><manvolnum>8</manvolnum>
172
 
            </citerefentry>.  See <citerefentry><refentrytitle
173
 
            >fifo</refentrytitle><manvolnum>7</manvolnum>
174
 
            </citerefentry>.
175
 
          </para>
176
 
        </listitem>
177
 
      </varlistentry>
178
 
      <varlistentry>
179
 
        <term><filename>/proc</filename></term>
180
 
        <listitem>
181
 
          <para>
182
 
            To find the running <citerefentry><refentrytitle
183
 
            >usplash</refentrytitle><manvolnum>8</manvolnum>
184
 
            </citerefentry>, this directory will be searched for
185
 
            numeric entries which will be assumed to be directories.
186
 
            In all those directories, the <filename>exe</filename> and
187
 
            <filename>cmdline</filename> entries will be used to
188
 
            determine the name of the running binary, effective user
189
 
            and group <abbrev>ID</abbrev>, and the command line
190
 
            arguments.  See <citerefentry><refentrytitle
191
 
            >proc</refentrytitle><manvolnum>5</manvolnum>
192
 
            </citerefentry>.
193
 
          </para>
194
 
        </listitem>
195
 
      </varlistentry>
196
 
      <varlistentry>
197
 
        <term><filename>/sbin/usplash</filename></term>
198
 
        <listitem>
199
 
          <para>
200
 
            This is the name of the binary which will be searched for
201
 
            in the process list.  See <citerefentry><refentrytitle
202
 
            >usplash</refentrytitle><manvolnum>8</manvolnum>
203
 
            </citerefentry>.
204
 
          </para>
205
 
        </listitem>
206
 
      </varlistentry>
207
 
    </variablelist>
208
 
  </refsect1>
209
 
  
210
 
  <refsect1 id="bugs">
211
 
    <title>BUGS</title>
212
 
    <para>
213
 
      Killing <citerefentry><refentrytitle>usplash</refentrytitle>
214
 
      <manvolnum>8</manvolnum></citerefentry> and starting a new one
215
 
      is ugly, but necessary as long as it does not support aborting a
216
 
      password request.
217
 
    </para>
218
 
  </refsect1>
219
 
  
220
 
  <refsect1 id="example">
221
 
    <title>EXAMPLE</title>
222
 
    <para>
223
 
      Note that normally, this program will not be invoked directly,
224
 
      but instead started by the Mandos <citerefentry><refentrytitle
225
 
      >plugin-runner</refentrytitle><manvolnum>8mandos</manvolnum>
226
 
      </citerefentry>.
227
 
    </para>
228
 
    <informalexample>
229
 
      <para>
230
 
        This program takes no options.
231
 
      </para>
232
 
      <para>
233
 
        <userinput>&COMMANDNAME;</userinput>
234
 
      </para>
235
 
    </informalexample>
236
 
  </refsect1>
237
 
  
238
 
  <refsect1 id="security">
239
 
    <title>SECURITY</title>
240
 
    <para>
241
 
      If this program is killed by a signal, it will kill the process
242
 
      <abbrev>ID</abbrev> which at the start of this program was
243
 
      determined to run <citerefentry><refentrytitle
244
 
      >usplash</refentrytitle><manvolnum>8</manvolnum></citerefentry>
245
 
      as root (see also <xref linkend="files"/>).  There is a very
246
 
      slight risk that, in the time between those events, that process
247
 
      <abbrev>ID</abbrev> was freed and then taken up by another
248
 
      process; the wrong process would then be killed.  Now, this
249
 
      program can only be killed by the user who started it; see
250
 
      <citerefentry><refentrytitle>plugin-runner</refentrytitle>
251
 
      <manvolnum>8mandos</manvolnum></citerefentry>.  This program
252
 
      should therefore be started by a completely separate
253
 
      non-privileged user, and no other programs should be allowed to
254
 
      run as that special user.  This means that it is not recommended
255
 
      to use the user "nobody" to start this program, as other
256
 
      possibly less trusted programs could be running as "nobody", and
257
 
      they would then be able to kill this program, triggering the
258
 
      killing of the process <abbrev>ID</abbrev> which may or may not
259
 
      be <citerefentry><refentrytitle>usplash</refentrytitle>
260
 
      <manvolnum>8</manvolnum></citerefentry>.
261
 
    </para>
262
 
    <para>
263
 
      The only other thing that could be considered worthy of note is
264
 
      this:  This program is meant to be run by <citerefentry>
265
 
      <refentrytitle>plugin-runner</refentrytitle><manvolnum
266
 
      >8mandos</manvolnum></citerefentry>, and will, when run
267
 
      standalone, outside, in a normal environment, immediately output
268
 
      on its standard output any presumably secret password it just
269
 
      received.  Therefore, when running this program standalone
270
 
      (which should never normally be done), take care not to type in
271
 
      any real secret password by force of habit, since it would then
272
 
      immediately be shown as output.
273
 
    </para>
274
 
  </refsect1>
275
 
  
276
 
  <refsect1 id="see_also">
277
 
    <title>SEE ALSO</title>
278
 
    <para>
279
 
      <citerefentry><refentrytitle>crypttab</refentrytitle>
280
 
      <manvolnum>5</manvolnum></citerefentry>,
281
 
      <citerefentry><refentrytitle>fifo</refentrytitle>
282
 
      <manvolnum>7</manvolnum></citerefentry>,
283
 
      <citerefentry><refentrytitle>plugin-runner</refentrytitle>
284
 
      <manvolnum>8mandos</manvolnum></citerefentry>,
285
 
      <citerefentry><refentrytitle>proc</refentrytitle>
286
 
      <manvolnum>5</manvolnum></citerefentry>,
287
 
      <citerefentry><refentrytitle>usplash</refentrytitle>
288
 
      <manvolnum>8</manvolnum></citerefentry>
289
 
    </para>
290
 
  </refsect1>
291
 
</refentry>
292
 
<!-- Local Variables: -->
293
 
<!-- time-stamp-start: "<!ENTITY TIMESTAMP [\"']" -->
294
 
<!-- time-stamp-end: "[\"']>" -->
295
 
<!-- time-stamp-format: "%:y-%02m-%02d" -->
296
 
<!-- End: -->