Annotation of src/usr.bin/cap_mkdb/cap_mkdb.1, Revision 1.10
1.10 ! aaron 1: .\" $OpenBSD: cap_mkdb.1,v 1.9 1999/07/02 20:11:44 aaron Exp $
1.1 deraadt 2: .\" $NetBSD: cap_mkdb.1,v 1.4 1995/03/26 03:59:36 glass Exp $
3: .\"
4: .\" Copyright (c) 1992, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
15: .\" 3. All advertising materials mentioning features or use of this software
16: .\" must display the following acknowledgement:
17: .\" This product includes software developed by the University of
18: .\" California, Berkeley and its contributors.
19: .\" 4. Neither the name of the University nor the names of its contributors
20: .\" may be used to endorse or promote products derived from this software
21: .\" without specific prior written permission.
22: .\"
23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: .\" SUCH DAMAGE.
34: .\"
35: .\" @(#)cap_mkdb.1 8.1 (Berkeley) 6/6/93
36: .\"
1.9 aaron 37: .Dd June 6, 1993
1.1 deraadt 38: .Dt CAP_MKDB 1
39: .Os
40: .Sh NAME
41: .Nm cap_mkdb
42: .Nd create capability database
43: .Sh SYNOPSIS
44: .Nm cap_mkdb
1.7 tholo 45: .Op Fl i
1.1 deraadt 46: .Op Fl v
47: .Op Fl f Ar outfile
48: .Ar file1
49: .Op Ar file2 ...
50: .Sh DESCRIPTION
1.8 aaron 51: .Nm
1.1 deraadt 52: builds a hashed database out of the
1.8 aaron 53: .Xr getcap 3
1.7 tholo 54: or
55: .Xr terminfo 5
1.1 deraadt 56: logical database constructed by the concatenation of the specified
1.5 aaron 57: files.
1.1 deraadt 58: .Pp
59: The database is named by the basename of the first file argument and
60: the string
1.8 aaron 61: .Dq .db .
1.1 deraadt 62: The
63: .Xr getcap 3
64: routines can access the database in this form much more quickly
65: than they can the original text file(s).
66: .Pp
1.8 aaron 67: The
68: .Dq tc
69: capabilities of the records are expanded before the
1.1 deraadt 70: record is stored into the database.
71: .Pp
1.5 aaron 72: The options are as follows:
1.1 deraadt 73: .Bl -tag -width XXXXXX -indent
74: .It Fl f Ar outfile
75: Specify a different database basename.
1.7 tholo 76: .It Fl i
77: Expect the capability records to be parsed to be in
78: .Xr terminfo 5
79: format.
1.1 deraadt 80: .It Fl v
81: Print out the number of capability records in the database.
82: .El
83: .Sh FORMAT
84: Each record is stored in the database using two different types of keys.
85: .Pp
86: The first type is a key which consists of the first capability of
1.6 aaron 87: the record (not including the trailing colon
1.10 ! aaron 88: .Pq Ql \&: )
1.6 aaron 89: with a data
1.1 deraadt 90: field consisting of a special byte followed by the rest of the record.
91: The special byte is either a 0 or 1, where a 0 means that the record
1.8 aaron 92: is okay, and a 1 means that there was a
93: .Dq tc
94: capability in the record
1.1 deraadt 95: that couldn't be expanded.
96: .Pp
97: The second type is a key which consists of one of the names from the
98: first capability of the record with a data field consisting a special
1.3 deraadt 99: byte followed by the first capability of the record.
1.1 deraadt 100: The special byte is a 2.
101: .Pp
102: In normal operation names are looked up in the database, resulting
103: in a key/data pair of the second type.
104: The data field of this key/data pair is used to look up a key/data
105: pair of the first type which has the real data associated with the
106: name.
107: .Sh RETURN VALUE
108: The
1.8 aaron 109: .Nm
1.6 aaron 110: utility exits 0 on success or >0 if an error occurred.
1.1 deraadt 111: .Sh SEE ALSO
112: .Xr dbopen 3 ,
113: .Xr getcap 3 ,
1.7 tholo 114: .Xr termcap 5 ,
115: .Xr terminfo 5