Imported Upstream version 0.63.0
[hcoop/debian/courier-authlib.git] / userdb / userdb.8.in
CommitLineData
d9898ee8 1.\" <!-- $Id: userdb.sgml,v 1.5 2007/04/22 15:05:16 mrsam Exp $ -->
2.\" <!-- Copyright 1998 - 2007 Double Precision, Inc. See COPYING for -->
3.\" <!-- distribution information. -->
4.\" Title: userdb
5.\" Author:
8d138742
CE
6.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
7.\" Date: 08/23/2008
d9898ee8 8.\" Manual: Double Precision, Inc.
9.\" Source: Double Precision, Inc.
10.\"
8d138742 11.TH "USERDB" "8" "08/23/2008" "Double Precision, Inc." "Double Precision, Inc."
d9898ee8 12.\" disable hyphenation
13.nh
14.\" disable justification (adjust text to left margin only)
15.ad l
16.SH "NAME"
8d138742 17userdb - manipulate @userdb@
d9898ee8 18.SH "SYNOPSIS"
19.HP 7
20\fBuserdb\fR {\fIaddr\fR} set {\fIfield\fR=\fIvalue\fR...}
21.HP 7
22\fBuserdb\fR {\fIaddr\fR} unset {\fIfield\fR...}
23.HP 7
24\fBuserdb\fR {\fIaddr\fR} del
25.HP 7
8d138742 26\fBuserdb\fR {\fIpath/addr\fR} [set | unset | del] \.\.\.
d9898ee8 27.HP 7
8d138742 28\fBuserdb\fR \-f {\fIfile\fR} {\fIadr\fR} [set | unset | del] \.\.\.
d9898ee8 29.HP 7
30\fBuserdb\fR \-show {\fIpath\fR}
31.HP 7
32\fBuserdb\fR \-show {\fIpath\fR} {\fIaddr\fR}
33.HP 7
34\fBuserdb\fR \-show \-f {\fIfile\fR}
35.HP 7
36\fBuserdb\fR \-show \-f {\fIfile\fR} {\fIaddr\fR}
37.SH "DESCRIPTION"
38.PP
39
40\fBuserdb\fR
41is a convenient script to individually manipulate entries in
8d138742 42\fI@userdb@\fR\. See
d9898ee8 43\fI\fBmakeuserdb\fR(8)\fR\&[1]
8d138742 44for a description of its contents\.
d9898ee8 45\fI@userdb@\fR
46can always be edited using any text editor, but
47\fBuserdb\fR
8d138742 48is a convenient way to modify this file from another script\.
d9898ee8 49.PP
50
51\fI@userdb@\fR
8d138742 52can also be a subdirectory, instead of a file\. Specify
d9898ee8 53\fB\fIfoo/bar/addr\fR\fR
54to manipulate
55\fB\fIaddr\fR\fR
56in the file
8d138742 57\fI@userdb@\fR\fI\fI/foo/bar\fR\fR\. You can also use the
d9898ee8 58\fB\-f\fR
59flag:
60\fB\-f \fR\fB\fI@userdb@/foo/bar\fR\fR
8d138742 61is equivalent\. Use whatever form makes the most sense to you\.
d9898ee8 62.PP
63
64\fI@userdb@\fR
8d138742 65must 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)\.
d9898ee8 66.PP
67Each line in
68\fI@userdb@\fR
69takes following form:
8d138742 70.PP \fIaddr\fR<TAB>\fIfield\fR=\fIvalue\fR|\fIfield\fR=\fIvalue\fR\.\.\.
d9898ee8 71.PP
72
73\fIaddr\fR
8d138742 74specifies a unique virtual address\. It is followed by a single tab character, then a list of
d9898ee8 75\fIfield\fR=\fIvalue\fR
8d138742 76pairs, separated by vertical slash characters\. See
d9898ee8 77\fI\fBmakeuserdb\fR(8)\fR\&[1]
8d138742 78for field definitions\.
d9898ee8 79.PP
80A text editor can be used to add blank lines or comments in
8d138742 81\fI@userdb@\fR\. Any blank lines or comments are ignored by the
d9898ee8 82\fBuserdb\fR
8d138742 83script\.
d9898ee8 84.PP
85The names of the actual fields, and their contents, are defined entirely by applications that use the
86\fI@userdb@\fR
87database, the
88\fBuserdb\fR
8d138742 89command just adds or removes arbitrary fields\.
d9898ee8 90.PP
91For example:
92.sp
93.RS 4
94.nf
95\fBuserdb default/info set mail=/home/mail/info\fR
96.fi
97.RE
98.PP
99This command accesses the address "info" in
8d138742 100\fI@userdb@/default\fR\.
d9898ee8 101.PP
102If the second argument to
103\fBuserdb\fR
104is "\fIset\fR", the remaining arguments are taken as
105\fI\fIfield\fR\fR\fI=\fR\fI\fIvalue\fR\fR
106pairs, which are added to the record for
8d138742
CE
107\fIaddr\fR\. If there is no record for
108\fIaddr\fR, a new record will be appended to the file\. If
d9898ee8 109\fIaddr\fR
8d138742 110exists, any existing values of any specified fields are removed\. If
d9898ee8 111\fI=\fR\fI\fIvalue\fR\fR
112is missing,
113\fBuserdb\fR
8d138742 114stops 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
d9898ee8 115\fBps\fR(1)
8d138742 116command\. If
d9898ee8 117\fBuserdb\fR
8d138742 118is being executed by a script, the value can be provided on standard input\.
d9898ee8 119.PP
8d138742 120Use "\fIunset\fR" to delete fields from an existing record\. Use "\fIdel\fR" to delete all fields in the existing record, plus the record itself\.
d9898ee8 121.SS "DISPLAYING \fI@userdb@\fR"
122.PP
123If the first argument to userdb is
124\fI\-show\fR,
125\fBuserdb\fR
126displays the contents of
8d138742 127\fI@userdb@\fR\. If
d9898ee8 128\fI@userdb@\fR
129is a subdirectory,
130\fI\fIpath\fR\fR
131must refer to a specific file in
8d138742 132\fI@userdb@\fR\. The
d9898ee8 133\fI\-f\fR
134option can be used instead of
135\fI\fIpath\fR\fR
8d138742 136in order to specify an arbitrary file\.
d9898ee8 137.PP
138If
139\fI\fIaddr\fR\fR
140is not specified,
141\fBuserdb\fR
8d138742 142produces a list, on standard output, containing all addresses found in the file, on per line\. If
d9898ee8 143\fI\fIaddr\fR\fR
144is specified,
145\fBuserdb\fR
146produces a list, on standard output, of all the fields in
147\fI@userdb@\fR
148for this
8d138742
CE
149\fI\fIaddr\fR\fR\.
150.SS "REBUILDING \fI@userdb@\.dat\fR"
d9898ee8 151.PP
152The actual virtual account/address database is
8d138742 153\fI@userdb@\.dat\fR\. This is a binary database file\.
d9898ee8 154\fB@userdb@\fR
8d138742 155is the plain text version\. After running
d9898ee8 156\fBuserdb\fR, execute the
157\fI\fBmakeuserdb\fR(8)\fR\&[1]
158command to rebuild
8d138742
CE
159\fI@userdb@\.dat\fR
160for the changes to take effect\.
d9898ee8 161.SH "BUGS"
162.PP
163
164\fI\fIaddr\fR\fR
8d138742 165must be unique\. If
d9898ee8 166\fI@userdb@\fR
8d138742 167is a subdirectory, it\'s possible to create the same
d9898ee8 168\fI\fIaddr\fR\fR
8d138742 169in different files in the subdirectory\. This is an error that is not currently detected by
d9898ee8 170\fBuserdb\fR, however the subsequent
171\fI\fBmakeuserdb\fR(8)\fR\&[1]
8d138742 172command will fail with an error message\.
d9898ee8 173.SH "FILES"
174.PP
175
176\fI @userdb@\fR
177\- plain text file, or directory of plain text files
178.PP
179
8d138742 180\fI \.lock\.filename\fR
d9898ee8 181\- lock file for
182\fIfilename\fR
183.PP
184
8d138742 185\fI \.tmp\.filename\fR
d9898ee8 186\- temporary file used to create new contents of
187\fIfilename\fR
188.SH "SEE ALSO"
189.PP
190
191\fI\fBmakeuserdb\fR(8)\fR\&[1],
192\fI\fBuserdbpw\fR(8)\fR\&[2]
8d138742 193.SH "NOTES"
d9898ee8 194.IP " 1." 4
195\fBmakeuserdb\fR(8)
196.RS 4
197\%makeuserdb.html
198.RE
199.IP " 2." 4
200\fBuserdbpw\fR(8)
201.RS 4
202\%userdbpw.html
203.RE