bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / apache2 / manual / programs / htdbm.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>htdbm - Manipulate DBM password databases - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body id="manual-page"><div id="page-header">
14 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
15 <p class="apache">Apache HTTP Server Version 2.0</p>
16 <img alt="" src="../images/feather.gif" /></div>
17 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
18 <div id="path">
19 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.0</a> &gt; <a href="./">Programs</a></div><div id="page-content"><div id="preamble"><h1>htdbm - Manipulate DBM password databases</h1>
20 <div class="toplang">
21 <p><span>Available Languages: </span><a href="../en/programs/htdbm.html" title="English">&nbsp;en&nbsp;</a> |
22 <a href="../tr/programs/htdbm.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
23 </div>
24
25     <p><code>htdbm</code> is used to manipulate the DBM format files used to
26     store usernames and password for basic authentication of HTTP users via
27     <code class="module"><a href="../mod/mod_auth_dbm.html">mod_auth_dbm</a></code>.  See the <code class="program"><a href="../programs/dbmmanage.html">dbmmanage</a></code>
28     documentation for more information about these DBM files.</p>
29 </div>
30 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#synopsis">Synopsis</a></li>
31 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
32 <li><img alt="" src="../images/down.gif" /> <a href="#bugs">Bugs</a></li>
33 <li><img alt="" src="../images/down.gif" /> <a href="#exit">Exit Status</a></li>
34 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li>
35 <li><img alt="" src="../images/down.gif" /> <a href="#security">Security Considerations</a></li>
36 <li><img alt="" src="../images/down.gif" /> <a href="#restrictions">Restrictions</a></li>
37 </ul><h3>See also</h3><ul class="seealso"><li><code class="program"><a href="../programs/httpd.html">httpd</a></code></li><li><code class="program"><a href="../programs/dbmmanage.html">dbmmanage</a></code></li><li><code class="module"><a href="../mod/mod_auth_dbm.html">mod_auth_dbm</a></code></li></ul></div>
38 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
39 <div class="section">
40 <h2><a name="synopsis" id="synopsis">Synopsis</a></h2>
41     <p><code><strong>htdbm</strong>
42     [ -<strong>T</strong><var>DBTYPE</var> ]
43     [ -<strong>c</strong> ]
44     [ -<strong>m</strong> |
45       -<strong>d</strong> |
46       -<strong>p</strong> |
47       -<strong>s</strong> ]
48     [ -<strong>t</strong> ]
49     [ -<strong>v</strong> ]
50     [ -<strong>x</strong> ]
51     <var>filename</var> <var>username</var></code></p>
52
53     <p><code><strong>htdbm</strong> -<strong>b</strong>
54     [ -<strong>T</strong><var>DBTYPE</var> ]
55     [ -<strong>c</strong> ]
56     [ -<strong>m</strong> |
57       -<strong>d</strong> |
58       -<strong>p</strong> |
59       -<strong>s</strong> ]
60     [ -<strong>t</strong> ]
61     [ -<strong>v</strong> ]
62     <var>filename</var> <var>username</var> <var>password</var></code></p>
63
64     <p><code><strong>htdbm</strong> -<strong>n</strong>
65     [ -<strong>c</strong> ]
66     [ -<strong>m</strong> |
67       -<strong>d</strong> |
68       -<strong>p</strong> |
69       -<strong>s</strong> ]
70     [ -<strong>t</strong> ]
71     [ -<strong>v</strong> ]
72     <var>username</var></code></p>
73
74     <p><code><strong>htdbm</strong> -<strong>nb</strong>
75     [ -<strong>c</strong> ]
76     [ -<strong>m</strong> |
77       -<strong>d</strong> |
78       -<strong>p</strong> |
79       -<strong>s</strong> ]
80     [ -<strong>t</strong> ]
81     [ -<strong>v</strong> ]
82     <var>username</var> <var>password</var></code></p>
83
84     <p><code><strong>htdbm</strong> -<strong>v</strong>
85     [ -<strong>T</strong><var>DBTYPE</var> ]
86     [ -<strong>c</strong> ]
87     [ -<strong>m</strong> |
88       -<strong>d</strong> |
89       -<strong>p</strong> |
90       -<strong>s</strong> ]
91     [ -<strong>t</strong> ]
92     [ -<strong>v</strong> ]
93     <var>filename</var> <var>username</var></code></p>
94
95     <p><code><strong>htdbm</strong> -<strong>vb</strong>
96     [ -<strong>T</strong><var>DBTYPE</var> ]
97     [ -<strong>c</strong> ]
98     [ -<strong>m</strong> |
99       -<strong>d</strong> |
100       -<strong>p</strong> |
101       -<strong>s</strong> ]
102     [ -<strong>t</strong> ]
103     [ -<strong>v</strong> ]
104     <var>filename</var> <var>username</var> <var>password</var></code></p>
105
106     <p><code><strong>htdbm</strong> -<strong>x</strong>
107     [ -<strong>T</strong><var>DBTYPE</var> ]
108     [ -<strong>m</strong> |
109       -<strong>d</strong> |
110       -<strong>p</strong> |
111       -<strong>s</strong> ]
112     <var>filename</var> <var>username</var></code></p>
113
114     <p><code><strong>htdbm</strong> -<strong>l</strong>
115     [ -<strong>T</strong><var>DBTYPE</var> ]
116     </code></p>
117 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
118 <div class="section">
119 <h2><a name="options" id="options">Options</a></h2>
120     <dl>
121     <dt><code>-b</code></dt>
122     <dd>Use batch mode; <em>i.e.</em>, get the password from the command line
123     rather than prompting for it. This option should be used with extreme care,
124     since <strong>the password is clearly visible</strong> on the command
125     line.</dd>
126
127     <dt><code>-c</code></dt>
128     <dd>Create the <var>passwdfile</var>. If <var>passwdfile</var> already
129     exists, it is rewritten and truncated. This option cannot be combined with
130     the <code>-n</code> option.</dd>
131
132     <dt><code>-n</code></dt>
133     <dd>Display the results on standard output rather than updating a
134     database.  This option changes the syntax of the command line, since the
135     <var>passwdfile</var> argument (usually the first one) is omitted. It
136     cannot be combined with the <code>-c</code> option.</dd>
137
138     <dt><code>-m</code></dt>
139     <dd>Use MD5 encryption for passwords. On Windows, Netware and TPF, this is
140     the default.</dd>
141
142     <dt><code>-d</code></dt>
143     <dd>Use <code>crypt()</code> encryption for passwords. The default on all
144     platforms but Windows, Netware and TPF. Though possibly supported by
145     <code>htdbm</code> on all platforms, it is not supported by the
146     <code class="program"><a href="../programs/httpd.html">httpd</a></code> server on Windows, Netware and TPF.</dd>
147
148     <dt><code>-s</code></dt>
149     <dd>Use SHA encryption for passwords. Facilitates migration from/to Netscape
150     servers using the LDAP Directory Interchange Format (ldif).</dd>
151
152     <dt><code>-p</code></dt>
153     <dd>Use plaintext passwords. Though <code>htdbm</code> will support
154     creation on all platforms, the <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon will
155     only accept plain text passwords on Windows, Netware and TPF.</dd>
156
157     <dt><code>-l</code></dt>
158     <dd>Print each of the usernames and comments from the database on
159     stdout.</dd>
160
161     <dt><code>-t</code></dt>
162     <dd>Interpret the final parameter as a comment.  When this option is
163     specified, an additional string can be appended to the command line; this
164     string will be stored in the "Comment" field of the database, associated
165     with the specified username.</dd>
166
167     <dt><code>-v</code></dt>
168     <dd>Verify the username and password.  The program will print a message
169     indicating whether the supplied password is valid.  If the password is
170     invalid, the program exits with error code 3.</dd>
171
172     <dt><code>-x</code></dt>
173     <dd>Delete user. If the username exists in the specified DBM file, it
174     will be deleted.</dd>
175
176     <dt><code><var>filename</var></code></dt>
177     <dd>The filename of the DBM format file. Usually without the extension
178     <code>.db</code>, <code>.pag</code>, or <code>.dir</code>.  If
179     <code>-c</code> is given, the DBM file is created if it does not already
180     exist, or updated if it does exist.</dd>
181
182     <dt><code><var>username</var></code></dt>
183     <dd>The username to create or update in <var>passwdfile</var>. If
184     <var>username</var> does not exist in this file, an entry is added. If it
185     does exist, the password is changed.</dd>
186
187     <dt><code><var>password</var></code></dt>
188     <dd>The plaintext password to be encrypted and stored in the DBM file.
189     Used only with the <code>-b</code> flag.</dd>
190
191     <dt><code>-T<var>DBTYPE</var></code></dt>
192     <dd>Type of DBM file (SDBM, GDBM, DB, or "default").</dd>
193     </dl>
194 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
195 <div class="section">
196 <h2><a name="bugs" id="bugs">Bugs</a></h2>
197     <p>One should be aware that there are a number of different DBM file
198     formats in existence, and with all likelihood, libraries for more than
199     one format may exist on your system. The three primary examples are
200     SDBM, NDBM, GNU GDBM, and Berkeley/Sleepycat DB 2/3/4. Unfortunately,
201     all these libraries use different file formats, and you must make sure
202     that the file format used by <var>filename</var> is the same format that
203     <code>htdbm</code> expects to see. <code>htdbm</code> currently has
204     no way of determining what type of DBM file it is looking at. If used
205     against the wrong format, will simply return nothing, or may create a
206     different DBM file with a different name, or at worst, it may corrupt
207     the DBM file if you were attempting to write to it.</p>
208
209     <p>One can usually use the <code>file</code> program supplied with most
210     Unix systems to see what format a DBM file is in.</p>
211 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
212 <div class="section">
213 <h2><a name="exit" id="exit">Exit Status</a></h2>
214     <p><code>htdbm</code> returns a zero status ("true") if the username and
215     password have been successfully added or updated in the DBM File.
216     <code>htdbm</code> returns <code>1</code> if it encounters some problem
217     accessing files, <code>2</code> if there was a syntax problem with the
218     command line, <code>3</code> if the password was entered interactively and
219     the verification entry didn't match, <code>4</code> if its operation was
220     interrupted, <code>5</code> if a value is too long (username, filename,
221     password, or final computed record), <code>6</code> if the username
222     contains illegal characters (see the <a href="#restrictions">Restrictions
223     section</a>), and <code>7</code> if the file is not a valid DBM password
224     file.</p>
225 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
226 <div class="section">
227 <h2><a name="examples" id="examples">Examples</a></h2>
228     <div class="example"><p><code>
229       htdbm /usr/local/etc/apache/.htdbm-users jsmith
230     </code></p></div>
231
232     <p>Adds or modifies the password for user <code>jsmith</code>. The user
233     is prompted for the password. If executed on a Windows system, the password
234     will be encrypted using the  modified Apache MD5 algorithm; otherwise, the
235     system's <code>crypt()</code> routine will be used. If the file does not
236     exist, <code>htdbm</code> will do nothing except return an error.</p>
237
238     <div class="example"><p><code>
239       htdbm -c /home/doe/public_html/.htdbm jane
240     </code></p></div>
241
242     <p>Creates a new file and stores a record in it for user <code>jane</code>.
243     The user is prompted for the password. If the file exists and cannot be
244     read, or cannot be written, it is not altered and <code>htdbm</code>
245     will display a message and return an error status.</p>
246
247     <div class="example"><p><code>
248       htdbm -mb /usr/web/.htdbm-all jones Pwd4Steve
249     </code></p></div>
250
251     <p>Encrypts the password from the command line (<code>Pwd4Steve</code>)
252     using the MD5 algorithm, and stores it in the specified file.</p>
253 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
254 <div class="section">
255 <h2><a name="security" id="security">Security Considerations</a></h2>
256     <p>Web password files such as those managed by <code>htdbm</code> should
257     <em>not</em> be within the Web server's URI space -- that is, they should
258     not be fetchable with a browser.</p>
259
260     <p>The use of the <code>-b</code> option is discouraged, since when it is
261     used the unencrypted password appears on the command line.</p>
262 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
263 <div class="section">
264 <h2><a name="restrictions" id="restrictions">Restrictions</a></h2>
265     <p>On the Windows and MPE platforms, passwords encrypted with
266     <code>htdbm</code> are limited to no more than <code>255</code>
267     characters in length. Longer passwords will be truncated to 255
268     characters.</p>
269
270     <p>The MD5 algorithm used by <code>htdbm</code> is specific to the Apache
271     software; passwords encrypted using it will not be usable with other Web
272     servers.</p>
273
274     <p>Usernames are limited to <code>255</code> bytes and may not include the
275     character <code>:</code>.</p>
276 </div></div>
277 <div class="bottomlang">
278 <p><span>Available Languages: </span><a href="../en/programs/htdbm.html" title="English">&nbsp;en&nbsp;</a> |
279 <a href="../tr/programs/htdbm.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
280 </div><div id="footer">
281 <p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
282 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
283 </body></html>