summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relayd.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2008-09-29 15:06:53 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2008-09-29 15:06:53 +0000
commit0e98fbc399284e7fef87b160f2842b0c3106e843 (patch)
treeb3adf6949632f774da3d3980b7c321f701cca729 /usr.sbin/relayd/relayd.c
parent275880f8c7f7e257d10fa902d82eb70a954af888 (diff)
Change parsing of comments in external rule files. The hash mark may
appear in URLs (eg. /index.html#anchor), so only allow full-line comments indicated by a hash mark # at the beginning of a line.
Diffstat (limited to 'usr.sbin/relayd/relayd.c')
-rw-r--r--usr.sbin/relayd/relayd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index 1e559e71f06..5c49ac8e933 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.81 2008/09/29 14:53:35 reyk Exp $ */
+/* $OpenBSD: relayd.c,v 1.82 2008/09/29 15:06:52 reyk Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -1187,9 +1187,9 @@ protonode_load(enum direction dir, struct protocol *proto,
return (-1);
while (fgets(buf, sizeof(buf), fp) != NULL) {
- /* strip comment, whitespace, and newline characters */
- buf[strcspn(buf, "\r\n\t #")] = '\0';
- if (!strlen(buf))
+ /* strip whitespace and newline characters */
+ buf[strcspn(buf, "\r\n\t ")] = '\0';
+ if (!strlen(buf) || buf[0] == '#')
continue;
pn.key = strdup(buf);
if (node->value != NULL)