where cdb is the name of the cdb-format output file, and tmp is the name of a temporary file. ipcexec follows rules in cdb to decide whether to execute a program.
ipcexecrules reads rules from its standard input and writes them into cdb in a binary format suited for quick access by ipcexec.
ipcexecrules can be used while ipcexec is running. It ensures that cdb is updated atomically. It does this by first writing the rules to tmp and then moving tmp on top of cdb. If tmp already exists, it is destroyed. The directories containing cdb and tmp must be writable to ipcexecrules, and must also be on the same filesystem.
If there is a problem with the input or with tmp, ipcexecrules complains and leaves cdb alone.
A rule occupies one line. A file containing rules may also contain comments: lines beginning with # are ignored.
Each rule contains a pattern, a colon, and a list of instructions, with no extra spaces. When ipcexec receives a request, it follows the instructions of the first matching pattern in cdb.
ipcexec looks for rules with various patterns:
ipcexec uses the first matching rule it finds.
For example, here are some rules:
If USERID is 0 and cmd is echo:
You can use ipcexecrulescheck to see how ipcexec will interpret rules in cdb.
ipcexecrules treats
as an abbreviation for the rules
The instructions in a rule must begin with either allow or deny. An instruction beginning with deny tells ipcexec to exit without running any program. For example, the rule
tells ipcexec to ignore any request that is not handled by a more specific rule.
An instruction with allow tells ipcexec to execute the request. It executes cmd with arguments also read from file descriptor 0. Arguments are passed directly to pathexec without further interpretation. If the matching rule instruction begins with
then ipcexec executes path instead of cmd, with the arguments specified in the request. Any repeated character may appear in place of the quote character.
The instruction may continue with some environment variable assignments, in the form var="x". ipcexec adds an environment variable $var with value x. For example,
adds an environment variable $ACCESS with a value of special. Any repeated character may appear in place of the quote character:
and any number of variables assignments may appear in a single rule:
Copyright © 2009 by SuperScript Technology, Inc. All rights reserved.