File: userdb.html

package info (click to toggle)
maildrop 0.75-2.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,760 kB
  • ctags: 1,588
  • sloc: cpp: 9,269; ansic: 6,018; perl: 786; sh: 467; makefile: 398
file content (152 lines) | stat: -rw-r--r-- 5,468 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
   "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>userdb - manipulate /etc/userdb</title>

<!-- $Id: userdb.html.in,v 1.5 1999/09/07 22:46:27 mrsam Exp $ -->

<!-- SECTION 8 -->
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B"
alink="#FF0000">

<h1>userdb - manipulate /etc/userdb</h1>

<h2>SYNOPSIS</h2>
<pre>userdb <i>addr</i> set <i>field</i>=<i>value</i> <i>field</i>=<i>value</i>...

userdb <i>addr</i> unset <i>field</i> <i>field</i>...

userdb <i>addr</i> del

userdb <i>path/addr</i> (set | unset | del) ...

userdb -f <i>file</i> <i>addr</i> (set | unset | del) ...

userdb -show <i>path</i>

userdb -show <i>path</i> <i>addr</i>

userdb -show -f <i>file</i>

userdb -show -f <i>file</i> <i>addr</i></pre>

<br>


<h2>DESCRIPTION</h2>

<p>The <tt>userdb</tt> command is a convenient script to individually
manipulate entries in <tt>/etc/userdb</tt>. See <a
href="makeuserdb.html">makeuserdb(8)</a> for a description of its contents.
<tt>/etc/userdb</tt> can always be edited using any text editor, the
<tt>userdb</tt> command allows a convenient way to modify this file from
another script.</p>

<p><tt>/etc/userdb</tt> can also be a subdirectory, instead of a file. Specify
<i>foo/bar/addr</i> to manipulate <i>addr</i> in the file
<tt>/etc/userdb/<i>foo/bar</i></tt>.  You can also use the -f flag: <i>-f
/etc/userdb/foo/bar</i> is equivalent.  Use whatever form makes the most sense to
you.</p>

<p><tt>/etc/userdb</tt> must not have any group or world permissions. That's
because its contents may include system passwords (depending upon the
application which uses this virtual user account database).</p>

<p>Each line in <tt>/etc/userdb</tt> takes following form:<br>
<br>
</p>
<pre><i>addr</i>&lt;TAB><i>field</i>=<i>value</i>|<i>field</i>=<i>value</i>...</pre>

<p><i>addr</i> specifies a unique virtual address. It is followed by a single
tab character, then a list of <i>field</i>=<i>value</i> pairs, separated by
vertical slash characters. See <a href="makeuserdb.html">makeuserdb(8)</a> for
definitions of fields.</p>

<p>A text editor can be used to add blank lines or comments in
<tt>/etc/userdb</tt>.  Any blank lines or comments are ignored by the
<tt>userdb</tt> script.</p>

<p>The names of the actual fields, and their contents, are defined entirely by
applications that use the <tt>/etc/userdb</tt> database, the <tt>userdb</tt>
command just adds or removes arbitrary fields.</p>

<p>For example:<br>
<br>
</p>
<pre>userdb default/info set mail=/home/mail/info<br>

</pre>

<p>This command accesses the address "<i>info</i>" in
<tt>/etc/userdb/default</tt>.</p>

<p>If the second argument to <tt>userdb</tt> is "<i>set</i>", the remaining
arguments are taken as <i>field</i>=<i>value</i> pairs, which are added to the
record for <i>addr</i>. If there is no record for <i>addr</i>, a new record
will be appended to the file. If <i>addr</i> exists, any existing values of
any specified fields are removed. If <i>=value</i> is missing, <tt>userdb</tt>
stops and prompts for it. This is useful if you're setting a password field,
where you do not want to specify the password on the command line, which can
be seen by the ps(1) command. If <tt>userdb</tt> is being executed by a
script, the value can be provided on standard input.</p>

<p>Use "<i>unset</i>" to delete fields from an existing record. Use
"<i>del</i>" to delete all fields in the existing record, plus the record
itself.</p>

<h2>DISPLAYING /etc/userdb</h2>

<p>If the first argument to userdb is <tt>-show</tt>, <tt>userdb</tt> displays
the contents of <tt>/etc/userdb</tt>. If <tt>/etc/userdb</tt> is a subdirectory path
must refer to a specific file in <tt>/etc/userdb</tt>. The -f option can be used
instead of <tt>path</tt> in order to specify an arbitrary file.</p>

<p>If <tt>addr</tt> is not specified, userdb produces a list, on standard
output, containing all addresses found in the file, on per line. If
<tt>addr</tt> is specified, userdb produces a list, on standard output, of all
the fields in the record for this <tt>addr</tt>.</p>

<h2>REBUILDING /etc/userdb.dat</h2>

<p>The actual virtual account/address database is <tt>/etc/userdb.dat</tt>.  This
is a binary database file. <tt>/etc/userdb</tt> is the plain text version. After
running <i>userdb</i>, execute the <a href="makeuserdb.html">makeuserdb(8)</a>
command to rebuild <tt>/etc/userdb.dat</tt> and have any changes take effect.</p>

<h2>BUGS</h2>

<p><i>addr</i> must be unique. When <tt>/etc/userdb</tt> is a subdirectory, it's
possible to create the same <i>addr</i> in different files in this
subdirectory. This is an error that is not currently detected. Only one of the
duplicate entries will take effect after executing <a
href="makeuserdb.html">makeuserdb(8)</a>. Each time <a
href="makeuserdb.html">makeuserdb(8)</a> is executed a different duplicate
entry may become the active one.</p>

<h2>FILES</h2>
<ul>
<li>
<tt>/etc/userdb</tt> - plain text file, or directory of plain text files<br>
<br>

</li>
<li>
<tt>.lock.filename</tt> - lock file for <tt>filename<br>
<br>
</tt>
</li>
<li>
<tt>.tmp.filename</tt> - temporary file used to create new contents of
<tt>filename</tt>
</li>
</ul>

<h2>SEE ALSO</h2>

<a href="makeuserdb.html">makeuserdb(8)</a>, <a
href="userdbpw.html">userdbpw(8)</a>
</body>
</html>