/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/password-prompt.xml

  • Committer: Teddy Hogeborn
  • Date: 2009-10-24 19:17:52 UTC
  • Revision ID: teddy@fukt.bsnet.se-20091024191752-7g6xlf6wpp2pdexb
Convert some programs to use the exit codes from <sysexits.h>.  Change
all programs using the "argp" parsing functions to use them correctly;
checking return value, using argp_error() to report parse errors etc.

* plugin-runner.c: Use <sysexits.h> exit codes.  Always use fallback,
                   even on option errors, except for "--help", etc.
  (getplugin): Make sure "errno" is set correctly on return.
  (main): Declare our own "--help", "--usage", and "--version"
          options which do not cause the fallback to be invoked.
          In all other options, use fallback on any error.
  (parse_opt, parse_opt_config_file): Reset errno at start and return
                                      errno.  No need to check "arg"
                                      for NULL.  New "--help",
                                      "--usage", and "--version"
                                      options.
  (parse_opt): Accept empty string as global option.  Do not print
               errors which will be detected and reported later.  Do
               "argp_error()" on parse error or empty plugin names.
* plugins.d/mandos-client.c: Use <sysexits.h> exit codes.  Do not
                             return successful exit code on "--help",
                             etc. since this would give the wrong
                             message to "plugin-runner".
  (main): Declare our own "--help", "--usage", and "--version"
          options which do not return a successful exit code.
  (parse_opt): Reset errno at start and return errno.  Do
               "argp_error()" on parse errors.  New "--help",
               "--usage", and "--version" options.
* plugins.d/password-prompt.c: Use exit codes from <sysexits.h>.  Do
                               not return successful exit code on
                               "--help", etc. since this would give
                               the wrong message to "plugin-runner".
  (main): Declare our own "--help", "--usage", and "--version" options
          which do not return a successful exit code.  Do
          close(STDOUT_FILENO) after writing to check its return code.
  (parse_opt): Reset errno at start and return errno.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="UTF-8"?>
2
2
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3
3
        "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4
 
<!ENTITY VERSION "1.0">
5
4
<!ENTITY COMMANDNAME "password-prompt">
6
 
<!ENTITY TIMESTAMP "2008-09-01">
 
5
<!ENTITY TIMESTAMP "2009-01-04">
 
6
<!ENTITY % common SYSTEM "../common.ent">
 
7
%common;
7
8
]>
8
9
 
9
10
<refentry xmlns:xi="http://www.w3.org/2001/XInclude">
11
12
    <title>Mandos Manual</title>
12
13
    <!-- NWalsh’s docbook scripts use this to generate the footer: -->
13
14
    <productname>Mandos</productname>
14
 
    <productnumber>&VERSION;</productnumber>
 
15
    <productnumber>&version;</productnumber>
15
16
    <date>&TIMESTAMP;</date>
16
17
    <authorgroup>
17
18
      <author>
31
32
    </authorgroup>
32
33
    <copyright>
33
34
      <year>2008</year>
 
35
      <year>2009</year>
34
36
      <holder>Teddy Hogeborn</holder>
35
37
      <holder>Björn Påhlsson</holder>
36
38
    </copyright>
83
85
    <title>DESCRIPTION</title>
84
86
    <para>
85
87
      All <command>&COMMANDNAME;</command> does is prompt for a
86
 
      password and output any given password to standard output.  This
87
 
      is not very useful on its own.  This program is really meant to
88
 
      run as a plugin in the <application>Mandos</application>
89
 
      client-side system, where it is used as a fallback and
90
 
      alternative to retriving passwords from a <application
91
 
      >Mandos</application> server.
 
88
      password and output any given password to standard output.
 
89
    </para>
 
90
    <para>
 
91
      This program is not very useful on its own.  This program is
 
92
      really meant to run as a plugin in the <application
 
93
      >Mandos</application> client-side system, where it is used as a
 
94
      fallback and alternative to retrieving passwords from a
 
95
      <application >Mandos</application> server.
92
96
    </para>
93
97
    <para>
94
98
      This program is little more than a <citerefentry><refentrytitle
240
244
      <para>
241
245
        Show a prefix before the prompt; in this case, a host name.
242
246
        It might be useful to be reminded of which host needs a
243
 
        password, in case of KVM switches, etc.
 
247
        password, in case of <acronym>KVM</acronym> switches, etc.
244
248
      </para>
245
249
      <para>
246
250
 
270
274
      >plugin-runner</refentrytitle><manvolnum>8mandos</manvolnum>
271
275
      </citerefentry>, and will, when run standalone, outside, in a
272
276
      normal environment, immediately output on its standard output
273
 
      any presumably secret password it just recieved.  Therefore,
 
277
      any presumably secret password it just received.  Therefore,
274
278
      when running this program standalone (which should never
275
279
      normally be done), take care not to type in any real secret
276
280
      password by force of habit, since it would then immediately be
290
294
    <para>
291
295
      <citerefentry><refentrytitle>crypttab</refentrytitle>
292
296
      <manvolnum>5</manvolnum></citerefentry>
293
 
      <citerefentry><refentrytitle>password-request</refentrytitle>
 
297
      <citerefentry><refentrytitle>mandos-client</refentrytitle>
294
298
      <manvolnum>8mandos</manvolnum></citerefentry>
295
299
      <citerefentry><refentrytitle>plugin-runner</refentrytitle>
296
300
      <manvolnum>8mandos</manvolnum></citerefentry>,