Personal tools
You are here: Home Issue tracker Parsing zfsrc results in unable to start daemon

#64 — Parsing zfsrc results in unable to start daemon

State Resolved
Version: 0.6.9
Area User interface
Issue type Patch
Severity Medium
Submitted by Seth Heeren
Submitted on Jun 19, 2010
Responsible Seth Heeren
Target release: 0.6.9
Return to tracker
Last modified on Jun 19, 2010 by Seth Heeren
When the last line of zfsrc is not followed by a linefeed, parsing fails

The cause is that fgets is not checked for errors and feof() will not be set after reading the last (non-terminated) line.
This leads to reusing the previous linebuffer, leading to malformed options (----like this, instead of --like) or possibly (?) repeated options (which may sometimes not be repeatable).

This is probably causing issue #61 (but we have no proof because of lack of information there).
Steps to reproduce:
Use attached simple zfsrc on 0.6.9 'vanilla' and observe daemon failing to start
Attached:
zfsrc — Octet Stream, 0Kb
Added by Seth Heeren on Jun 19, 2010 01:57 PM
Issue state: unconfirmedresolved
Fixed on testing branch


commit a8eb43b505144454d09d39678d3b47271ded6e61
Author: Seth Heeren <sgheeren@hotmail.com>
Date: Sat Jun 19 20:46:35 2010 +0200

    fixed zfsrc parse error when no line-end on last line
    
    This caused repeated parsing of the last line, which fails for
    non-repeatable options (issue #64)