Fix limits on reading user policy files.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 23 Jun 2013 22:24:17 +0000 (23:24 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 23 Jun 2013 22:24:17 +0000 (23:24 +0100)
commitb9eb1a366ff0127c49a0589905435680b137d49f
treec9bdadac0cbc04e76fe62424aac9e836e60016b2
parentd990d346ab639ccb14d26014f07e3983bb22daed
Fix limits on reading user policy files.

The old code only checked the line code after a successful policy line.
A policy file consisting only of blank lines, comments, and erroneous
lines could cause the daemon to loop forever.

Modify `read_policy_file' to return `T_*' codes (like the comment says
it should!), and handle the various codes in the caller.  Most
particularly, `client_line' gives up after the first error to avoid
spamming the log.  Getting this to work properly involves applying a
different ordering to the `T_*' codes.
policy.c
yaid.c
yaid.h