diff -urN dhcp-3.0.2.orig/common/conflex.c dhcp-3.0.2/common/conflex.c
--- dhcp-3.0.2.orig/common/conflex.c 2004-11-24 10:39:15.000000000 -0700
+++ dhcp-3.0.2/common/conflex.c 2005-02-24 12:32:12.000000000 -0700
if (!strcasecmp (atom + 1, "ncapsulate"))
+ if (!strcasecmp (atom + 1, "xecute"))
if (!strcasecmp (atom + 1, "atal"))
diff -urN dhcp-3.0.2.orig/common/dhcp-eval.5 dhcp-3.0.2/common/dhcp-eval.5
--- dhcp-3.0.2.orig/common/dhcp-eval.5 2005-01-19 13:00:52.000000000 -0700
+++ dhcp-3.0.2/common/dhcp-eval.5 2005-02-24 12:32:12.000000000 -0700
Rebind - DHCP client is in the REBINDING state - it has an IP address,
and is trying to contact any server to renew it. The next message to
be sent will be a DHCPREQUEST, which will be broadcast.
+.B execute (\fIcommand-path\fB, \fIdata-expr1\fB ... \fIdata-exprN\fB)\fR
+External command execution is possibly through execute expressions. Execute
+takes a variable number of arguments, where the first is the command
+name (full path or only the name of the executable) and following zero
+or more are data-expressions which values will be passed as external
+arguments. It returns the return code of the external command.
+Execute is synchronous, and the program will block until the external
+command being run has finished. Please note that lengthy program
+execution (for example, in an "on commit" in the dhcpd) may result in
+bad performance and timed out clients. Try keeping the execution times
+Passing user-supplied data might be dangerous. Check input buffers
+and make sure the external command handles all kinds of "unusual"
+characters (shell special characters in sh-scripts etc) correctly.
+It is possible to use the execute expression in any context, not only
+on events. If you put it in a regular scope in the configuration file
+you will execute that command every time a scope is evaluated.
+The execute expression is only available if you have defined ENABLE_EXECUTE
+in site.h before compilation.
Logging statements may be used to send information to the standard logging
channels. A logging statement includes an optional priority (\fBfatal\fR,
diff -urN dhcp-3.0.2.orig/common/parse.c dhcp-3.0.2/common/parse.c
--- dhcp-3.0.2.orig/common/parse.c 2004-09-30 14:38:31.000000000 -0600
+++ dhcp-3.0.2/common/parse.c 2005-02-24 12:32:12.000000000 -0700
+ token = next_token (&val, (unsigned *)0, cfile);
+ if (!expression_allocate (expr, MDL))
+ log_fatal ("can't allocate expression.");
+ token = next_token (&val, (unsigned *)0, cfile);
+ parse_warn (cfile, "left parenthesis expected.");
+ token = next_token (&val, (unsigned *)0, cfile);
+ (*expr) -> data.funcall.name =
+ dmalloc (strlen (val) + 1, MDL);
+ if (!(*expr)->data.funcall.name)
+ log_fatal ("can't allocate command name");
+ strcpy ((*expr) -> data.funcall.name, val);
+ token = next_token (&val, (unsigned *)0, cfile);
+ ep = &((*expr) -> data.funcall.arglist);
+ while (token == COMMA) {
+ if (!expression_allocate (ep, MDL))
+ log_fatal ("can't allocate expression");
+ if (!parse_data_expression (&(*ep) -> data.arg.val,
+ ep = &((*ep) -> data.arg.next);
+ token = next_token (&val, (unsigned *)0, cfile);
+ (*expr) -> op = expr_execute;