2 .\" Copyright (c) 2011, Secure Endpoints Inc.
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" - Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" - Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in
14 .\" the documentation and/or other materials provided with the
17 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 .\" COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
35 .Nd manages one-time passwords
39 .Op Fl b Ar block-size
40 .Op Fl m Ar max-cache-size
46 program performs binary searches of
48 which must be a sorted flat text file.
50 Each line is a record. Each record starts with a key
51 that is optionally followed by whitespace and a value.
52 Whitespace may be quoted with a backslash, but newline
53 and carriage-return characters must be quoted in some
54 other manner (e.g., as backslash-n and backslash-r).
55 Escapes are not interpreted nor removed.
57 If no key arguments are given on the comman-line, then
58 keys will be read from standard input.
60 By default only values are printed to standard output.
61 Use the -K option to also print keys. The exit status
62 will be non-zero if any key lookups fail.
73 Print statistic and debug information to standard
76 A sorted flat text file. NOTE: use the "C" locale for
77 sorting this file, as in "LC_ALL=C sort -u -o file
80 For getting a help message.
84 as the maximum cache size. If the
86 is smaller than this size then the whole file will be
87 read into memory, else the program will read blocks.
92 as the block size for block-wise I/O. This must be a
93 power of 2, must be no smaller than 512 and no larger
94 than 1MB. Defaults to the
96 filesystem's preferred blocksize.
99 .Bd -literal -offset indent
100 $ env LC_ALL=C sort -o /tmp/words /usr/share/dict/words
101 $ bsearch -Kv /tmp/words day
102 Using whole-file method
103 Key day found at offset 327695 in 12 loops and 0 reads
109 Records must not be longer than one block's size.
111 Flat text files must be sorted in the "C" locale. In
112 some systems the default locale may result in
113 case-insensitive sorting by the sort command.