[BACK]Return to cap_mkdb.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / cap_mkdb

Annotation of src/usr.bin/cap_mkdb/cap_mkdb.1, Revision 1.20

1.20    ! jmc         1: .\"    $OpenBSD: cap_mkdb.1,v 1.19 2015/12/04 13:58:09 nicm 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.
1.13      millert    15: .\" 3. Neither the name of the University nor the names of its contributors
1.1       deraadt    16: .\"    may be used to endorse or promote products derived from this software
                     17: .\"    without specific prior written permission.
                     18: .\"
                     19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     22: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     29: .\" SUCH DAMAGE.
                     30: .\"
                     31: .\"    @(#)cap_mkdb.1  8.1 (Berkeley) 6/6/93
                     32: .\"
1.20    ! jmc        33: .Dd $Mdocdate: December 4 2015 $
1.1       deraadt    34: .Dt CAP_MKDB 1
                     35: .Os
                     36: .Sh NAME
                     37: .Nm cap_mkdb
                     38: .Nd create capability database
                     39: .Sh SYNOPSIS
                     40: .Nm cap_mkdb
1.20    ! jmc        41: .Op Fl v
1.1       deraadt    42: .Op Fl f Ar outfile
                     43: .Ar file1
                     44: .Op Ar file2 ...
                     45: .Sh DESCRIPTION
1.8       aaron      46: .Nm
1.1       deraadt    47: builds a hashed database out of the
1.8       aaron      48: .Xr getcap 3
1.1       deraadt    49: logical database constructed by the concatenation of the specified
1.5       aaron      50: files.
1.1       deraadt    51: .Pp
                     52: The database is named by the basename of the first file argument and
                     53: the string
1.8       aaron      54: .Dq .db .
1.1       deraadt    55: The
                     56: .Xr getcap 3
                     57: routines can access the database in this form much more quickly
                     58: than they can the original text file(s).
                     59: .Pp
1.8       aaron      60: The
                     61: .Dq tc
                     62: capabilities of the records are expanded before the
1.1       deraadt    63: record is stored into the database.
                     64: .Pp
1.5       aaron      65: The options are as follows:
1.12      aaron      66: .Bl -tag -width Ds
1.1       deraadt    67: .It Fl f Ar outfile
                     68: Specify a different database basename.
                     69: .It Fl v
                     70: Print out the number of capability records in the database.
                     71: .El
1.11      aaron      72: .Pp
1.1       deraadt    73: Each record is stored in the database using two different types of keys.
                     74: .Pp
                     75: The first type is a key which consists of the first capability of
1.6       aaron      76: the record (not including the trailing colon
1.10      aaron      77: .Pq Ql \&: )
1.6       aaron      78: with a data
1.1       deraadt    79: field consisting of a special byte followed by the rest of the record.
                     80: The special byte is either a 0 or 1, where a 0 means that the record
1.8       aaron      81: is okay, and a 1 means that there was a
                     82: .Dq tc
                     83: capability in the record
1.1       deraadt    84: that couldn't be expanded.
                     85: .Pp
                     86: The second type is a key which consists of one of the names from the
                     87: first capability of the record with a data field consisting a special
1.3       deraadt    88: byte followed by the first capability of the record.
1.1       deraadt    89: The special byte is a 2.
                     90: .Pp
                     91: In normal operation names are looked up in the database, resulting
                     92: in a key/data pair of the second type.
                     93: The data field of this key/data pair is used to look up a key/data
                     94: pair of the first type which has the real data associated with the
                     95: name.
1.17      jmc        96: .Sh EXIT STATUS
                     97: .Ex -std cap_mkdb
1.1       deraadt    98: .Sh SEE ALSO
                     99: .Xr dbopen 3 ,
                    100: .Xr getcap 3 ,
1.19      nicm      101: .Xr termcap 5