Fixup most commands to use the RC of element finders.
[pwmd.git] / doc / pwmd.html
blob762e540748b9f64d62eeaa88f109bbbdd4c74f1c
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
4 <head>
5 <title>PWMD Manual</title>
7 <meta name="description" content="PWMD Manual">
8 <meta name="keywords" content="PWMD Manual">
9 <meta name="resource-type" content="document">
10 <meta name="distribution" content="global">
11 <meta name="Generator" content="makeinfo">
12 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
13 <link href="#Top" rel="start" title="Top">
14 <link href="#SEC_Contents" rel="contents" title="Table of Contents">
15 <link href="dir.html#Top" rel="up" title="(dir)">
16 <style type="text/css">
17 <!--
18 a.summary-letter {text-decoration: none}
19 blockquote.smallquotation {font-size: smaller}
20 div.display {margin-left: 3.2em}
21 div.example {margin-left: 3.2em}
22 div.indentedblock {margin-left: 3.2em}
23 div.lisp {margin-left: 3.2em}
24 div.smalldisplay {margin-left: 3.2em}
25 div.smallexample {margin-left: 3.2em}
26 div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
27 div.smalllisp {margin-left: 3.2em}
28 kbd {font-style:oblique}
29 pre.display {font-family: inherit}
30 pre.format {font-family: inherit}
31 pre.menu-comment {font-family: serif}
32 pre.menu-preformatted {font-family: serif}
33 pre.smalldisplay {font-family: inherit; font-size: smaller}
34 pre.smallexample {font-size: smaller}
35 pre.smallformat {font-family: inherit; font-size: smaller}
36 pre.smalllisp {font-size: smaller}
37 span.nocodebreak {white-space:nowrap}
38 span.nolinebreak {white-space:nowrap}
39 span.roman {font-family:serif; font-weight:normal}
40 span.sansserif {font-family:sans-serif; font-weight:normal}
41 ul.no-bullet {list-style: none}
42 -->
43 </style>
46 </head>
48 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
49 <h1 class="settitle" align="center">PWMD Manual</h1>
54 <a name="Top"></a>
55 <div class="header">
56 <p>
57 Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
58 </div>
59 <h1 class="node-heading">Top</h1>
62 <table class="menu" border="0" cellspacing="0">
63 <tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Overview of pwmd.
64 </td></tr>
65 <tr><td align="left" valign="top">&bull; <a href="#Access-Control" accesskey="2">Access Control</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ACL of a single XML element.
66 </td></tr>
67 <tr><td align="left" valign="top">&bull; <a href="#Invoking" accesskey="3">Invoking</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Command line options.
68 </td></tr>
69 <tr><td align="left" valign="top">&bull; <a href="#Configuration" accesskey="4">Configuration</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Configuration file options.
70 </td></tr>
71 <tr><td align="left" valign="top">&bull; <a href="#Commands" accesskey="5">Commands</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Protocol commands.
72 </td></tr>
73 <tr><td align="left" valign="top">&bull; <a href="#Status-Messages" accesskey="6">Status Messages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Status lines and their meaning.
74 </td></tr>
75 <tr><td align="left" valign="top">&bull; <a href="#Target-Attribute" accesskey="7">Target Attribute</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A kind of symbolic link.
76 </td></tr>
77 <tr><td align="left" valign="top">&bull; <a href="#Signals" accesskey="8">Signals</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Signals known to pwmd.
78 </td></tr>
79 <tr><td align="left" valign="top">&bull; <a href="#Concept-Index" accesskey="9">Concept Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Index of concepts.
80 </td></tr>
81 </table>
83 <hr>
84 <a name="Introduction"></a>
85 <div class="header">
86 <p>
87 Next: <a href="#Access-Control" accesskey="n" rel="next">Access Control</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
88 </div>
89 <a name="Overview-of-pwmd"></a>
90 <h2 class="chapter">1 Overview of <code>pwmd</code></h2>
97 <p><code>pwmd</code> or <em>Password Manager Daemon</em> is a server that
98 applications connect to and send commands to store and retrieve data
99 that is saved in an encrypted <abbr>XML</abbr> document.
100 </p>
101 <p>The server uses the Assuan protocol (See <a href="http://www.gnupg.org/documentation/manuals/assuan/Implementation.html#Implementation">(assuan)Implementation</a>) which
102 is the same used by <code>gpg-agent</code>, <code>pinentry</code> and
103 <code>scdaemon</code>. It also uses <cite>libgpg-error</cite> for error reporting with
104 the error source set as <var>GPG_ERR_SOURCE_USER_1</var>.
105 </p>
107 <p>The <abbr>XML</abbr> document uses the following <abbr>DTD</abbr>:
108 </p>
109 <div class="example">
110 <pre class="example"> &lt;?xml version=&quot;1.0&quot;?&gt;
111 &lt;!DOCTYPE pwmd [
112 &lt;!ELEMENT pwmd (element*)&gt;
113 &lt;!ATTLIST element _name CDATA #REQUIRED&gt;
114 ]&gt;
115 </pre></div>
117 <p>The <code>pwmd</code> element is the document root node while all other elements
118 of the document have the name <code>element</code> with an attribute <code>_name</code>
119 whose value uniquely identifies the element at the current element tree depth.
120 It is done this way to avoid <abbr>XML</abbr> parsing errors for commonly used
121 characters. A <abbr>URL</abbr> for example would be an invalid <abbr>XML</abbr> element
122 since the <abbr>URI</abbr> contains a &lsquo;<samp>:</samp>&rsquo; which is also the <abbr>XML</abbr>
123 namespace separator.
124 </p>
125 <p>As mentioned, an element name must be unique for the current element tree
126 depth. You cannot have two elements containing the same <code>_name</code> attribute
127 value. <code>pwmd</code> will stop searching for an element of an <em>element
128 path</em> at the first match then continue searching for the next element of the
129 element path beginning at the child node of the matched element.
130 </p>
131 <p>An <em>element path</em> is a <tt class="key">TAB</tt> delimited character string where each
132 <tt class="key">TAB</tt> separates each element in the path. For example, the element path
133 <code>a<span class="key">TAB</span>b<span class="key">TAB</span>c</code> has the following <abbr>XML</abbr> document structure:
134 </p>
135 <div class="example">
136 <pre class="example"> &lt;pwmd&gt;
137 &lt;element _name=&quot;a&quot;&gt;
138 &lt;element _name=&quot;b&quot;&gt;
139 &lt;element _name=&quot;c&quot;&gt;
140 [... element value or content ...]
141 &lt;/element&gt;
142 &lt;/element&gt;
143 &lt;/element&gt;
144 &lt;/pwmd&gt;
145 </pre></div>
147 <p>The only restriction of an element name is that it contain no whitespace
148 characters. It also cannot begin with a &lsquo;<samp>!</samp>&rsquo; since this character is
149 reserved for the <code>target</code> attribute. See <a href="#Target-Attribute">Target Attribute</a>.
150 </p>
151 <hr>
152 <a name="Access-Control"></a>
153 <div class="header">
155 Next: <a href="#Invoking" accesskey="n" rel="next">Invoking</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
156 </div>
157 <a name="Access-Control-1"></a>
158 <h2 class="chapter">2 Access Control</h2>
160 <p>Like a filesystem has an <abbr>ACL</abbr> to grant or limit access to directories or
161 files for a specific user or group, <code>pwmd</code> can limit a local user,
162 group or a TLS connection to a specific element path. This is done by storing
163 an ACL in the element attribute <var>_acl</var>. Its syntax is similar to the
164 <var>allowed</var> configuration parameter (see <a href="#Configuration">Configuration</a>) with the
165 exception that a TLS fingerprint hash is prefixed with a <code>#</code>.
166 </p>
167 <p>Access is denied for all users that are not in the <abbr>ACL</abbr> of an element
168 with the exception of the invoking user (see the <var>invoking_user</var> and
169 <var>invoking_tls</var> configuration parameters (see <a href="#Configuration">Configuration</a>)). The
170 connected client must be in the <abbr>ACL</abbr> for each element in an element path
171 otherwise an error is returned. As an example:
172 </p>
173 <div class="example">
174 <pre class="example">&lt;element _name=&quot;test&quot; _acl=&quot;username,-@wheel,root,#ABCDEF&quot;&gt;
175 &lt;element _name=&quot;child&quot;/&gt;
176 &lt;/element&gt;
177 </pre></div>
179 <p>The user <code>username</code> would be allowed access to the <code>test</code> element
180 but not if it is a member of the <code>wheel</code> group although the <code>root</code>
181 user, who may be a member of the <code>wheel</code> group, is allowed. The SHA-256
182 TLS fingerprint hash <code>#ABCDEF</code> is also allowed. No users other than the
183 <var>invoking_user</var> are allowed access to the <code>child</code> element.
184 </p>
185 <p>The first user listed in the <abbr>ACL</abbr> is considered the owner of the
186 element. This determines which clients may modify an <var>_acl</var> attribute and
187 store content for an element. The <var>invoking_user</var> may always modify an
188 <abbr>ACL</abbr>.
189 </p>
190 <hr>
191 <a name="Invoking"></a>
192 <div class="header">
194 Next: <a href="#Configuration" accesskey="n" rel="next">Configuration</a>, Previous: <a href="#Access-Control" accesskey="p" rel="prev">Access Control</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
195 </div>
196 <a name="Invoking-pwmd"></a>
197 <h2 class="chapter">3 Invoking <code>pwmd</code></h2>
201 <p>When <code>pwmd</code> is started with the <samp>--use-agent</samp> command
202 line option then <code>pwmd</code> will use <code>gpg-agent</code> for key
203 generation, decryption, signing and caching of passphrases as the
204 default rather than symmetrically encrypted data files.
205 <code>gpg-agent</code> must be running prior to <code>pwmd</code> startup when
206 this option is enabled.
207 </p>
208 <p>It is recommended to pass the <samp>--allow-preset-passphrase</samp>
209 command line option to <code>gpg-agent</code>. Doing so allows <code>pwmd</code>
210 cache pushing on startup. It is also recommended to pass the
211 <samp>--allow-loopback-pinentry</samp> to <code>gpg-agent</code>. This option allows
212 a passphrase to be inquired from <code>pwmd</code> when a <code>pinentry</code> is
213 unavailable to the client.
214 </p>
215 <a name="index-Running-pwmd"></a>
216 <p><code>pwmd</code> is executed as follows:
217 </p>
218 <div class="example">
219 <pre class="example">pwmd <var>options</var> [ file1 ] [ &hellip; ]
220 </pre></div>
222 <p>Non-option arguments are data files to cache on startup. When the data file
223 requires a passphrase for decryption a <code>pinentry</code> will prompt either
224 on the current <abbr>TTY</abbr> or from an X11 window when the <code>DISPLAY</code>
225 environment variable is set.
226 </p>
227 <a name="index-Options"></a>
228 <a name="index-Arguments"></a>
229 <p>The following command line options are supported:
230 </p>
231 <a name="index-Getting-help"></a>
232 <dl compact="compact">
233 <dt>&lsquo;<samp>--homedir directory</samp>&rsquo;</dt>
234 <dd><p>The root directory where pwmd will store its data and temporary files. The
235 default is <samp>~/.pwmd</samp>.
236 </p>
237 </dd>
238 <dt>&lsquo;<samp>--rcfile, -f rcfile</samp>&rsquo;</dt>
239 <dd><p>Specify an alternate configuration file. The default is
240 <samp>~/.pwmd/config</samp>.
241 </p>
242 </dd>
243 <dt>&lsquo;<samp>--kill</samp>&rsquo;</dt>
244 <dd><p>Terminate an existing instance of pwmd. The process to terminate is determined
245 from the <samp>--homedir</samp> and <samp>--rcfile</samp> options.
246 </p>
247 </dd>
248 <dt>&lsquo;<samp>--use-agent [integer]</samp>&rsquo;</dt>
249 <dd><p>Enable the use of <code>gpg-agent</code> and add support for data files
250 encrypted with a keypair. Files previously handled by
251 <code>gpg-agent</code> when this option is not specified will no longer be
252 able to be opened and new data files are symmetrically or conventionally
253 encrypted and without a public and private key. If specified, both data file
254 types are supported. The optional argument overrides any configuration file
255 value specified with the <samp>--rcfile</samp> option.
256 </p>
257 </dd>
258 <dt>&lsquo;<samp>--import, -I filename</samp>&rsquo;</dt>
259 <dd><p>Imports an <abbr>XML</abbr> file. The <abbr>XML</abbr> file should be in conformance to
260 the <code>pwmd</code> <abbr>DTD</abbr> (see <a href="#Introduction">Introduction</a>). You
261 will be prompted for a passphrase to encrypt with. The output is written to
262 the filename specified with <samp>--outfile</samp>. To make use of the imported
263 data, place the output file in <samp>~/.pwmd/data</samp>.
264 </p>
265 </dd>
266 <dt>&lsquo;<samp>--keyparam S-expression</samp>&rsquo;</dt>
267 <dd><p>The key parameters to use when generating a new key pair while importing an
268 <abbr>XML</abbr> file or when converting a <em>version 2</em> data file. The argument
269 must be a valid S-expression (See <a href="http://www.gnupg.org/documentation/manuals/gcrypt/S_002dexpressions.html#S_002dexpressions">(gcrypt)S-expressions</a>).
270 </p>
271 </dd>
272 <dt>&lsquo;<samp>--keygrip hexstring</samp>&rsquo;</dt>
273 <dd><p>Specifies the hexadecimal encoded public key-grip to use for encryption when
274 importing or converting. When not specified a new key-pair will be created.
275 </p>
276 </dd>
277 <dt>&lsquo;<samp>--sign-keygrip hexstring</samp>&rsquo;</dt>
278 <dd><p>Specifies the hexadecimal encoded public key-grip to use for signing of the
279 data file when importing or converting. When not specified the generated
280 public key or the key specified with the <samp>--keygrip</samp> option will be
281 used.
282 </p>
283 </dd>
284 <dt>&lsquo;<samp>--passphrase-file, -k filename&quot;</samp>&rsquo;</dt>
285 <dd><p>Obtain the passphrase from the specified filename.
286 </p>
287 </dd>
288 <dt>&lsquo;<samp>--s2k-count iterations</samp>&rsquo;</dt>
289 <dd><p>The number of times to hash the passphrase when importing or converting. The
290 default is the gpg-agent calibrated value of the machine. When less than
291 &lsquo;<samp>65536</samp>&rsquo; the default will be used.
292 </p>
293 </dd>
294 <dt>&lsquo;<samp>--cipher-iterations iterations</samp>&rsquo;</dt>
295 <dd><p>The number of symmetric encryption iterations. The value is actually N+1. The
296 default is 0+1.
297 </p>
298 </dd>
299 <dt>&lsquo;<samp>--cipher algo</samp>&rsquo;</dt>
300 <dd><p>When importing, the cipher to use for data encryption. See the <var>cipher</var>
301 configuration parameter (see <a href="#Configuration">Configuration</a>) for available ciphers. The
302 default is &lsquo;<samp>aes256</samp>&rsquo;.
303 </p>
304 </dd>
305 <dt>&lsquo;<samp>--convert, -C filename</samp>&rsquo;</dt>
306 <dd><p>Converts a <code>pwmd</code> <em>version 2</em> data file to a <em>version 3</em>
307 data file. If encrypted, you will be prompted for a passphrase to use for
308 decryption unless <samp>--passphrase-file</samp> was specified. The converted data
309 file will be saved to the filename specified with <samp>--outfile</samp>. All
310 <samp>--import</samp> related options may also be used when converting.
311 </p>
312 </dd>
313 <dt>&lsquo;<samp>--disable-dump, -D</samp>&rsquo;</dt>
314 <dd><p>Disable the <code>XPATH</code>, <code>XPATHATTR</code>, <code>LIST</code> and <code>DUMP</code>
315 protocol commands (see <a href="#Commands">Commands</a>). This overrides any
316 <var>disable_list_and_dump</var> configuration parameter (see <a href="#Configuration">Configuration</a>).
317 </p>
318 </dd>
319 <dt>&lsquo;<samp>--no-fork, -n</samp>&rsquo;</dt>
320 <dd><p>Run as a foreground process and do not fork into the background.
321 </p>
322 </dd>
323 <dt>&lsquo;<samp>--ignore, --force</samp>&rsquo;</dt>
324 <dd><p>Ignore cache pushing failures on startup. By default, <code>pwmd</code> will exit
325 if an error occurred do to an invalid passphrase or other error.
326 </p>
327 </dd>
328 <dt>&lsquo;<samp>--debug-level keyword,keyword,...</samp>&rsquo;</dt>
329 <dd><p>Output libassuan See <a href="http://www.gnupg.org/documentation/manuals/assuan/index.html#Top">(assuan)Top</a> protocol IO with the comma
330 separated list of output keywords. Valid keywords are: <code>init</code>,
331 <code>ctx</code>, <code>engine</code>, <code>data</code>, <code>sysio</code> and <code>control</code>.
332 </p>
333 </dd>
334 <dt>&lsquo;<samp>--version</samp>&rsquo;</dt>
335 <dd><p>Show the version, copyright and compile time features and exit.
336 </p>
337 </dd>
338 <dt>&lsquo;<samp>--help</samp>&rsquo;</dt>
339 <dd><p>Print a summary of options.
340 </p></dd>
341 </dl>
344 <hr>
345 <a name="Configuration"></a>
346 <div class="header">
348 Next: <a href="#TLS" accesskey="n" rel="next">TLS</a>, Previous: <a href="#Invoking" accesskey="p" rel="prev">Invoking</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
349 </div>
350 <a name="pwmd-configuration-file-options"></a>
351 <h2 class="chapter">4 <code>pwmd</code> configuration file options</h2>
354 <p>If no configuration file is specified with the <code>pwmd</code> <samp>-f</samp>
355 command line option, <code>pwmd</code> will read <samp>~/.pwmd/config</samp> if it
356 exists, and if not, will use defaults. Blank lines and lines beginning with
357 &lsquo;<samp>#</samp>&rsquo; are ignored. Some parameters may have data file specific settings by
358 placing them in a file section. A file section is declared by surrounding the
359 filename with braces (i.e., &lsquo;<samp>[filename]</samp>&rsquo;). Global options may be
360 specified in a &lsquo;<samp>[global]</samp>&rsquo; section and are the default options for new or
361 unspecified files.
362 </p>
363 <p>A tilde <tt class="key">~</tt> will be expanded to the home directory of the invoking user
364 when contained in a parameter whose value is a filename.
365 </p>
366 <a name="index-Reloading-the-configuration-file"></a>
367 <p>The configuration file can be reloaded by sending the <em>SIGHUP</em> signal to
368 a <code>pwmd</code> process.
369 </p>
370 <a name="index-Global-configuration-options"></a>
371 <p>The following options are only for use in the &lsquo;<samp>global</samp>&rsquo; section:
372 </p>
373 <dl compact="compact">
374 <dt>&lsquo;<samp>socket_path = /path/to/socket</samp>&rsquo;</dt>
375 <dd><p>Listen on the specified socket. The default is <samp>~/.pwmd/socket</samp>.
376 </p>
377 </dd>
378 <dt>&lsquo;<samp>socket_perms = octal_mode</samp>&rsquo;</dt>
379 <dd><p>Permissions to set after creating the socket. This will override any
380 <cite>umask(2)</cite> setting.
381 </p>
382 </dd>
383 <dt>&lsquo;<samp>invoking_user = [-!]user,[-!]@group,[-!]#SHA-256,...</samp>&rsquo;</dt>
384 <dd><p>This parameter is not to be confused with setuid or setguid upon startup. It&rsquo;s
385 syntax is the same as the <code>allowed</code> parameter except that it is a list of
386 local username, group name and TLS fingerprint hashes that may use the
387 <code>XPATH</code>, <code>XPATHATTR</code> and <code>DUMP</code> commands (except when
388 disabled with the <code>disable_list_and_dump</code> option) and also who may modify
389 elements that have no <code>_acl</code> attribute or is not listed in an
390 <code>_acl</code>. It is similar to the system administrator root account but for a
391 data file and element paths (see <a href="#Access-Control">Access Control</a>). The default is the user
392 the executes <code>pwmd</code>.
393 </p>
394 </dd>
395 <dt>&lsquo;<samp>invoking_tls = SHA-256</samp>&rsquo;</dt>
396 <dd><p>This option is deprecated. Please use <code>invoking_user</code> instead.
397 </p>
398 <p>Like <code>invoking_user</code> but is a hash of an <abbr>TLS</abbr> certificate
399 fingerprint for a remote client. The hash should be prefixed with a <code>#</code>
400 character.
401 </p>
402 </dd>
403 <dt>&lsquo;<samp>invoking_file = filename</samp>&rsquo;</dt>
404 <dd><p>A file containing one entry per line. An entry has the same syntax as the
405 <code>invoking_user</code> parameter. When both this parameter and the
406 <code>invoking_user</code> parameter are specified then the <code>invoking_file</code>
407 entries will be appended to the <code>invoking_user</code> parameter value.
408 </p>
409 </dd>
410 <dt>&lsquo;<samp>allowed = [-!]user,[-!]@group,[+,][-!]#SHA-256,...</samp>&rsquo;</dt>
411 <dd><p>A comma separated list of local user names, group names or <abbr>TLS</abbr>
412 fingerprint <abbr>SHA</abbr>-256 hashes (in the case of a remote client) who are
413 allowed to connect. Groups should be prefixed with a &lsquo;<samp>@</samp>&rsquo;. When not
414 specified only the invoking user may connect. A username, group name or hash
415 may also be prefixed with a <code>-</code> or <code>!</code> to prevent access to a specific
416 user or group in the list. The order of the list is important since a user may
417 be of multiple groups.
418 </p>
419 <p>This parameter may also be specified in a filename section to allow or deny a
420 client to <code>OPEN</code> (see <a href="#OPEN">OPEN</a>) a data file. It also affects the cache
421 commands <code>CLEARCACHE</code> (see <a href="#CLEARCACHE">CLEARCACHE</a>) and <code>CACHETIMEOUT</code>
422 (see <a href="#CACHETIMEOUT">CACHETIMEOUT</a>). When not specified in a file section any user that can
423 connect may also open the filename.
424 </p>
425 <p>The following example would deny all users in group <code>primary</code> but
426 allow <code>username</code> who may be a member of <code>primary</code>. It will also
427 allow any TLS client except for the client with <abbr>TLS</abbr> fingerprint hash
428 <code>#ABCDEF</code>:
429 </p>
430 <div class="example">
431 <pre class="example">allowed=-@primary,username,+,!#ABCDEF
432 </pre></div>
434 </dd>
435 <dt>&lsquo;<samp>allowed_file = filename</samp>&rsquo;</dt>
436 <dd><p>A file containing one entry per line. An entry has the same syntax as the
437 <code>allowed</code> parameter. When both this parameter and the <code>allowed</code>
438 parameter are specified then the <code>allowed_file</code> entries will be appended
439 to the <code>allowed</code> parameter value.
440 </p>
441 </dd>
442 <dt>&lsquo;<samp>disable_mlockall = boolean</samp>&rsquo;</dt>
443 <dd><p>When set to <code>false</code>, <cite>mlockall(2)</cite> will be called on startup. This
444 will use more physical memory but may also be more secure since no swapping to
445 disk will occur. The default is <var>true</var>.
446 </p>
447 </dd>
448 <dt>&lsquo;<samp>log_path = /path/to/logfile</samp>&rsquo;</dt>
449 <dd><p>Logs informational messages to the specified file. The default is
450 <samp>~/.pwmd/log</samp>.
451 </p>
452 </dd>
453 <dt>&lsquo;<samp>enable_logging = boolean</samp>&rsquo;</dt>
454 <dd><p>Enable or disable logging to <var>log_path</var>. The default is <code>false</code>.
455 </p>
456 </dd>
457 <dt>&lsquo;<samp>log_keepopen = boolean</samp>&rsquo;</dt>
458 <dd><p>When set to <code>false</code>, the log file specified with <var>log_path</var> will be
459 closed after writing each line. The default is <code>true</code>.
460 </p>
461 </dd>
462 <dt>&lsquo;<samp>syslog = boolean</samp>&rsquo;</dt>
463 <dd><p>Enable logging to <cite>syslog(8)</cite> with facility <em>LOG_DAEMON</em> and priority
464 <em>LOG_INFO</em>. The default is <code>false</code>.
465 </p>
466 </dd>
467 <dt>&lsquo;<samp>log_level = level</samp>&rsquo;</dt>
468 <dd><p>When <code>0</code>, only connections and errors are logged. When <code>1</code>, client
469 commands are also logged. When <code>2</code>, the command arguments are also logged.
470 The default is <code>0</code>.
471 </p>
472 </dd>
473 <dt>&lsquo;<samp>use_agent = boolean</samp>&rsquo;</dt>
474 <dd><p>When true, enable <code>gpg-agent</code> support (see <a href="#Invoking">Invoking</a>).
475 </p>
476 </dd>
477 <dt>&lsquo;<samp>gpg_agent_socket = /path/to/filename</samp>&rsquo;</dt>
478 <dd><p>The location of the <code>gpg-agent</code> socket. The default is
479 <code>~/.gnupg/S.gpg-agent</code>.
480 </p>
481 </dd>
482 <dt>&lsquo;<samp>kill_scd = boolean</samp>&rsquo;</dt>
483 <dd><p>Kill <code>scdaemon</code> after each <code>OPEN</code> (see <a href="#OPEN">OPEN</a>) or <code>SAVE</code>
484 (see <a href="#SAVE">SAVE</a>) command.
485 </p>
486 </dd>
487 <dt>&lsquo;<samp>require_save_key = boolean</samp>&rsquo;</dt>
488 <dd><p>Require the passphrase needed to open a data file before writing changes
489 of the documment to disk reguardless of the key cache status.
490 </p>
491 </dd>
492 <dt>&lsquo;<samp>disable_list_and_dump = boolean</samp>&rsquo;</dt>
493 <dd><p>When <code>true</code>, the <code>XPATH</code>, <code>XPATHATTR</code>, <code>LIST</code> and
494 <code>DUMP</code> protocol commands (see <a href="#Commands">Commands</a>) will be disabled.
495 </p>
496 </dd>
497 <dt>&lsquo;<samp>cache_push = file1,file2</samp>&rsquo;</dt>
498 <dd><p>A comma separated list of filenames that will be pushed into the file cache
499 upon startup. <code>pwmd</code> will prompt for the passphrase for each file unless
500 specified with the <var>passphrase</var> or <var>passphrase_file</var> parameters in a
501 matching file section.
502 </p>
503 </dd>
504 <dt>&lsquo;<samp>priority = integer</samp>&rsquo;</dt>
505 <dd><p>The priority, or niceness, of the server. The default is inherited from the
506 parent process.
507 </p>
508 </dd>
509 <dt>&lsquo;<samp>cipher = algorithm</samp>&rsquo;</dt>
510 <dd><p>The default cipher to use for data encryption when saving (see <a href="#SAVE">SAVE</a>) a new
511 file. The algorithm must be one of: <code>aes128</code>, <code>aes192</code>,
512 <code>aes256</code>, <code>serpent128</code>, <code>serpent192</code>, <code>serpent256</code>,
513 <code>camellia128</code>, <code>camellia192</code>, <code>camellia256</code>, <code>3des</code>,
514 <code>cast5</code>, <code>blowfish</code>, <code>twofish128</code> or <code>twofish256</code>. The
515 default is <code>aes256</code>.
516 </p>
517 </dd>
518 <dt>&lsquo;<samp>cipher_iterations = integer</samp>&rsquo;</dt>
519 <dd><p>The number of times to encrypt the XML data. This differs from the
520 <var>s2k_count</var> parameter which specifies the number of times to hash the
521 passphrase used to encrypt the data. The default is 0 although at least 1
522 iteration is always done.
523 </p>
524 </dd>
525 <dt>&lsquo;<samp>cipher_progress = integer</samp>&rsquo;</dt>
526 <dd><p>Send a progress message to the client after the specified amount of encryption
527 or decryption iterations have been done. The default is 2000.
528 </p>
529 </dd>
530 <dt>&lsquo;<samp>keyparam = s-expression</samp>&rsquo;</dt>
531 <dd><p>The default key parameters to use when generating a new key-pair. The default
532 is <code>RSA</code> with <code>2048</code> bits. Note that only the <abbr>RSA</abbr> and
533 <abbr>ELG</abbr> algorithms as the encryption algorithm are supported at the moment.
534 Both <abbr>RSA</abbr> and <abbr>DSA</abbr> keys may be used for signing.
535 </p>
536 </dd>
537 <dt>&lsquo;<samp>pinentry_path = /path/to/pinentry</samp>&rsquo;</dt>
538 <dd><p>The location of the <code>pinentry</code> binary. This program is used to
539 prompt for a passphrase when not using <code>gpg-agent</code>. The default
540 is specified at compile time.
541 </p>
542 </dd>
543 <dt>&lsquo;<samp>pinentry_timeout = seconds</samp>&rsquo;</dt>
544 <dd><p>The number of seconds to wait for a pinentry before giving up and
545 returning an error. This timeout value is used for both waiting for
546 another pinentry to complete and for the pinentry waiting for user input.
547 </p>
548 </dd>
549 <dt>&lsquo;<samp>lock_timeout = integer</samp>&rsquo;</dt>
550 <dd><p>The default timeout in tenths of a second before giving up waiting for a file
551 lock and returning an error. The default is <code>50</code>.
552 </p>
553 </dd>
554 <dt>&lsquo;<samp>send_state = integer</samp>&rsquo;</dt>
555 <dd><p>Whether to send client state changes of the current client to all connected
556 clients. When <code>0</code> no client state changes will be sent although a client
557 state may be obtained with the <code>GETINFO</code> command (see <a href="#GETINFO">GETINFO</a>). When
558 <code>1</code> a status message will be sent to all connected clients. When
559 <code>2</code> the status message will be sent only to the <code>invoking_user</code>
560 (see <a href="#Configuration">Configuration</a>). The default is <code>2</code>. Disabling this option can
561 significantly increase the performance of <code>pwmd</code> when there are many
562 connected clients.
563 </p></dd>
564 </dl>
566 <a name="index-Data-file-configuration-options"></a>
567 <p>The following options are defaults for new files when specified in the
568 &lsquo;<samp>global</samp>&rsquo; section. When placed in a data file section they are options
569 specific to that data file only.
570 </p>
571 <dl compact="compact">
572 <dt>&lsquo;<samp>backup = boolean</samp>&rsquo;</dt>
573 <dd><p>Whether to create a backup of the data file when saving. The backup filename
574 has the <samp>.backup</samp> extension appended to the opened file. The default is
575 <code>true</code>.
576 </p>
577 </dd>
578 <dt>&lsquo;<samp>cache_timeout = seconds</samp>&rsquo;</dt>
579 <dd><p>The number of seconds to keep the cache entry for this file. If <code>-1</code>, the
580 cache entry is kept forever. If <code>0</code>, each time an encrypted file is
581 <code>OPEN</code>ed (see <a href="#OPEN">OPEN</a>) a passphrase will be required. The default
582 is <code>600</code> or 10 minutes.
583 </p>
584 </dd>
585 <dt>&lsquo;<samp>xfer_progress = bytes</samp>&rsquo;</dt>
586 <dd><p>Commands that send data lines to the client will also send the <code>XFER</code>
587 status message (see <a href="#Status-Messages">Status Messages</a>) after the specified number of bytes
588 have been sent. The number of bytes is rounded to <var>ASSUAN_LINELENGTH</var> or
589 <code>1002</code> bytes. The default is <code>8196</code>.
590 </p>
591 </dd>
592 <dt>&lsquo;<samp>passphrase = string</samp>&rsquo;</dt>
593 <dd><p>The passphrase to use for this file. If specified in the &lsquo;<samp>global</samp>&rsquo; section
594 then &lsquo;<samp>global</samp>&rsquo; is treated as a data filename and not a default for other
595 files. Note that if a client changes the passphrase for this data file then
596 this value is not modified and will need to be updated.
597 </p>
598 </dd>
599 <dt>&lsquo;<samp>passphrase_file = /path/to/file</samp>&rsquo;</dt>
600 <dd><p>Same as the <var>passphrase</var> parameter above but obtains the passphrase from
601 the specified filename.
602 </p>
603 </dd>
604 <dt>&lsquo;<samp>recursion_depth = integer</samp>&rsquo;</dt>
605 <dd><p>The maximum number of times to resolve a <code>target</code> attribute for an
606 element in an element path (see <a href="#Target-Attribute">Target Attribute</a>). An error is returned
607 when this value is exceeded. The default is <code>100</code> but can be disabled by
608 setting to <code>0</code> (<em>not recommended</em>).
609 </p>
610 </dd>
611 <dt>&lsquo;<samp>allowed = [-]user,[-]@group,...</samp>&rsquo;</dt>
612 <dd><p>Same parameter value as the <code>allowed</code> parameter mentioned above in
613 the &lsquo;<samp>global</samp>&rsquo; section but grants or denies a local user from opening
614 a specific data file. The default is the same as the &lsquo;<samp>global</samp>&rsquo; section.
615 </p></dd>
616 </dl>
618 <table class="menu" border="0" cellspacing="0">
619 <tr><td align="left" valign="top">&bull; <a href="#TLS" accesskey="1">TLS</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Remote connections over TLS.
620 </td></tr>
621 <tr><td align="left" valign="top">&bull; <a href="#Pinentry" accesskey="2">Pinentry</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Configuration file and defaults.
622 </td></tr>
623 </table>
625 <hr>
626 <a name="TLS"></a>
627 <div class="header">
629 Next: <a href="#Pinentry" accesskey="n" rel="next">Pinentry</a>, Previous: <a href="#Configuration" accesskey="p" rel="prev">Configuration</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
630 </div>
631 <a name="Configuring-remote-connections-over-TLS_002e"></a>
632 <h2 class="chapter">5 Configuring remote connections over TLS.</h2>
634 <p>Connections can also be made to <code>pwmd</code> over <abbr>TLS</abbr>.
635 Authentication is done by using X.509 client certificates which are signed
636 with the same Certificate Authority (<abbr>CA</abbr>) as the server certificate.
637 </p>
638 <p>The <abbr>CA</abbr> certificate is expected to be found in
639 <samp>~/.pwmd/ca-cert.pem</samp> while the <code>pwmd</code> server certificate and key
640 file should be put in <samp>~/.pwmd/server-cert.pem</samp> and
641 <samp>~/.pwmd/server-key.pem</samp>, respectively.
642 </p>
643 <p>See the documentation of <code>certtool</code> or <code>openssl</code> for details
644 on creating self-signed certificates.
645 </p>
646 <p>The following TLS configuration options are available:
647 </p>
648 <dl compact="compact">
649 <dt>&lsquo;<samp>enable_tcp = boolean</samp>&rsquo;</dt>
650 <dd><p>Whether to enable TCP/TLS server support. If enabled, both TCP and the local
651 unix domain socket will listen for connections. The default is
652 <code>false</code>.
653 </p>
654 </dd>
655 <dt>&lsquo;<samp>tcp_port = integer</samp>&rsquo;</dt>
656 <dd><p>The TCP port to listen on when <var>enable_tcp</var> is <code>true</code>. The default is
657 <code>6466</code>.
658 </p>
659 </dd>
660 <dt>&lsquo;<samp>tcp_bind = string</samp>&rsquo;</dt>
661 <dd><p>The internet protocol to listen with. Must be one of <code>ipv4</code>, <code>ipv6</code>
662 or <code>any</code> to listen for both IPv4 and IPv6 connections.
663 </p>
664 </dd>
665 <dt>&lsquo;<samp>tcp_interface = string</samp>&rsquo;</dt>
666 <dd><p>Only useful if running as root.
667 </p>
668 </dd>
669 <dt>&lsquo;<samp>tls_timeout = seconds</samp>&rsquo;</dt>
670 <dd><p>The number of seconds to wait for a read() or write() call on a
671 <abbr>TLS</abbr> client file descriptor to complete before returning an
672 error. The default is <var>300</var>.
673 </p>
674 <p>Note that the <code>SAVE</code> command (see <a href="#SAVE">SAVE</a>) may take a longer time
675 to complete than other commands since key generation may need to be done
676 or do to a large <samp>--cipher-iterations</samp> setting.
677 </p>
678 </dd>
679 <dt>&lsquo;<samp>keepalive_interval = seconds</samp>&rsquo;</dt>
680 <dd><p>Send a keepalive status message to an idle remote client. An idle
681 client is one who is not in a command. The purpose of this status
682 message is to disconnect a hung remote client and release any file mutex
683 locks so another client may open the same data file. The default is <code>60</code>.
684 </p>
685 </dd>
686 <dt>&lsquo;<samp>tcp_require_key = boolean</samp>&rsquo;</dt>
687 <dd><p>When <code>true</code>, require the remote client to provide the key or passphrase
688 to open a data file even if the file is cached. Note that the cache entry is
689 cleared during the see <a href="#OPEN">OPEN</a> command and the passphrase will be retrieved
690 from the client via a server <em>INQUIRE</em>. This option is a default
691 for all files when specified in the &lsquo;<samp>global</samp>&rsquo; section. The default
692 is <code>false</code>.
693 </p>
694 </dd>
695 <dt>&lsquo;<samp>tcp_wait = integer</samp>&rsquo;</dt>
696 <dd><p>The time in tenths of a second to wait between TCP connections. Setting to 0
697 will disable waiting. The default is <code>3</code>.
698 </p>
699 </dd>
700 <dt>&lsquo;<samp>tls_cipher_suite = string</samp>&rsquo;</dt>
701 <dd><p>The GnuTLS cipher suite and protocol to use. See the GnuTLS documentation for
702 information about the format of this string. The default is <code>SECURE256</code>.
703 </p>
704 </dd>
705 <dt>&lsquo;<samp>tls_dh_level = string</samp>&rsquo;</dt>
706 <dd><p>The security level (bits) of the generated key exchange parameters. Possible
707 values are <code>low</code>, <code>medium</code> or <code>high</code>. The default is
708 <code>medium</code>.
709 </p></dd>
710 </dl>
712 <hr>
713 <a name="Pinentry"></a>
714 <div class="header">
716 Next: <a href="#Commands" accesskey="n" rel="next">Commands</a>, Previous: <a href="#TLS" accesskey="p" rel="prev">TLS</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
717 </div>
718 <a name="Pinentry-configuration"></a>
719 <h2 class="chapter">6 Pinentry configuration</h2>
721 <p>The <code>pinentry</code> program is used to prompt the user for passphrase
722 input or as a confirmation dialog; it needs to know where to prompt for
723 the input, beit from a terminal or an X11 display.
724 </p>
725 <p>It is the responsibility of the client to tell <code>pinentry</code> about
726 the terminal or X11 display before requiring the input. This is done by
727 using the <code>pwmd</code> <code>OPTION</code> (see <a href="#OPTION">OPTION</a>) protocol command. It
728 need be done only once per client connection. To avoid the use of
729 <code>pinentry</code> entirely, use the <code>OPTION</code> (see <a href="#OPTION">OPTION</a>)
730 <samp>--disable-pinentry</samp> protocol command.
731 </p>
732 <hr>
733 <a name="Commands"></a>
734 <div class="header">
736 Next: <a href="#Status-Messages" accesskey="n" rel="next">Status Messages</a>, Previous: <a href="#Pinentry" accesskey="p" rel="prev">Pinentry</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
737 </div>
738 <a name="Protocol-commands-and-their-syntax"></a>
739 <h2 class="chapter">7 Protocol commands and their syntax</h2>
740 <table class="menu" border="0" cellspacing="0">
741 <tr><td align="left" valign="top">&bull; <a href="#AGENT" accesskey="1">AGENT</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
742 </td></tr>
743 <tr><td align="left" valign="top">&bull; <a href="#ATTR" accesskey="2">ATTR</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
744 </td></tr>
745 <tr><td align="left" valign="top">&bull; <a href="#CACHETIMEOUT" accesskey="3">CACHETIMEOUT</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
746 </td></tr>
747 <tr><td align="left" valign="top">&bull; <a href="#CLEARCACHE" accesskey="4">CLEARCACHE</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
748 </td></tr>
749 <tr><td align="left" valign="top">&bull; <a href="#COPY" accesskey="5">COPY</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
750 </td></tr>
751 <tr><td align="left" valign="top">&bull; <a href="#DELETE" accesskey="6">DELETE</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
752 </td></tr>
753 <tr><td align="left" valign="top">&bull; <a href="#DUMP" accesskey="7">DUMP</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
754 </td></tr>
755 <tr><td align="left" valign="top">&bull; <a href="#GET" accesskey="8">GET</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
756 </td></tr>
757 <tr><td align="left" valign="top">&bull; <a href="#GETCONFIG" accesskey="9">GETCONFIG</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
758 </td></tr>
759 <tr><td align="left" valign="top">&bull; <a href="#GETINFO">GETINFO</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
760 </td></tr>
761 <tr><td align="left" valign="top">&bull; <a href="#HELP">HELP</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
762 </td></tr>
763 <tr><td align="left" valign="top">&bull; <a href="#IMPORT">IMPORT</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
764 </td></tr>
765 <tr><td align="left" valign="top">&bull; <a href="#ISCACHED">ISCACHED</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
766 </td></tr>
767 <tr><td align="left" valign="top">&bull; <a href="#KEYGRIP">KEYGRIP</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
768 </td></tr>
769 <tr><td align="left" valign="top">&bull; <a href="#KILL">KILL</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
770 </td></tr>
771 <tr><td align="left" valign="top">&bull; <a href="#LIST">LIST</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
772 </td></tr>
773 <tr><td align="left" valign="top">&bull; <a href="#LOCK">LOCK</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
774 </td></tr>
775 <tr><td align="left" valign="top">&bull; <a href="#LS">LS</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
776 </td></tr>
777 <tr><td align="left" valign="top">&bull; <a href="#MOVE">MOVE</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
778 </td></tr>
779 <tr><td align="left" valign="top">&bull; <a href="#NOP">NOP</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
780 </td></tr>
781 <tr><td align="left" valign="top">&bull; <a href="#OPEN">OPEN</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
782 </td></tr>
783 <tr><td align="left" valign="top">&bull; <a href="#OPTION">OPTION</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
784 </td></tr>
785 <tr><td align="left" valign="top">&bull; <a href="#PASSWD">PASSWD</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
786 </td></tr>
787 <tr><td align="left" valign="top">&bull; <a href="#REALPATH">REALPATH</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
788 </td></tr>
789 <tr><td align="left" valign="top">&bull; <a href="#RENAME">RENAME</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
790 </td></tr>
791 <tr><td align="left" valign="top">&bull; <a href="#RESET">RESET</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
792 </td></tr>
793 <tr><td align="left" valign="top">&bull; <a href="#SAVE">SAVE</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
794 </td></tr>
795 <tr><td align="left" valign="top">&bull; <a href="#STORE">STORE</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
796 </td></tr>
797 <tr><td align="left" valign="top">&bull; <a href="#UNLOCK">UNLOCK</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
798 </td></tr>
799 <tr><td align="left" valign="top">&bull; <a href="#XPATH">XPATH</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
800 </td></tr>
801 <tr><td align="left" valign="top">&bull; <a href="#XPATHATTR">XPATHATTR</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
802 </td></tr>
803 </table>
804 <hr>
805 <a name="AGENT"></a>
806 <div class="header">
808 Next: <a href="#ATTR" accesskey="n" rel="next">ATTR</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
809 </div>
810 <a name="AGENT-command"></a>
811 <h2 class="chapter">8 AGENT command</h2>
812 <a name="index-AGENT-command"></a>
813 <p>Syntax:
814 </p><div class="example">
815 <pre class="example">AGENT &lt;command&gt;
816 </pre></div>
818 <p>Send a <code>gpg-agent</code> protocol <var>command</var> directly to the
819 <code>gpg-agent</code>.
820 </p>
822 <hr>
823 <a name="ATTR"></a>
824 <div class="header">
826 Next: <a href="#CACHETIMEOUT" accesskey="n" rel="next">CACHETIMEOUT</a>, Previous: <a href="#AGENT" accesskey="p" rel="prev">AGENT</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
827 </div>
828 <a name="ATTR-command"></a>
829 <h2 class="chapter">9 ATTR command</h2>
830 <a name="index-ATTR-command"></a>
831 <p>Syntax:
832 </p><div class="example">
833 <pre class="example">ATTR [--inquire] SET|GET|DELETE|LIST [&lt;attribute&gt;] [!]element[&lt;TAB&gt;[!]child[..]] ..
834 </pre></div>
836 <dl compact="compact">
837 <dt>ATTR SET attribute [!]element[&lt;TAB&gt;[!]child[..]] [value]</dt>
838 <dd>
839 <p>Stores or updates an <var>attribute</var> name and optional <var>value</var> of an
840 element. When no <var>value</var> is specified any existing value will be removed.
841 </p>
842 </dd>
843 <dt>ATTR DELETE attribute [!]element[&lt;TAB&gt;[!]child[..]]</dt>
844 <dd>
845 <p>Removes an <var>attribute</var> from an element.
846 </p>
847 </dd>
848 <dt>ATTR LIST [!]element[&lt;TAB&gt;[!]child[..]]</dt>
849 <dd>
850 <p>Retrieves a newline separated list of attributes names and values
851 from the specified element. Each attribute name and value is space delimited.
852 </p>
853 </dd>
854 <dt>ATTR GET attribute [!]element[&lt;TAB&gt;[!]child[..]]</dt>
855 <dd>
856 <p>Retrieves the value of an <var>attribute</var> from an element.
857 </p></dd>
858 </dl>
860 <p>The <code>_name</code> attribute (case sensitive) cannot be removed nor modified.
861 Use the <code>DELETE</code> (see <a href="#DELETE">DELETE</a>) or <code>RENAME</code> (see <a href="#RENAME">RENAME</a>)
862 commands instead.
863 </p>
864 <p>The <code>_mtime</code> attribute is updated each time an element is modified by
865 either storing content, editing attributes or by deleting a child element.
866 The <code>_ctime</code> attribute is created for each new element in an element
867 path.
868 </p>
869 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
870 arguments are retrieved via a server <em>INQUIRE</em>.
871 </p>
872 <p>See <a href="#Target-Attribute">Target Attribute</a>, for details about this special attribute.
873 </p>
875 <hr>
876 <a name="CACHETIMEOUT"></a>
877 <div class="header">
879 Next: <a href="#CLEARCACHE" accesskey="n" rel="next">CLEARCACHE</a>, Previous: <a href="#ATTR" accesskey="p" rel="prev">ATTR</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
880 </div>
881 <a name="CACHETIMEOUT-command"></a>
882 <h2 class="chapter">10 CACHETIMEOUT command</h2>
883 <a name="index-CACHETIMEOUT-command"></a>
884 <p>Syntax:
885 </p><div class="example">
886 <pre class="example">CACHETIMEOUT &lt;filename&gt; &lt;seconds&gt;
887 </pre></div>
889 <p>The time in <var>seconds</var> until <var>filename</var> will be removed from the
890 cache. <code>-1</code> will keep the cache entry forever, <code>0</code> will require
891 the passphrase for each <code>OPEN</code> or <code>SAVE</code> command (see <a href="#OPEN">OPEN</a>,
892 see <a href="#SAVE">SAVE</a>). See <a href="#Configuration">Configuration</a>, and the <code>cache_timeout</code>
893 parameter.
894 </p>
896 <hr>
897 <a name="CLEARCACHE"></a>
898 <div class="header">
900 Next: <a href="#COPY" accesskey="n" rel="next">COPY</a>, Previous: <a href="#CACHETIMEOUT" accesskey="p" rel="prev">CACHETIMEOUT</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
901 </div>
902 <a name="CLEARCACHE-command"></a>
903 <h2 class="chapter">11 CLEARCACHE command</h2>
904 <a name="index-CLEARCACHE-command"></a>
905 <p>Syntax:
906 </p><div class="example">
907 <pre class="example">CLEARCACHE [&lt;filename&gt;]
908 </pre></div>
910 <p>Clears a file cache entry for all or the specified <var>filename</var>.
911 </p>
913 <hr>
914 <a name="COPY"></a>
915 <div class="header">
917 Next: <a href="#DELETE" accesskey="n" rel="next">DELETE</a>, Previous: <a href="#CLEARCACHE" accesskey="p" rel="prev">CLEARCACHE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
918 </div>
919 <a name="COPY-command"></a>
920 <h2 class="chapter">12 COPY command</h2>
921 <a name="index-COPY-command"></a>
922 <p>Syntax:
923 </p><div class="example">
924 <pre class="example">COPY [--inquire] [!]source[&lt;TAB&gt;[!]child[..]] [!]dest[&lt;TAB&gt;[!]child[..]]
925 </pre></div>
927 <p>Copies the entire element tree starting from the child node of the source
928 element, to the destination element path. If the destination element path
929 does not exist then it will be created; otherwise it is overwritten.
930 </p>
931 <p>Note that attributes from the source element are merged into the
932 destination element when the destination element path exists. When an
933 attribute of the same name exists in both the source and destination
934 elements then the destination attribute will be updated to the source
935 attribute value.
936 </p>
937 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
938 arguments are retrieved via a server <em>INQUIRE</em>.
939 </p>
941 <hr>
942 <a name="DELETE"></a>
943 <div class="header">
945 Next: <a href="#DUMP" accesskey="n" rel="next">DUMP</a>, Previous: <a href="#COPY" accesskey="p" rel="prev">COPY</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
946 </div>
947 <a name="DELETE-command"></a>
948 <h2 class="chapter">13 DELETE command</h2>
949 <a name="index-DELETE-command"></a>
950 <p>Syntax:
951 </p><div class="example">
952 <pre class="example">DELETE [--inquire] [!]element[&lt;TAB&gt;[!]child[..]]
953 </pre></div>
955 <p>Removes the specified element path and all of its children. This may break
956 an element with a <code>target</code> attribute (see <a href="#Target-Attribute">Target Attribute</a>) that
957 refers to this element or any of its children.
958 </p>
959 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
960 arguments are retrieved via a server <em>INQUIRE</em>.
961 </p>
963 <hr>
964 <a name="DUMP"></a>
965 <div class="header">
967 Next: <a href="#GET" accesskey="n" rel="next">GET</a>, Previous: <a href="#DELETE" accesskey="p" rel="prev">DELETE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
968 </div>
969 <a name="DUMP-command"></a>
970 <h2 class="chapter">14 DUMP command</h2>
971 <a name="index-DUMP-command"></a>
972 <p>Syntax:
973 </p><div class="example">
974 <pre class="example">DUMP
975 </pre></div>
977 <p>Shows the in memory <abbr>XML</abbr> document with indenting. See <a href="#XPATH">XPATH</a>, for
978 dumping a specific node.
979 </p>
981 <hr>
982 <a name="GET"></a>
983 <div class="header">
985 Next: <a href="#GETCONFIG" accesskey="n" rel="next">GETCONFIG</a>, Previous: <a href="#DUMP" accesskey="p" rel="prev">DUMP</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
986 </div>
987 <a name="GET-command"></a>
988 <h2 class="chapter">15 GET command</h2>
989 <a name="index-GET-command"></a>
990 <p>Syntax:
991 </p><div class="example">
992 <pre class="example">GET [--inquire] [!]element[&lt;TAB&gt;[!]child[..]]
993 </pre></div>
995 <p>Retrieves the content of the specified element. The content is returned
996 with a data response.
997 </p>
998 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
999 arguments are retrieved via a server <em>INQUIRE</em>.
1000 </p>
1002 <hr>
1003 <a name="GETCONFIG"></a>
1004 <div class="header">
1006 Next: <a href="#GETINFO" accesskey="n" rel="next">GETINFO</a>, Previous: <a href="#GET" accesskey="p" rel="prev">GET</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1007 </div>
1008 <a name="GETCONFIG-command"></a>
1009 <h2 class="chapter">16 GETCONFIG command</h2>
1010 <a name="index-GETCONFIG-command"></a>
1011 <p>Syntax:
1012 </p><div class="example">
1013 <pre class="example">GETCONFIG [filename] &lt;parameter&gt;
1014 </pre></div>
1016 <p>Returns the value of a <code>pwmd</code> configuration <var>parameter</var> with a
1017 data response. If no file has been opened then the value for <var>filename</var>
1018 or the default from the &lsquo;<samp>global</samp>&rsquo; section will be returned. If a file
1019 has been opened and no <var>filename</var> is specified, a value previously
1020 set with the <code>OPTION</code> command (see <a href="#OPTION">OPTION</a>) will be returned.
1021 </p>
1023 <hr>
1024 <a name="GETINFO"></a>
1025 <div class="header">
1027 Next: <a href="#HELP" accesskey="n" rel="next">HELP</a>, Previous: <a href="#GETCONFIG" accesskey="p" rel="prev">GETCONFIG</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1028 </div>
1029 <a name="GETINFO-command"></a>
1030 <h2 class="chapter">17 GETINFO command</h2>
1031 <a name="index-GETINFO-command"></a>
1032 <p>Syntax:
1033 </p><div class="example">
1034 <pre class="example">GETINFO [--data] [--verbose] CACHE | CLIENTS | PID | USER | LAST_ERROR | VERSION
1035 </pre></div>
1037 <p>Get server and other information: <var>CACHE</var> returns the number of cached
1038 documents via a status message. <var>CLIENTS</var> returns the number of
1039 connected clients via a status message or a list of connected clients when
1040 the <samp>--verbose</samp> parameter is used. The list contains space delimited
1041 fields: the thread ID, client name, opened file (<code>/</code> if none opened),
1042 file lock status, whether the current client is self, client state and
1043 user ID or TLS fingerprint of the connected client.
1044 Client state <code>0</code> is an unknown client state, <code>1</code> indicates the
1045 client has connected but hasn&rsquo;t completed initializing, <code>2</code> indicates
1046 that the client is idle, <code>3</code> means the
1047 client is in a command and <code>4</code> means the client is disconnecting. This
1048 line is always returned with a data response. <var>PID</var> returns the process
1049 ID number of the server via a data response. <var>VERSION</var> returns the server
1050 version number and compile-time features with a data response with each
1051 being space delimited. <var>LAST_ERROR</var> returns a detailed description of
1052 the last failed command when available. <var>USER</var> returns the username or
1053 <abbr>TLS</abbr> hash of the connected client. See <a href="#Status-Messages">Status Messages</a>.
1054 </p>
1055 <p>When the <samp>--data</samp> option is specified then the result will be sent
1056 via a data response rather than a status message.
1057 </p>
1059 <hr>
1060 <a name="HELP"></a>
1061 <div class="header">
1063 Next: <a href="#IMPORT" accesskey="n" rel="next">IMPORT</a>, Previous: <a href="#GETINFO" accesskey="p" rel="prev">GETINFO</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1064 </div>
1065 <a name="HELP-command"></a>
1066 <h2 class="chapter">18 HELP command</h2>
1067 <a name="index-HELP-command"></a>
1068 <p>Syntax:
1069 </p><div class="example">
1070 <pre class="example">HELP [&lt;COMMAND&gt;]
1071 </pre></div>
1073 <p>Show available commands or command specific help text.
1074 </p>
1076 <hr>
1077 <a name="IMPORT"></a>
1078 <div class="header">
1080 Next: <a href="#ISCACHED" accesskey="n" rel="next">ISCACHED</a>, Previous: <a href="#HELP" accesskey="p" rel="prev">HELP</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1081 </div>
1082 <a name="IMPORT-command"></a>
1083 <h2 class="chapter">19 IMPORT command</h2>
1084 <a name="index-IMPORT-command"></a>
1085 <p>Syntax:
1086 </p><div class="example">
1087 <pre class="example">IMPORT [--root=[!]element[&lt;TAB&gt;[!]child[..]]] &lt;content&gt;
1088 </pre></div>
1090 <p>This command uses a server <em>INQUIRE</em> to retrieve data from the client.
1091 </p>
1092 <p>Like the <code>STORE</code> command (see <a href="#STORE">STORE</a>), but the <var>content</var>
1093 argument is raw <abbr>XML</abbr> data. The content is created as a child of
1094 the element path specified with the <samp>--root</samp> option or at the
1095 document root when not specified. Existing elements of the same name will
1096 be overwritten.
1097 </p>
1098 <p>The content must begin with an <abbr>XML</abbr> element node. See <a href="#Introduction">Introduction</a>,
1099 for details.
1100 </p>
1102 <hr>
1103 <a name="ISCACHED"></a>
1104 <div class="header">
1106 Next: <a href="#KEYGRIP" accesskey="n" rel="next">KEYGRIP</a>, Previous: <a href="#IMPORT" accesskey="p" rel="prev">IMPORT</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1107 </div>
1108 <a name="ISCACHED-command"></a>
1109 <h2 class="chapter">20 ISCACHED command</h2>
1110 <a name="index-ISCACHED-command"></a>
1111 <p>Syntax:
1112 </p><div class="example">
1113 <pre class="example">ISCACHED [--lock] &lt;filename&gt;
1114 </pre></div>
1116 <p>An <em>OK</em> response is returned if the specified <var>filename</var> is found
1117 in the file cache. If not found in the cache but exists on the filesystem
1118 then <var>GPG_ERR_NO_DATA</var> is returned. Otherwise a filesystem error is
1119 returned.
1120 </p>
1121 <p>The <samp>lock</samp> option will lock the file mutex of <var>filename</var> when the
1122 file exists; it does not need to be opened nor cached. The lock will be
1123 released when the client exits or sends the <code>UNLOCK</code> (see <a href="#UNLOCK">UNLOCK</a>)
1124 command.
1125 </p>
1127 <hr>
1128 <a name="KEYGRIP"></a>
1129 <div class="header">
1131 Next: <a href="#KILL" accesskey="n" rel="next">KILL</a>, Previous: <a href="#ISCACHED" accesskey="p" rel="prev">ISCACHED</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1132 </div>
1133 <a name="KEYGRIP-command"></a>
1134 <h2 class="chapter">21 KEYGRIP command</h2>
1135 <a name="index-KEYGRIP-command"></a>
1136 <p>Syntax:
1137 </p><div class="example">
1138 <pre class="example">KEYGRIP [--sign] &lt;filename&gt;
1139 </pre></div>
1141 <p>Returns the hex encoded keygrip of the specified <var>filename</var> with a
1142 data response.
1143 </p>
1144 <p>When the <samp>--sign</samp> option is specified then the key used for signing
1145 of the specified <var>filename</var> will be returned.
1146 </p>
1147 <p>For symmetrically encrypted data files this command returns the error
1148 GPG_ERR_NOT_SUPPORTED.
1149 </p>
1151 <hr>
1152 <a name="KILL"></a>
1153 <div class="header">
1155 Next: <a href="#LIST" accesskey="n" rel="next">LIST</a>, Previous: <a href="#KEYGRIP" accesskey="p" rel="prev">KEYGRIP</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1156 </div>
1157 <a name="KILL-command"></a>
1158 <h2 class="chapter">22 KILL command</h2>
1159 <a name="index-KILL-command"></a>
1160 <p>Syntax:
1161 </p><div class="example">
1162 <pre class="example">KILL &lt;thread_id&gt;
1163 </pre></div>
1165 <p>Terminates the client identified by <var>thread_id</var> and releases any file
1166 lock or other resources it has held. See <code>GETINFO</code> (see <a href="#GETINFO">GETINFO</a>)
1167 for details about listing connected clients.
1168 </p>
1170 <hr>
1171 <a name="LIST"></a>
1172 <div class="header">
1174 Next: <a href="#LOCK" accesskey="n" rel="next">LOCK</a>, Previous: <a href="#KILL" accesskey="p" rel="prev">KILL</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1175 </div>
1176 <a name="LIST-command"></a>
1177 <h2 class="chapter">23 LIST command</h2>
1178 <a name="index-LIST-command"></a>
1179 <p>Syntax:
1180 </p><div class="example">
1181 <pre class="example">LIST [--inquire] [--no-recurse] [--verbose] [--with-target] [--all] [[!]element[&lt;TAB&gt;[!]child[..]]]
1182 </pre></div>
1184 <p>If no element path is given then a newline separated list of root elements
1185 is returned with a data response. If given, then all reachable elements
1186 of the specified element path are returned unless the <samp>--no-recurse</samp>
1187 option is specified. If specified, only the child elements of the element
1188 path are returned without recursing into grandchildren. Each resulting
1189 element is prefixed with the literal <code>!</code> character when the element
1190 contains no <code>target</code> attribute. See <a href="#Target-Attribute">Target Attribute</a>, for details.
1191 </p>
1192 <p>When the <samp>--verbose</samp> option is passed then each element path
1193 returned will have zero or more flags appened to it. These flags are
1194 delimited from the element path by a single space character. A flag itself
1195 is a single character. Flag <code>P</code> indicates that access to the element
1196 is denied. Flag <code>+</code> indicates that there are child nodes of
1197 the current element path. Flag <code>E</code> indicates that an element of an
1198 element path contained in a <var>target</var> attribute could not be found. Flag
1199 <code>O</code> indicates that a <var>target</var> attribute recursion limit was reached
1200 (see <a href="#Configuration">Configuration</a>). Flag <code>T</code> will append the resolved element path
1201 of the <var>target</var> attribute contained in the current element (see below).
1202 </p>
1203 <p>The <samp>--with-target</samp> option implies <samp>--verbose</samp> and will append
1204 an additional flag <code>T</code> followed by a single space then an element path.
1205 The appended element path is the resolved path (see <a href="#REALPATH">REALPATH</a>) of the
1206 current element when it contains a <var>target</var> attribute. When no
1207 <var>target</var> attribute is found then no flag will be appended.
1208 </p>
1209 <p>The <samp>--no-recurse</samp> option limits the amount of data returned to only
1210 the listing of children of the specified element path and not any
1211 grandchildren.
1212 </p>
1213 <p>The <samp>--all</samp> option lists the entire element tree for each root
1214 element. This option also implies option <samp>--verbose</samp>.
1215 </p>
1216 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
1217 arguments are retrieved via a server <em>INQUIRE</em>.
1218 </p>
1220 <hr>
1221 <a name="LOCK"></a>
1222 <div class="header">
1224 Next: <a href="#LS" accesskey="n" rel="next">LS</a>, Previous: <a href="#LIST" accesskey="p" rel="prev">LIST</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1225 </div>
1226 <a name="LOCK-command"></a>
1227 <h2 class="chapter">24 LOCK command</h2>
1228 <a name="index-LOCK-command"></a>
1229 <p>Syntax:
1230 </p><div class="example">
1231 <pre class="example">LOCK
1232 </pre></div>
1234 <p>Locks the mutex associated with the opened file. This prevents other clients
1235 from sending commands to the same opened file until the client
1236 that sent this command either disconnects or sends the <code>UNLOCK</code>
1237 command. See <a href="#UNLOCK">UNLOCK</a>.
1238 </p>
1240 <hr>
1241 <a name="LS"></a>
1242 <div class="header">
1244 Next: <a href="#MOVE" accesskey="n" rel="next">MOVE</a>, Previous: <a href="#LOCK" accesskey="p" rel="prev">LOCK</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1245 </div>
1246 <a name="LS-command"></a>
1247 <h2 class="chapter">25 LS command</h2>
1248 <a name="index-LS-command"></a>
1249 <p>Syntax:
1250 </p><div class="example">
1251 <pre class="example">LS
1252 </pre></div>
1254 <p>Lists the available data files stored in the data directory
1255 (<samp>~/.pwmd/data</samp>). The result is a newline separated list of filenames.
1256 </p>
1258 <hr>
1259 <a name="MOVE"></a>
1260 <div class="header">
1262 Next: <a href="#NOP" accesskey="n" rel="next">NOP</a>, Previous: <a href="#LS" accesskey="p" rel="prev">LS</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1263 </div>
1264 <a name="MOVE-command"></a>
1265 <h2 class="chapter">26 MOVE command</h2>
1266 <a name="index-MOVE-command"></a>
1267 <p>Syntax:
1268 </p><div class="example">
1269 <pre class="example">MOVE [--inquire] [!]source[&lt;TAB&gt;[!]child[..]] [[!]dest[&lt;TAB&gt;[!]child[..]]]
1270 </pre></div>
1272 <p>Moves the source element path to the destination element path. If the
1273 destination is not specified then it will be moved to the root node of the
1274 document. If the destination is specified and exists then it will be
1275 overwritten; otherwise non-existing elements of the destination element
1276 path will be created.
1277 </p>
1278 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
1279 arguments are retrieved via a server <em>INQUIRE</em>.
1280 </p>
1282 <hr>
1283 <a name="NOP"></a>
1284 <div class="header">
1286 Next: <a href="#OPEN" accesskey="n" rel="next">OPEN</a>, Previous: <a href="#MOVE" accesskey="p" rel="prev">MOVE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1287 </div>
1288 <a name="NOP-command"></a>
1289 <h2 class="chapter">27 NOP command</h2>
1290 <a name="index-NOP-command"></a>
1291 <p>Syntax:
1292 </p><div class="example">
1293 <pre class="example">NOP
1294 </pre></div>
1296 <p>Does nothing. Always returns successfully.
1297 </p>
1299 <hr>
1300 <a name="OPEN"></a>
1301 <div class="header">
1303 Next: <a href="#OPTION" accesskey="n" rel="next">OPTION</a>, Previous: <a href="#NOP" accesskey="p" rel="prev">NOP</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1304 </div>
1305 <a name="OPEN-command"></a>
1306 <h2 class="chapter">28 OPEN command</h2>
1307 <a name="index-OPEN-command"></a>
1308 <p>Syntax:
1309 </p><div class="example">
1310 <pre class="example">OPEN [--lock] &lt;filename&gt; [&lt;passphrase&gt;]
1311 </pre></div>
1313 <p>Opens <var>filename</var> using <var>passphrase</var>. When the filename is not
1314 found on the file-system then a new document will be created. If the file
1315 is found, it is looked for in the file cache. If cached and no
1316 <var>passphrase</var> was specified then the cached document is opened. When not
1317 cached, <cite>pinentry(1)</cite> will be used to retrieve the passphrase to use
1318 for decryption unless <samp>disable-pinentry</samp> (see <a href="#OPTION">OPTION</a>) was
1319 specified.
1320 </p>
1321 <p>When the <samp>--lock</samp> option is passed then the file mutex will be
1322 locked as if the <code>LOCK</code> command (see <a href="#LOCK">LOCK</a>) had been sent after the
1323 file has been opened.
1324 </p>
1326 <hr>
1327 <a name="OPTION"></a>
1328 <div class="header">
1330 Next: <a href="#PASSWD" accesskey="n" rel="next">PASSWD</a>, Previous: <a href="#OPEN" accesskey="p" rel="prev">OPEN</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1331 </div>
1332 <a name="OPTION-command"></a>
1333 <h2 class="chapter">29 OPTION command</h2>
1334 <a name="index-OPTION-command"></a>
1335 <p>Syntax:
1336 </p><div class="example">
1337 <pre class="example">OPTION &lt;NAME&gt;=&lt;VALUE&gt;
1338 </pre></div>
1340 <p>Sets a client option <var>name</var> to <var>value</var>. The value for an option is
1341 kept for the duration of the connection.
1342 </p>
1343 <dl compact="compact">
1344 <dt>DISABLE-PINENTRY</dt>
1345 <dd><p>Disable use of <code>pinentry</code> for passphrase retrieval. When set, a
1346 server inquire is sent to the client to obtain the passphrase. This option
1347 may be set as needed before the <code>OPEN</code> (see <a href="#OPEN">OPEN</a>), <code>PASSWD</code>
1348 (see <a href="#PASSWD">PASSWD</a>) and <code>SAVE</code> (see <a href="#SAVE">SAVE</a>) commands.
1349 </p>
1350 </dd>
1351 <dt>PINENTRY-TIMEOUT</dt>
1352 <dd><p>Sets the number of seconds before a pinentry prompt will return an error
1353 while waiting for user input.
1354 </p>
1355 </dd>
1356 <dt>TTYNAME</dt>
1357 <dd><p>Passed to the <code>gpg-agent</code> and used for the <code>pinentry</code> dialog.
1358 </p>
1359 </dd>
1360 <dt>TTYTYPE</dt>
1361 <dd><p>Passed to the <code>gpg-agent</code> and used for the <code>pinentry</code> dialog.
1362 </p>
1363 </dd>
1364 <dt>DISPLAY</dt>
1365 <dd><p>Passed to the <code>gpg-agent</code> and used for the <code>pinentry</code> dialog.
1366 </p>
1367 </dd>
1368 <dt>PINENTRY-DESC</dt>
1369 <dd><p>Sets the description string of the <code>gpg-agent</code> and <code>pinentry</code> dialog.
1370 </p>
1371 </dd>
1372 <dt>PINENTRY-TITLE</dt>
1373 <dd><p>Sets the title string of the <code>gpg-agent</code> and <code>pinentry</code> dialog.
1374 </p>
1375 </dd>
1376 <dt>PINENTRY-PROMPT</dt>
1377 <dd><p>Sets the prompt string of the <code>gpg-agent</code> and <code>pinentry</code> dialog.
1378 </p>
1379 </dd>
1380 <dt>LC-CTYPE</dt>
1381 <dd><p>Passed to the <code>gpg-agent</code> and used for the <code>pinentry</code> dialog.
1382 </p>
1383 </dd>
1384 <dt>LC-MESSAGES</dt>
1385 <dd><p>Passed to the <code>gpg-agent</code> and used for the <code>pinentry</code> dialog.
1386 </p>
1387 </dd>
1388 <dt>NAME</dt>
1389 <dd><p>Associates the thread ID of the connection with the specified textual
1390 representation. Useful for debugging log messages. May not contain whitespace.
1391 </p>
1392 </dd>
1393 <dt>LOCK-TIMEOUT</dt>
1394 <dd><p>When not <code>0</code>, the duration in tenths of a second to wait for the file
1395 mutex which has been locked by another thread to be released before returning
1396 an error. When <code>-1</code>, then an error will be returned immediately.
1397 </p>
1398 </dd>
1399 <dt>LOG-LEVEL</dt>
1400 <dd><p>An integer specifiying the logging level.
1401 </p></dd>
1402 </dl>
1405 <hr>
1406 <a name="PASSWD"></a>
1407 <div class="header">
1409 Next: <a href="#REALPATH" accesskey="n" rel="next">REALPATH</a>, Previous: <a href="#OPTION" accesskey="p" rel="prev">OPTION</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1410 </div>
1411 <a name="PASSWD-command"></a>
1412 <h2 class="chapter">30 PASSWD command</h2>
1413 <a name="index-PASSWD-command"></a>
1414 <p>Syntax:
1415 </p><div class="example">
1416 <pre class="example">PASSWD [--reset] [--s2k-count=N] [--no-passphrase]
1417 </pre></div>
1419 <p>Changes the passphrase of the secret key required to open the current
1420 file or the passphrase of a symmetrically encrypted data file. When the
1421 <samp>--reset</samp> option is passed then the cache entry for the current
1422 file will be reset and the passphrase, if any, will be required during the
1423 next <code>OPEN</code> (see <a href="#OPEN">OPEN</a>).
1424 </p>
1425 <p>The <samp>--s2k-count</samp> option sets or changes (see <a href="#SAVE">SAVE</a>) the number
1426 of hash iterations for a passphrase and must be either <code>0</code> to use
1427 the calibrated count of the machine (the default), or a value greater than
1428 or equal to <code>65536</code>. This option has no effect for symmetrically
1429 encrypted data files.
1430 </p>
1431 <p>The <samp>--no-passphrase</samp> option will prevent requiring a passphrase for
1432 the data file, although a passphrase may be required when changing it.
1433 </p>
1434 <p>This command is not available for non-invoking clients
1435 (see <a href="#Access-Control">Access Control</a>).
1436 </p>
1438 <hr>
1439 <a name="REALPATH"></a>
1440 <div class="header">
1442 Next: <a href="#RENAME" accesskey="n" rel="next">RENAME</a>, Previous: <a href="#PASSWD" accesskey="p" rel="prev">PASSWD</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1443 </div>
1444 <a name="REALPATH-command"></a>
1445 <h2 class="chapter">31 REALPATH command</h2>
1446 <a name="index-REALPATH-command"></a>
1447 <p>Syntax:
1448 </p><div class="example">
1449 <pre class="example">REALPATH [--inquire] [!]element[&lt;TAB&gt;[!]child[..]]
1450 </pre></div>
1452 <p>Resolves all <code>target</code> attributes of the specified element path and
1453 returns the result with a data response. See <a href="#Target-Attribute">Target Attribute</a>, for details.
1454 </p>
1455 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
1456 arguments are retrieved via a server <em>INQUIRE</em>.
1457 </p>
1459 <hr>
1460 <a name="RENAME"></a>
1461 <div class="header">
1463 Next: <a href="#RESET" accesskey="n" rel="next">RESET</a>, Previous: <a href="#REALPATH" accesskey="p" rel="prev">REALPATH</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1464 </div>
1465 <a name="RENAME-command"></a>
1466 <h2 class="chapter">32 RENAME command</h2>
1467 <a name="index-RENAME-command"></a>
1468 <p>Syntax:
1469 </p><div class="example">
1470 <pre class="example">RENAME [--inquire] [!]element[&lt;TAB&gt;[!]child[..]] &lt;value&gt;
1471 </pre></div>
1473 <p>Renames the specified <var>element</var> to the new <var>value</var>. If an element of
1474 the same name as the <var>value</var> already exists it will be overwritten.
1475 </p>
1476 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
1477 arguments are retrieved via a server <em>INQUIRE</em>.
1478 </p>
1480 <hr>
1481 <a name="RESET"></a>
1482 <div class="header">
1484 Next: <a href="#SAVE" accesskey="n" rel="next">SAVE</a>, Previous: <a href="#RENAME" accesskey="p" rel="prev">RENAME</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1485 </div>
1486 <a name="RESET-command"></a>
1487 <h2 class="chapter">33 RESET command</h2>
1488 <a name="index-RESET-command"></a>
1489 <p>Syntax:
1490 </p><div class="example">
1491 <pre class="example">RESET
1492 </pre></div>
1494 <p>Closes the currently opened file but keeps any previously set client options.
1495 </p>
1497 <hr>
1498 <a name="SAVE"></a>
1499 <div class="header">
1501 Next: <a href="#STORE" accesskey="n" rel="next">STORE</a>, Previous: <a href="#RESET" accesskey="p" rel="prev">RESET</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1502 </div>
1503 <a name="SAVE-command"></a>
1504 <h2 class="chapter">34 SAVE command</h2>
1505 <a name="index-SAVE-command"></a>
1506 <p>Syntax:
1507 </p><div class="example">
1508 <pre class="example">SAVE [--no-passphrase] [--reset] [--no-agent] [--s2k-count=N] [--cipher=&lt;algo&gt;] [--cipher-iterations=N] [--inquire-keyparam] [--keygrip=hexstring] [--sign-keygrip=hexstring]
1509 </pre></div>
1511 <p>Writes the <abbr>XML</abbr> document to disk. The file written to is the file that
1512 was opened using the <code>OPEN</code> command (see <a href="#OPEN">OPEN</a>). If the file is a
1513 new one or the option <samp>--inquire-keyparam</samp> was passed, then a new
1514 keypair will be generated and a pinentry will be used to prompt for the
1515 passphrase to encrypt with unless the <samp>--no-passphrase</samp> option was
1516 passed in which case the data file will not be passphrase protected.
1517 </p>
1518 <p>The <samp>--no-agent</samp> option disables use of <code>gpg-agent</code> for
1519 passphrase retrieval and caching of new files when <code>gpg-agent</code>
1520 use is enabled. The datafile will be symmetrically encrypted and will not
1521 use or generate any keypair.
1522 </p>
1523 <p>The <samp>--reset</samp> option will clear the cache entry for the current file
1524 and require a passphrase, if needed, before saving.
1525 </p>
1526 <p>The <samp>--cipher</samp> option can be used to encrypt the <abbr>XML</abbr> data to
1527 an alternate cipher. The default is <code>aes256</code>. See the Configuration
1528 (see <a href="#Configuration">Configuration</a>) for available ciphers.
1529 </p>
1530 <p>The <samp>--cipher-iterations</samp> option specifies the number of times to
1531 encrypt the XML data. The default is 0 although 1 iteration is still done.
1532 </p>
1533 <p>The <samp>--inquire-keyparam</samp> option will send a server <em>INQUIRE</em> to
1534 the client to obtain the key paramaters to use when generating a new
1535 keypair. The inquired data is expected to be an S-expression. If not
1536 specified then an &lsquo;<samp>RSA</samp>&rsquo; key of &lsquo;<samp>2048</samp>&rsquo; bits will be generated
1537 unless otherwise set in the configuration file (see <a href="#Configuration">Configuration</a>). Note
1538 that when this option is specified a new keypair will be generated
1539 reguardless if the file is a new one and that if the data file is protected
1540 the passphrase to open it will be required before generating the new
1541 keypair. This option is not available for non-invoking clients
1542 (see <a href="#Access-Control">Access Control</a>).
1543 </p>
1544 <p>You can encrypt the data file to a public key other than the one that it
1545 was originally encrypted with by passing the <samp>--keygrip</samp> option with
1546 the hex encoded keygrip of the public key as its argument. The keygrip may
1547 be of any key that <code>gpg-agent</code> knows about. The
1548 <samp>--sign-keygrip</samp> option may also be used to sign with an alternate
1549 secret key. Use the <code>KEYGRIP</code> (see <a href="#KEYGRIP">KEYGRIP</a>) command to obtain the
1550 keygrip of an existing data file. This option may be needed when using a
1551 smartcard. This option has no effect with symmetrically encrypted data
1552 files. These options are not available for non-invoking clients
1553 (see <a href="#Access-Control">Access Control</a>).
1554 </p>
1555 <p>The <samp>--s2k-count</samp> option sets number of hash iterations for a
1556 passphrase. A value less-than <code>65536</code> will use the machine calibrated
1557 value and is the default. This setting only affects new files. To change
1558 the setting use the <code>PASSWD</code> command (see <a href="#PASSWD">PASSWD</a>). This option
1559 has no effect with symmetrically encrypted data files.
1560 </p>
1562 <hr>
1563 <a name="STORE"></a>
1564 <div class="header">
1566 Next: <a href="#UNLOCK" accesskey="n" rel="next">UNLOCK</a>, Previous: <a href="#SAVE" accesskey="p" rel="prev">SAVE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1567 </div>
1568 <a name="STORE-command"></a>
1569 <h2 class="chapter">35 STORE command</h2>
1570 <a name="index-STORE-command"></a>
1571 <p>Syntax:
1572 </p><div class="example">
1573 <pre class="example">STORE [!]element[&lt;TAB&gt;[!]child[..]]&lt;TAB&gt;[content]
1574 </pre></div>
1576 <p>This command uses a server <em>INQUIRE</em> to retrieve data from the client.
1577 </p>
1578 <p>Creates a new element path or modifies the <var>content</var> of an existing
1579 element. If only a single element is specified then a new root element is
1580 created. Otherwise, elements are <tt class="key">TAB</tt> delimited and the content will be
1581 set to the final <tt class="key">TAB</tt> delimited element. If no <var>content</var> is
1582 specified after the final <tt class="key">TAB</tt>, then the content of an existing
1583 element will be removed; or empty when creating a new element.
1584 </p>
1585 <p>The only restriction of an element name is that it not contain whitespace
1586 or begin with the literal element character <code>!</code> unless specifying a
1587 literal element (see <a href="#Target-Attribute">Target Attribute</a>). There is no whitespace between
1588 the <tt class="key">TAB</tt> delimited elements. It is recommended that the content of an
1589 element be base64 encoded when it contains control or <tt class="key">TAB</tt> characters
1590 to prevent <abbr>XML</abbr> parsing and <code>pwmd</code> syntax errors.
1591 </p>
1593 <hr>
1594 <a name="UNLOCK"></a>
1595 <div class="header">
1597 Next: <a href="#XPATH" accesskey="n" rel="next">XPATH</a>, Previous: <a href="#STORE" accesskey="p" rel="prev">STORE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1598 </div>
1599 <a name="UNLOCK-command"></a>
1600 <h2 class="chapter">36 UNLOCK command</h2>
1601 <a name="index-UNLOCK-command"></a>
1602 <p>Syntax:
1603 </p><div class="example">
1604 <pre class="example">UNLOCK
1605 </pre></div>
1607 <p>Unlocks the file mutex which was locked with the <code>LOCK</code> command or
1608 a commands&rsquo; <samp>--lock</samp> option (see <a href="#LOCK">LOCK</a>, see <a href="#OPEN">OPEN</a>,
1609 see <a href="#ISCACHED">ISCACHED</a>).
1610 </p>
1612 <hr>
1613 <a name="XPATH"></a>
1614 <div class="header">
1616 Next: <a href="#XPATHATTR" accesskey="n" rel="next">XPATHATTR</a>, Previous: <a href="#UNLOCK" accesskey="p" rel="prev">UNLOCK</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1617 </div>
1618 <a name="XPATH-command"></a>
1619 <h2 class="chapter">37 XPATH command</h2>
1620 <a name="index-XPATH-command"></a>
1621 <p>Syntax:
1622 </p><div class="example">
1623 <pre class="example">XPATH [--inquire] &lt;expression&gt;[&lt;TAB&gt;[value]]
1624 </pre></div>
1626 <p>Evaluates an XPath <var>expression</var>. If no <var>value</var> argument is
1627 specified it is assumed the expression is a request to return a result.
1628 Otherwise, the result is set to the <var>value</var> argument and the document is
1629 updated. If there is no <var>value</var> after the <tt class="key">TAB</tt> character, the value
1630 is assumed to be empty and the document is updated. For example:
1631 </p><br>
1632 <div class="example">
1633 <pre class="example">XPATH //element[@_name='password']<span class="key">TAB</span>
1634 </pre></div>
1635 <br>
1636 <p>would clear the content of all <code>password</code> elements in the data file
1637 while leaving off the trailing <tt class="key">TAB</tt> would return all <code>password</code>
1638 elements in <abbr>XML</abbr> format.
1639 </p>
1640 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
1641 arguments are retrieved via a server <em>INQUIRE</em>.
1642 </p>
1643 <p>See <a href="http://www.w3schools.com/xpath/xpath_syntax.asp">http://www.w3schools.com/xpath/xpath_syntax.asp</a> for <abbr>XPATH</abbr>
1644 expression syntax.
1645 </p>
1647 <hr>
1648 <a name="XPATHATTR"></a>
1649 <div class="header">
1651 Previous: <a href="#XPATH" accesskey="p" rel="prev">XPATH</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1652 </div>
1653 <a name="XPATHATTR-command"></a>
1654 <h2 class="chapter">38 XPATHATTR command</h2>
1655 <a name="index-XPATHATTR-command"></a>
1656 <p>Syntax:
1657 </p><div class="example">
1658 <pre class="example">XPATHATTR [--inquire] SET|DELETE &lt;name&gt; &lt;expression&gt;[&lt;TAB&gt;[&lt;value&gt;]]
1659 </pre></div>
1661 <p>Like the <code>XPATH</code> command (see <a href="#XPATH">XPATH</a>) but operates on element
1662 attributes and does not return a result. For the <var>SET</var> operation the
1663 <var>value</var> is optional but the field is required. If not specified then
1664 the attribute value will be empty. For example:
1665 </p><br>
1666 <div class="example">
1667 <pre class="example">XPATHATTR SET password //element[@_name='password']<span class="key">TAB</span>
1668 </pre></div>
1669 <br>
1670 <p>would create an <code>password</code> attribute for each <code>password</code> element
1671 found in the document. The attribute value will be empty but still exist.
1672 </p>
1673 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
1674 arguments are retrieved via a server <em>INQUIRE</em>.
1675 </p>
1676 <p>See <a href="http://www.w3schools.com/xpath/xpath_syntax.asp">http://www.w3schools.com/xpath/xpath_syntax.asp</a> for <abbr>XPATH</abbr>
1677 expression syntax.
1678 </p>
1681 <hr>
1682 <a name="Status-Messages"></a>
1683 <div class="header">
1685 Next: <a href="#Target-Attribute" accesskey="n" rel="next">Target Attribute</a>, Previous: <a href="#Commands" accesskey="p" rel="prev">Commands</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1686 </div>
1687 <a name="Status-messages-and-their-meanings"></a>
1688 <h2 class="chapter">39 Status messages and their meanings</h2>
1689 <p>Some commands send status messages to inform the client about certain
1690 operations or as a progress indicator. Status messages begin with a
1691 <code>KEYWORD</code> followed by a status description for status messages that
1692 require it. What status messages are sent, when, and how often may depend on
1693 configuration settings (see <a href="#Configuration">Configuration</a>). A status message sent from
1694 <code>gpg-agent</code> (See <a href="http://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html#Invoking-GPG_002dAGENT">(gnupg)Invoking GPG-AGENT</a>) is also forwarded to
1695 the client.
1696 </p>
1697 <table>
1698 <thead><tr><th width="20%">Message</th><th width="25%">Parameters</th><th width="55%">Description</th></tr></thead>
1699 <tr><td width="20%">CACHE
1700 <a name="index-CACHE"></a></td><td width="25%"><code>&lt;integer&gt;</code></td><td width="55%">The number of cached documents. Sent to each client after connecting
1701 (see <a href="#GETINFO">GETINFO</a>) and after every cache modification.</td></tr>
1702 <tr><td width="20%">CLIENTS
1703 <a name="index-CLIENTS"></a></td><td width="25%"><code>&lt;integer&gt;</code></td><td width="55%">The number of connected clients (see <a href="#GETINFO">GETINFO</a>). Sent to each client
1704 when another client either connects or disconnects.</td></tr>
1705 <tr><td width="20%">DECRYPT
1706 <a name="index-DECRYPT"></a></td><td width="25%"><code>&lt;current&gt;</code> <code>&lt;total&gt;</code></td><td width="55%">Sent to the current client during a decrypt operation. How often this
1707 status message is sent is determined by the <code>cipher_progress</code>
1708 (see <a href="#Configuration">Configuration</a>) setting.</td></tr>
1709 <tr><td width="20%">ENCRYPT
1710 <a name="index-ENCRYPT"></a></td><td width="25%"><code>&lt;current&gt;</code> <code>&lt;total&gt;</code></td><td width="55%">Sent to the current client during an encrypt operation. How often this
1711 status message is sent is determined by the <code>cipher_progress</code>
1712 (see <a href="#Configuration">Configuration</a>) setting.</td></tr>
1713 <tr><td width="20%">GENKEY
1714 <a name="index-GENKEY"></a></td><td width="25%"></td><td width="55%">Sent once to the current client just before generating a new key-pair.</td></tr>
1715 <tr><td width="20%">INQUIRE_MAXLEN
1716 <a name="index-INQUIRE_005fMAXLEN"></a></td><td width="25%"><code>&lt;bytes&gt;</code></td><td width="55%">Sent to the client from <code>gpg-agent</code> when inquiring data. This
1717 specifies the maximum number of bytes allowed for the client to send and
1718 should not be exceeded.</td></tr>
1719 <tr><td width="20%">KEEPALIVE
1720 <a name="index-KEEPALIVE"></a></td><td width="25%"></td><td width="55%">Sent to each idle client every <var>keepalive_interval</var>
1721 (see <a href="#Configuration">Configuration</a>) seconds.</td></tr>
1722 <tr><td width="20%">LOCKED
1723 <a name="index-LOCKED"></a></td><td width="25%"></td><td width="55%">Sent to the current client when another client is holding the lock for
1724 the mutex associated with a file.</td></tr>
1725 <tr><td width="20%">NEWFILE
1726 <a name="index-NEWFILE"></a></td><td width="25%"></td><td width="55%">Sent to the current client when the opened (see <a href="#OPEN">OPEN</a>) file does not
1727 exist on the file-system.</td></tr>
1728 <tr><td width="20%">XFER
1729 <a name="index-XFER"></a></td><td width="25%"><code>&lt;sent&gt; &lt;total&gt;</code></td><td width="55%">Sent to the current client when transferring data. It has two space
1730 delimited arguments. The first being the current amount of bytes transferred
1731 and the other being the total bytes to be transferred.</td></tr>
1732 <tr><td width="20%">STATE
1733 <a name="index-STATE"></a></td><td width="25%"><code>&lt;client_id&gt; &lt;state&gt;</code></td><td width="55%">Sent to all connected clients to indicate that <var>client_id</var> has
1734 changed to <var>state</var> (see <a href="#GETINFO">GETINFO</a> to describe the available client
1735 states).</td></tr>
1736 </table>
1738 <hr>
1739 <a name="Target-Attribute"></a>
1740 <div class="header">
1742 Next: <a href="#Signals" accesskey="n" rel="next">Signals</a>, Previous: <a href="#Status-Messages" accesskey="p" rel="prev">Status Messages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1743 </div>
1744 <a name="The-target-attribute"></a>
1745 <h2 class="chapter">40 The <code>target</code> attribute</h2>
1746 <a name="index-target-attribute"></a>
1747 <p>A <em>case sensitive</em> attribute named <code>target</code> is treated specially
1748 when found in each element of an element path. This attribute, like other
1749 element attributes, is created or modified with the <code>ATTR</code> command
1750 (see <a href="#ATTR">ATTR</a>). The value of this attribute is an existing element path
1751 somewhere in the document. If you are familiar with <abbr>XML</abbr> entities or
1752 maybe the <abbr>HTML</abbr> <code>id</code> or <code>target</code> attributes or a symbolic link
1753 in a file-system, you may find this attribute behaves similar to any of those.
1754 </p>
1755 <p>To create a <code>target</code> attribute use the following syntax:
1756 </p>
1757 <div class="example">
1758 <pre class="example">ATTR SET target [!]element[<span class="key">TAB</span>[!]child[..]] [!]element[<span class="key">TAB</span>[!]child[..]]
1759 </pre></div>
1761 <p>Note the single space between the two element paths. The first element path is
1762 where the <code>target</code> attribute will be created. If the element path does
1763 not exist then it will be created. This is the only time the <code>ATTR</code>
1764 (see <a href="#ATTR">ATTR</a>) command will create elements. The attribute is created in the
1765 final element of the first element path.
1766 </p>
1767 <p>The second element path is the destination of where you want the first element
1768 path to resolve to. When an element path is passed as an argument to a
1769 protocol command <code>pwmd</code> looks for a <code>target</code> attribute when
1770 resolving each element and, if found, &quot;jumps&quot; to the attribute value and
1771 continues resolving any remaining elements. When you want to avoid the
1772 <code>target</code> attribute for any element of an element path then prefix the
1773 element with the literal element character &lsquo;<samp>!</samp>&rsquo;.
1774 </p>
1775 <p>When an element of a element path is removed that a <code>target</code> attribute
1776 resolves to then an error will occur when trying to access that element. You
1777 may need to either update the <code>target</code> attribute value with a new element
1778 path or remove the attribute entirely. Remember that since the element
1779 contains the <code>target</code> attribute it will need to be prefixed with the
1780 literal element character &lsquo;<samp>!</samp>&rsquo; when specifying the element path to prevent
1781 <code>pwmd</code> from trying to resolve the <code>target</code> attribute. For
1782 example, to remove a <code>target</code> attribute for an element containing it:
1783 </p>
1784 <div class="example">
1785 <pre class="example">ATTR DELETE target path<span class="key">TAB</span>to<span class="key">TAB</span>!element
1786 </pre></div>
1788 <p>Clients should be careful of creating <code>target</code> loops, or targets that
1789 resolve to themselves. See the <var>recursion_depth</var> (see <a href="#Configuration">Configuration</a>)
1790 configuration parameter for details.
1791 </p>
1792 <p>The <code>REALPATH</code> command (see <a href="#REALPATH">REALPATH</a>) can be used to show the element
1793 path after resolving all <code>target</code> attributes.
1794 </p>
1796 <hr>
1797 <a name="Signals"></a>
1798 <div class="header">
1800 Next: <a href="#Concept-Index" accesskey="n" rel="next">Concept Index</a>, Previous: <a href="#Target-Attribute" accesskey="p" rel="prev">Target Attribute</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1801 </div>
1802 <a name="Recognized-signals"></a>
1803 <h2 class="chapter">41 Recognized signals</h2>
1805 <p>Sending the <em>SIGHUP</em> signal to a <code>pwmd</code> process will reload the
1806 configuration file and sending <em>SIGUSR1</em> will clear the entire file
1807 cache.
1808 </p>
1811 <hr>
1812 <a name="Concept-Index"></a>
1813 <div class="header">
1815 Previous: <a href="#Signals" accesskey="p" rel="prev">Signals</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1816 </div>
1817 <a name="Concept-Index-1"></a>
1818 <h2 class="unnumbered">Concept Index</h2>
1821 <a name="SEC_Overview"></a>
1822 <h2 class="shortcontents-heading">Short Table of Contents</h2>
1824 <div class="shortcontents">
1825 <ul class="no-bullet">
1826 <li><a name="stoc-Overview-of-pwmd" href="#toc-Overview-of-pwmd">1 Overview of <code>pwmd</code></a></li>
1827 <li><a name="stoc-Access-Control-1" href="#toc-Access-Control-1">2 Access Control</a></li>
1828 <li><a name="stoc-Invoking-pwmd" href="#toc-Invoking-pwmd">3 Invoking <code>pwmd</code></a></li>
1829 <li><a name="stoc-pwmd-configuration-file-options" href="#toc-pwmd-configuration-file-options">4 <code>pwmd</code> configuration file options</a></li>
1830 <li><a name="stoc-Configuring-remote-connections-over-TLS_002e" href="#toc-Configuring-remote-connections-over-TLS_002e">5 Configuring remote connections over TLS.</a></li>
1831 <li><a name="stoc-Pinentry-configuration" href="#toc-Pinentry-configuration">6 Pinentry configuration</a></li>
1832 <li><a name="stoc-Protocol-commands-and-their-syntax" href="#toc-Protocol-commands-and-their-syntax">7 Protocol commands and their syntax</a></li>
1833 <li><a name="stoc-AGENT-command" href="#toc-AGENT-command">8 AGENT command</a></li>
1834 <li><a name="stoc-ATTR-command" href="#toc-ATTR-command">9 ATTR command</a></li>
1835 <li><a name="stoc-CACHETIMEOUT-command" href="#toc-CACHETIMEOUT-command">10 CACHETIMEOUT command</a></li>
1836 <li><a name="stoc-CLEARCACHE-command" href="#toc-CLEARCACHE-command">11 CLEARCACHE command</a></li>
1837 <li><a name="stoc-COPY-command" href="#toc-COPY-command">12 COPY command</a></li>
1838 <li><a name="stoc-DELETE-command" href="#toc-DELETE-command">13 DELETE command</a></li>
1839 <li><a name="stoc-DUMP-command" href="#toc-DUMP-command">14 DUMP command</a></li>
1840 <li><a name="stoc-GET-command" href="#toc-GET-command">15 GET command</a></li>
1841 <li><a name="stoc-GETCONFIG-command" href="#toc-GETCONFIG-command">16 GETCONFIG command</a></li>
1842 <li><a name="stoc-GETINFO-command" href="#toc-GETINFO-command">17 GETINFO command</a></li>
1843 <li><a name="stoc-HELP-command" href="#toc-HELP-command">18 HELP command</a></li>
1844 <li><a name="stoc-IMPORT-command" href="#toc-IMPORT-command">19 IMPORT command</a></li>
1845 <li><a name="stoc-ISCACHED-command" href="#toc-ISCACHED-command">20 ISCACHED command</a></li>
1846 <li><a name="stoc-KEYGRIP-command" href="#toc-KEYGRIP-command">21 KEYGRIP command</a></li>
1847 <li><a name="stoc-KILL-command" href="#toc-KILL-command">22 KILL command</a></li>
1848 <li><a name="stoc-LIST-command" href="#toc-LIST-command">23 LIST command</a></li>
1849 <li><a name="stoc-LOCK-command" href="#toc-LOCK-command">24 LOCK command</a></li>
1850 <li><a name="stoc-LS-command" href="#toc-LS-command">25 LS command</a></li>
1851 <li><a name="stoc-MOVE-command" href="#toc-MOVE-command">26 MOVE command</a></li>
1852 <li><a name="stoc-NOP-command" href="#toc-NOP-command">27 NOP command</a></li>
1853 <li><a name="stoc-OPEN-command" href="#toc-OPEN-command">28 OPEN command</a></li>
1854 <li><a name="stoc-OPTION-command" href="#toc-OPTION-command">29 OPTION command</a></li>
1855 <li><a name="stoc-PASSWD-command" href="#toc-PASSWD-command">30 PASSWD command</a></li>
1856 <li><a name="stoc-REALPATH-command" href="#toc-REALPATH-command">31 REALPATH command</a></li>
1857 <li><a name="stoc-RENAME-command" href="#toc-RENAME-command">32 RENAME command</a></li>
1858 <li><a name="stoc-RESET-command" href="#toc-RESET-command">33 RESET command</a></li>
1859 <li><a name="stoc-SAVE-command" href="#toc-SAVE-command">34 SAVE command</a></li>
1860 <li><a name="stoc-STORE-command" href="#toc-STORE-command">35 STORE command</a></li>
1861 <li><a name="stoc-UNLOCK-command" href="#toc-UNLOCK-command">36 UNLOCK command</a></li>
1862 <li><a name="stoc-XPATH-command" href="#toc-XPATH-command">37 XPATH command</a></li>
1863 <li><a name="stoc-XPATHATTR-command" href="#toc-XPATHATTR-command">38 XPATHATTR command</a></li>
1864 <li><a name="stoc-Status-messages-and-their-meanings" href="#toc-Status-messages-and-their-meanings">39 Status messages and their meanings</a></li>
1865 <li><a name="stoc-The-target-attribute" href="#toc-The-target-attribute">40 The <code>target</code> attribute</a></li>
1866 <li><a name="stoc-Recognized-signals" href="#toc-Recognized-signals">41 Recognized signals</a></li>
1867 <li><a name="stoc-Concept-Index-1" href="#toc-Concept-Index-1">Concept Index</a></li>
1869 </ul>
1870 </div>
1872 <a name="SEC_Contents"></a>
1873 <h2 class="contents-heading">Table of Contents</h2>
1875 <div class="contents">
1876 <ul class="no-bullet">
1877 <li><a name="toc-Overview-of-pwmd" href="#Introduction">1 Overview of <code>pwmd</code></a></li>
1878 <li><a name="toc-Access-Control-1" href="#Access-Control">2 Access Control</a></li>
1879 <li><a name="toc-Invoking-pwmd" href="#Invoking">3 Invoking <code>pwmd</code></a></li>
1880 <li><a name="toc-pwmd-configuration-file-options" href="#Configuration">4 <code>pwmd</code> configuration file options</a></li>
1881 <li><a name="toc-Configuring-remote-connections-over-TLS_002e" href="#TLS">5 Configuring remote connections over TLS.</a></li>
1882 <li><a name="toc-Pinentry-configuration" href="#Pinentry">6 Pinentry configuration</a></li>
1883 <li><a name="toc-Protocol-commands-and-their-syntax" href="#Commands">7 Protocol commands and their syntax</a></li>
1884 <li><a name="toc-AGENT-command" href="#AGENT">8 AGENT command</a></li>
1885 <li><a name="toc-ATTR-command" href="#ATTR">9 ATTR command</a></li>
1886 <li><a name="toc-CACHETIMEOUT-command" href="#CACHETIMEOUT">10 CACHETIMEOUT command</a></li>
1887 <li><a name="toc-CLEARCACHE-command" href="#CLEARCACHE">11 CLEARCACHE command</a></li>
1888 <li><a name="toc-COPY-command" href="#COPY">12 COPY command</a></li>
1889 <li><a name="toc-DELETE-command" href="#DELETE">13 DELETE command</a></li>
1890 <li><a name="toc-DUMP-command" href="#DUMP">14 DUMP command</a></li>
1891 <li><a name="toc-GET-command" href="#GET">15 GET command</a></li>
1892 <li><a name="toc-GETCONFIG-command" href="#GETCONFIG">16 GETCONFIG command</a></li>
1893 <li><a name="toc-GETINFO-command" href="#GETINFO">17 GETINFO command</a></li>
1894 <li><a name="toc-HELP-command" href="#HELP">18 HELP command</a></li>
1895 <li><a name="toc-IMPORT-command" href="#IMPORT">19 IMPORT command</a></li>
1896 <li><a name="toc-ISCACHED-command" href="#ISCACHED">20 ISCACHED command</a></li>
1897 <li><a name="toc-KEYGRIP-command" href="#KEYGRIP">21 KEYGRIP command</a></li>
1898 <li><a name="toc-KILL-command" href="#KILL">22 KILL command</a></li>
1899 <li><a name="toc-LIST-command" href="#LIST">23 LIST command</a></li>
1900 <li><a name="toc-LOCK-command" href="#LOCK">24 LOCK command</a></li>
1901 <li><a name="toc-LS-command" href="#LS">25 LS command</a></li>
1902 <li><a name="toc-MOVE-command" href="#MOVE">26 MOVE command</a></li>
1903 <li><a name="toc-NOP-command" href="#NOP">27 NOP command</a></li>
1904 <li><a name="toc-OPEN-command" href="#OPEN">28 OPEN command</a></li>
1905 <li><a name="toc-OPTION-command" href="#OPTION">29 OPTION command</a></li>
1906 <li><a name="toc-PASSWD-command" href="#PASSWD">30 PASSWD command</a></li>
1907 <li><a name="toc-REALPATH-command" href="#REALPATH">31 REALPATH command</a></li>
1908 <li><a name="toc-RENAME-command" href="#RENAME">32 RENAME command</a></li>
1909 <li><a name="toc-RESET-command" href="#RESET">33 RESET command</a></li>
1910 <li><a name="toc-SAVE-command" href="#SAVE">34 SAVE command</a></li>
1911 <li><a name="toc-STORE-command" href="#STORE">35 STORE command</a></li>
1912 <li><a name="toc-UNLOCK-command" href="#UNLOCK">36 UNLOCK command</a></li>
1913 <li><a name="toc-XPATH-command" href="#XPATH">37 XPATH command</a></li>
1914 <li><a name="toc-XPATHATTR-command" href="#XPATHATTR">38 XPATHATTR command</a></li>
1915 <li><a name="toc-Status-messages-and-their-meanings" href="#Status-Messages">39 Status messages and their meanings</a></li>
1916 <li><a name="toc-The-target-attribute" href="#Target-Attribute">40 The <code>target</code> attribute</a></li>
1917 <li><a name="toc-Recognized-signals" href="#Signals">41 Recognized signals</a></li>
1918 <li><a name="toc-Concept-Index-1" href="#Concept-Index">Concept Index</a></li>
1920 </ul>
1921 </div>
1923 <hr>
1927 </body>
1928 </html>