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