Imported Upstream version 0.63.0
[hcoop/debian/courier-authlib.git] / userdb / userdb.html.in
CommitLineData
d9898ee8 1<?xml version="1.0"?>
8d138742 2<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>userdb</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"/><link rel="start" href="#userdb" title="userdb"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--
d9898ee8 3
4Copyright 1998 - 2007 Double Precision, Inc. See COPYING for distribution
5information.
6
8d138742
CE
7--></head><body><div class="refentry" lang="en" xml:lang="en"><a id="userdb" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>userdb — manipulate @userdb@</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">userdb</code> {<em class="replaceable"><code>addr</code></em>} set {<em class="replaceable"><code>field</code></em>=<em class="replaceable"><code>value</code></em>...}</p></div><div class="cmdsynopsis"><p><code class="command">userdb</code> {<em class="replaceable"><code>addr</code></em>} unset {<em class="replaceable"><code>field</code></em>...}</p></div><div class="cmdsynopsis"><p><code class="command">userdb</code> {<em class="replaceable"><code>addr</code></em>} del </p></div><div class="cmdsynopsis"><p><code class="command">userdb</code> {<em class="replaceable"><code>path/addr</code></em>} [ set | unset | del ] ... </p></div><div class="cmdsynopsis"><p><code class="command">userdb</code> -f {<em class="replaceable"><code>file</code></em>} {<em class="replaceable"><code>adr</code></em>} [ set | unset | del ] ... </p></div><div class="cmdsynopsis"><p><code class="command">userdb</code> -show {<em class="replaceable"><code>path</code></em>}</p></div><div class="cmdsynopsis"><p><code class="command">userdb</code> -show {<em class="replaceable"><code>path</code></em>} {<em class="replaceable"><code>addr</code></em>}</p></div><div class="cmdsynopsis"><p><code class="command">userdb</code> -show -f {<em class="replaceable"><code>file</code></em>}</p></div><div class="cmdsynopsis"><p><code class="command">userdb</code> -show -f {<em class="replaceable"><code>file</code></em>} {<em class="replaceable"><code>addr</code></em>}</p></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="id436393" shape="rect"> </a><h2>DESCRIPTION</h2><p>
8<span class="command"><strong>userdb</strong></span> is a convenient script to individually manipulate
d9898ee8 9entries in <code class="filename">@userdb@</code>. See
8d138742 10<a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a>
d9898ee8 11for a description of its contents. <code class="filename">@userdb@</code> can always
8d138742 12be edited using any text editor, but <span class="command"><strong>userdb</strong></span> is a
d9898ee8 13convenient way to modify this file from another script.</p><p>
14<code class="filename">@userdb@</code> can also be a subdirectory, instead of a file.
15Specify <code class="option"><em class="replaceable"><code>foo/bar/addr</code></em></code> to manipulate
16<code class="option"><em class="replaceable"><code>addr</code></em></code> in the file
17<code class="filename">@userdb@<em class="replaceable"><code>/foo/bar</code></em></code>. You can
18also use the
19<code class="option">-f</code> flag: <code class="option">-f
20<em class="replaceable"><code>@userdb@/foo/bar</code></em></code> is equivalent. Use
21whatever form makes the most sense to you.</p><p>
22<code class="filename">@userdb@</code> must not have any group or world
23permissions. That's
24because its contents may include system passwords (depending upon the
25application which uses this virtual user account database).</p><p>
26Each line in <code class="filename">@userdb@</code> takes following form:
27</p><div class="blockquote"><blockquote class="blockquote"><p>
28<code class="computeroutput">
29<em class="replaceable"><code>addr</code></em><span class="token">&lt;TAB&gt;</span><em class="replaceable"><code>field</code></em>=<em class="replaceable"><code>value</code></em>|<em class="replaceable"><code>field</code></em>=<em class="replaceable"><code>value</code></em>...
30</code></p></blockquote></div><p>
31<em class="replaceable"><code>addr</code></em> specifies a unique virtual address. It
32is followed by a single
33tab character, then a list of
34<em class="replaceable"><code>field</code></em>=<em class="replaceable"><code>value</code></em> pairs,
35separated by
36vertical slash characters. See
8d138742 37<a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a>
d9898ee8 38for field definitions.</p><p>
39A text editor can be used to add blank lines or comments in
40<code class="filename">@userdb@</code>. Any blank lines or comments are ignored by the
8d138742 41<span class="command"><strong>userdb</strong></span> script.</p><p>
d9898ee8 42The names of the actual fields, and their contents, are defined entirely by
43applications that use the <code class="filename">@userdb@</code> database, the
8d138742
CE
44<span class="command"><strong>userdb</strong></span> command just adds or removes arbitrary fields.</p><p>
45For example:</p><div class="blockquote"><blockquote class="blockquote"><div class="informalexample"><div class="literallayout"><p><span class="command"><strong>userdb default/info set mail=/home/mail/info</strong></span></p></div></div></blockquote></div><p>
d9898ee8 46This command accesses the address "info" in
47<code class="filename">@userdb@/default</code>.</p><p>
8d138742 48If the second argument to <span class="command"><strong>userdb</strong></span> is
d9898ee8 49"<em class="parameter"><code>set</code></em>", the
50remaining arguments are taken as
51<em class="parameter"><code><em class="replaceable"><code>field</code></em>=<em class="replaceable"><code>value</code></em></code></em> pairs, which are
52added to the record for <em class="replaceable"><code>addr</code></em>. If there is no
53record for <em class="replaceable"><code>addr</code></em>, a
54new record will be appended to the file. If
55<em class="replaceable"><code>addr</code></em> exists, any existing
56values of any specified fields are removed. If
57<em class="parameter"><code>=<em class="replaceable"><code>value</code></em></code></em> is missing,
8d138742 58<span class="command"><strong>userdb</strong></span> stops and prompts for it. This is useful if
d9898ee8 59you're setting
60a password field, where you do not want to specify the password on the command
61line, which can be seen by the
62<span class="citerefentry"><span class="refentrytitle">ps</span>(1)</span>
8d138742 63command. If <span class="command"><strong>userdb</strong></span> is being
d9898ee8 64executed by a script, the value can be provided on standard input.</p><p>Use "<em class="parameter"><code>unset</code></em>" to delete fields from an existing
65record. Use
66"<em class="parameter"><code>del</code></em>" to delete all fields in the existing record,
8d138742 67plus the record itself.</p><div class="refsect2" lang="en" xml:lang="en"><a id="id480874" shape="rect"> </a><h3>DISPLAYING <code class="filename">@userdb@</code></h3><p>
d9898ee8 68If the first argument to userdb
8d138742 69is <em class="parameter"><code>-show</code></em>, <span class="command"><strong>userdb</strong></span>
d9898ee8 70displays the contents of <code class="filename">@userdb@</code>. If
71<code class="filename">@userdb@</code> is a
72subdirectory,
73<em class="parameter"><code><em class="replaceable"><code>path</code></em></code></em> must refer to a
74specific file in <code class="filename">@userdb@</code>. The
75<em class="parameter"><code>-f</code></em> option can be used instead of
76<em class="parameter"><code><em class="replaceable"><code>path</code></em></code></em> in order to specify an
77arbitrary file.</p><p>
78If
79<em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em> is not specified,
8d138742 80<span class="command"><strong>userdb</strong></span> produces a list, on standard
d9898ee8 81output, containing all addresses found in the file, on per line. If
82<em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em> is specified,
8d138742 83<span class="command"><strong>userdb</strong></span> produces a list, on standard output, of
d9898ee8 84all the fields in <code class="filename">@userdb@</code> for this
8d138742 85<em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em>.</p></div><div class="refsect2" lang="en" xml:lang="en"><a id="id480969" shape="rect"> </a><h3>REBUILDING <code class="filename">@userdb@.dat</code></h3><p>
d9898ee8 86The actual virtual account/address database is
87<code class="filename">@userdb@.dat</code>.
8d138742
CE
88This is a binary database file. <span class="command"><strong>@userdb@</strong></span> is the plain text
89version. After running <span class="command"><strong>userdb</strong></span>, execute the
90<a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a> command to rebuild
91<code class="filename">@userdb@.dat</code> for the changes to take effect.</p></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="id481014" shape="rect"> </a><h2>BUGS</h2><p>
d9898ee8 92<em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em> must be unique.
93If <code class="filename">@userdb@</code> is a subdirectory,
94it's possible to create the same
95<em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em>
96in different files in the subdirectory.
8d138742 97This is an error that is not currently detected by <span class="command"><strong>userdb</strong></span>,
d9898ee8 98however the subsequent
8d138742
CE
99<a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a> command
100will fail with an error message.</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id481057" shape="rect"> </a><h2>FILES</h2><p>
d9898ee8 101<code class="filename"> @userdb@</code> - plain text file, or directory of plain text files</p><p>
102<code class="filename"> .lock.filename</code> - lock file for <code class="filename">filename</code></p><p>
8d138742
CE
103<code class="filename"> .tmp.filename</code> - temporary file used to create new contents of <code class="filename">filename</code></p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id481097" shape="rect"> </a><h2>SEE ALSO</h2><p>
104<a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a>,
d9898ee8 105
8d138742 106<a class="ulink" href="userdbpw.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">userdbpw</span>(8)</span></a></p></div></div></body></html>