summaryrefslogtreecommitdiff
path: root/common/execute.c
diff options
context:
space:
mode:
authorDamien Neil <source@isc.org>2000-12-02 00:04:22 +0000
committerDamien Neil <source@isc.org>2000-12-02 00:04:22 +0000
commit81beacfb83c4004329a504d1a6f091950f476580 (patch)
tree498263cf35e601fd3c1fdba290626a831ce8f77e /common/execute.c
parentcfb8d214088bbd7ad7951c1d85a8f51eb8aa03ef (diff)
downloadisc-dhcp-81beacfb83c4004329a504d1a6f091950f476580.tar.gz
Added a case to handle log statements in write_statements(), avoiding
server death when log statements appear in commit or expiry clauses.
Diffstat (limited to 'common/execute.c')
-rw-r--r--common/execute.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/common/execute.c b/common/execute.c
index 07fb0435..0991b7a9 100644
--- a/common/execute.c
+++ b/common/execute.c
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
-"$Id: execute.c,v 1.41 2000/11/28 22:50:38 mellon Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: execute.c,v 1.42 2000/12/02 00:04:22 neild Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -847,6 +847,40 @@ void write_statements (file, statements, indent)
col = token_print_indent (file, col, indent + 6,
" ", "", ";");
break;
+
+ case log_statement:
+ indent_spaces (file, indent);
+ fprintf (file, "log ");
+ col = token_print_indent (file, col, indent + 4,
+ "", "", "(");
+ switch (r -> data.log.priority) {
+ case log_priority_fatal:
+ col = token_print_indent
+ (file, col, indent + 4, "",
+ " ", "fatal,");
+ break;
+ case log_priority_error:
+ col = token_print_indent
+ (file, col, indent + 4, "",
+ " ", "error,");
+ break;
+ case log_priority_debug:
+ col = token_print_indent
+ (file, col, indent + 4, "",
+ " ", "debug,");
+ break;
+ case log_priority_info:
+ col = token_print_indent
+ (file, col, indent + 4, "",
+ " ", "info,");
+ break;
+ }
+ col = write_expression (file, r -> data.log.expr,
+ indent + 4, indent + 4, 0);
+ col = token_print_indent (file, col, indent + 4,
+ "", "", ");");
+
+ break;
default:
log_fatal ("bogus statement type %d\n", r -> op);