1.\" Copyright (c) 1992 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)cap_mkdb.1 5.4 (Berkeley) 03/06/93 7.\" 8.Dd "" 9.Dt CAP_MKDB 1 10.Os 11.Sh NAME 12.Nm cap_mkdb 13.Nd create capability database 14.Pp 15.Sh SYNOPSIS 16.Nm cap_mkdb 17.Op Fl v 18.Op Fl f Ar outfile 19.Ar file1 20.Op Ar file2 ... 21.Pp 22.Sh DESCRIPTION 23.Nm Cap_mkdb 24builds a hashed database out of the 25.Xr getcap 3 26logical database constructed by the concatenation of the specified 27files . 28.Pp 29The database is named by the basename of the first file argument and 30the string 31.Dq .db . 32The 33.Xr getcap 3 34routines can access the database in this form much more quickly 35than they can the original text file(s). 36.Pp 37The ``tc'' capabilities of the records are expanded before the 38record is stored into the database. 39.Pp 40The options as as follows: 41.Bl -tag -width XXXXXX -indent 42.It Fl f Ar outfile 43Specify a different database basename. 44.It Fl v 45Print out the number of capability records in the database. 46.El 47.Pp 48.Sh FORMAT 49Each record is stored in the database using two different types of keys. 50.Pp 51The first type is a key which consists of the first capability of 52the record (not including the trailing colon (``:'')) with a data 53field consisting of a special byte followed by the rest of the record. 54The special byte is either a 0 or 1, where a 0 means that the record 55is okay, and a 1 means that there was a ``tc'' capability in the record 56that couldn't be expanded. 57.Pp 58The second type is a key which consists of one of the names from the 59first capability of the record with a data field consisting a special 60byte followed by the the first capability of the record. 61The special byte is a 2. 62.Pp 63In normal operation names are looked up in the database, resulting 64in a key/data pair of the second type. 65The data field of this key/data pair is used to look up a key/data 66pair of the first type which has the real data associated with the 67name. 68.Sh RETURN VALUE 69The 70.Nm cap_mkdb 71utility exits 0 on success and >0 if an error occurs. 72.Sh SEE ALSO 73.Xr dbopen 3 , 74.Xr getcap 3 , 75.Xr termcap 5 76