Commit | Line | Data |
---|---|---|
d9898ee8 | 1 | <?xml version="1.0"?> |
b0322a85 | 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" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/><link rel="home" 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 | |
b0322a85 | 4 | Copyright 1998 - 2009 Double Precision, Inc. See COPYING for distribution |
d9898ee8 | 5 | information. |
6 | ||
d50284c4 | 7 | --></head><body><div class="refentry"><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"><a id="idm255234219424" shape="rect"> </a><h2>DESCRIPTION</h2><p> |
8d138742 | 8 | <span class="command"><strong>userdb</strong></span> is a convenient script to individually manipulate |
d9898ee8 | 9 | entries 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 | 11 | for a description of its contents. <code class="filename">@userdb@</code> can always |
8d138742 | 12 | be edited using any text editor, but <span class="command"><strong>userdb</strong></span> is a |
d9898ee8 | 13 | convenient 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. | |
15 | Specify <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 | |
18 | also 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 | |
21 | whatever form makes the most sense to you.</p><p> | |
22 | <code class="filename">@userdb@</code> must not have any group or world | |
23 | permissions. That's | |
24 | because its contents may include system passwords (depending upon the | |
25 | application which uses this virtual user account database).</p><p> | |
b0322a85 | 26 | Each line in <code class="filename">@userdb@</code> takes following form:</p><div class="blockquote"><blockquote class="blockquote"><code class="computeroutput"> |
d9898ee8 | 27 | <em class="replaceable"><code>addr</code></em><span class="token"><TAB></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>... |
b0322a85 | 28 | </code></blockquote></div><p> |
d9898ee8 | 29 | <em class="replaceable"><code>addr</code></em> specifies a unique virtual address. It |
30 | is followed by a single | |
31 | tab character, then a list of | |
32 | <em class="replaceable"><code>field</code></em>=<em class="replaceable"><code>value</code></em> pairs, | |
33 | separated by | |
34 | vertical slash characters. See | |
8d138742 | 35 | <a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a> |
d9898ee8 | 36 | for field definitions.</p><p> |
37 | A text editor can be used to add blank lines or comments in | |
38 | <code class="filename">@userdb@</code>. Any blank lines or comments are ignored by the | |
8d138742 | 39 | <span class="command"><strong>userdb</strong></span> script.</p><p> |
d9898ee8 | 40 | The names of the actual fields, and their contents, are defined entirely by |
41 | applications that use the <code class="filename">@userdb@</code> database, the | |
8d138742 CE |
42 | <span class="command"><strong>userdb</strong></span> command just adds or removes arbitrary fields.</p><p> |
43 | For 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 | 44 | This command accesses the address "info" in |
45 | <code class="filename">@userdb@/default</code>.</p><p> | |
8d138742 | 46 | If the second argument to <span class="command"><strong>userdb</strong></span> is |
d9898ee8 | 47 | "<em class="parameter"><code>set</code></em>", the |
48 | remaining arguments are taken as | |
49 | <em class="parameter"><code><em class="replaceable"><code>field</code></em>=<em class="replaceable"><code>value</code></em></code></em> pairs, which are | |
50 | added to the record for <em class="replaceable"><code>addr</code></em>. If there is no | |
51 | record for <em class="replaceable"><code>addr</code></em>, a | |
52 | new record will be appended to the file. If | |
53 | <em class="replaceable"><code>addr</code></em> exists, any existing | |
54 | values of any specified fields are removed. If | |
55 | <em class="parameter"><code>=<em class="replaceable"><code>value</code></em></code></em> is missing, | |
8d138742 | 56 | <span class="command"><strong>userdb</strong></span> stops and prompts for it. This is useful if |
d9898ee8 | 57 | you're setting |
58 | a password field, where you do not want to specify the password on the command | |
59 | line, which can be seen by the | |
60 | <span class="citerefentry"><span class="refentrytitle">ps</span>(1)</span> | |
8d138742 | 61 | command. If <span class="command"><strong>userdb</strong></span> is being |
d9898ee8 | 62 | executed 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 |
63 | record. Use | |
64 | "<em class="parameter"><code>del</code></em>" to delete all fields in the existing record, | |
d50284c4 | 65 | plus the record itself.</p><div class="refsect2"><a id="idm255234187376" shape="rect"> </a><h3>DISPLAYING <code class="filename">@userdb@</code></h3><p> |
d9898ee8 | 66 | If the first argument to userdb |
8d138742 | 67 | is <em class="parameter"><code>-show</code></em>, <span class="command"><strong>userdb</strong></span> |
d9898ee8 | 68 | displays the contents of <code class="filename">@userdb@</code>. If |
69 | <code class="filename">@userdb@</code> is a | |
70 | subdirectory, | |
71 | <em class="parameter"><code><em class="replaceable"><code>path</code></em></code></em> must refer to a | |
72 | specific file in <code class="filename">@userdb@</code>. The | |
73 | <em class="parameter"><code>-f</code></em> option can be used instead of | |
74 | <em class="parameter"><code><em class="replaceable"><code>path</code></em></code></em> in order to specify an | |
75 | arbitrary file.</p><p> | |
76 | If | |
77 | <em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em> is not specified, | |
8d138742 | 78 | <span class="command"><strong>userdb</strong></span> produces a list, on standard |
d9898ee8 | 79 | output, containing all addresses found in the file, on per line. If |
80 | <em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em> is specified, | |
8d138742 | 81 | <span class="command"><strong>userdb</strong></span> produces a list, on standard output, of |
d9898ee8 | 82 | all the fields in <code class="filename">@userdb@</code> for this |
d50284c4 | 83 | <em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em>.</p></div><div class="refsect2"><a id="idm255234175984" shape="rect"> </a><h3>REBUILDING <code class="filename">@userdb@.dat</code></h3><p> |
d9898ee8 | 84 | The actual virtual account/address database is |
85 | <code class="filename">@userdb@.dat</code>. | |
8d138742 CE |
86 | This is a binary database file. <span class="command"><strong>@userdb@</strong></span> is the plain text |
87 | version. After running <span class="command"><strong>userdb</strong></span>, execute the | |
88 | <a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a> command to rebuild | |
d50284c4 | 89 | <code class="filename">@userdb@.dat</code> for the changes to take effect.</p></div></div><div class="refsect1"><a id="idm255234170576" shape="rect"> </a><h2>BUGS</h2><p> |
d9898ee8 | 90 | <em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em> must be unique. |
91 | If <code class="filename">@userdb@</code> is a subdirectory, | |
92 | it's possible to create the same | |
93 | <em class="parameter"><code><em class="replaceable"><code>addr</code></em></code></em> | |
94 | in different files in the subdirectory. | |
8d138742 | 95 | This is an error that is not currently detected by <span class="command"><strong>userdb</strong></span>, |
d9898ee8 | 96 | however the subsequent |
8d138742 | 97 | <a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a> command |
d50284c4 | 98 | will fail with an error message.</p></div><div class="refsect1"><a id="idm255234165424" shape="rect"> </a><h2>FILES</h2><p> |
d9898ee8 | 99 | <code class="filename"> @userdb@</code> - plain text file, or directory of plain text files</p><p> |
100 | <code class="filename"> .lock.filename</code> - lock file for <code class="filename">filename</code></p><p> | |
d50284c4 | 101 | <code class="filename"> .tmp.filename</code> - temporary file used to create new contents of <code class="filename">filename</code></p></div><div class="refsect1"><a id="idm255234160640" shape="rect"> </a><h2>SEE ALSO</h2><p> |
8d138742 | 102 | <a class="ulink" href="makeuserdb.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">makeuserdb</span>(8)</span></a>, |
d9898ee8 | 103 | |
8d138742 | 104 | <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> |