<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Include of a file not robust to missing newline at EOF"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1189">1189</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Include of a file not robust to missing newline at EOF
</td>
</tr>
<tr>
<th>Product</th>
<td>nftables
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P5
</td>
</tr>
<tr>
<th>Component</th>
<td>nft
</td>
</tr>
<tr>
<th>Assignee</th>
<td>pablo@netfilter.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>netfilter@allycomm.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=509" name="attach_509" title="Files to reproduce missing-newline behavior; no subdirectory">attachment 509</a> <a href="attachment.cgi?id=509&action=edit" title="Files to reproduce missing-newline behavior; no subdirectory">[details]</a></span>
Files to reproduce missing-newline behavior; no subdirectory
If a file used by an "include" statement does not have a newline at its end, it
will cause a parse/lex issue that is reported elsewhere. While the trivial
example supplied that error is immediately after the inclusion, it can be more
difficult to trace down when multiple files are included in the same context.
To Reproduce
============
* In a suitable directory, extract the attached tar (flat files, no
subdirectory)
$ sudo nft -c -f nftables.conf
nftables.conf:17:5-9: Error: syntax error, unexpected chain
chain inside-nftables-after-no-newline {
^^^^^
Suggested resolutions
=====================
* At a minimum, warn if an included file does not have a terminal newline
* If there is not a valid use case for inclusion of a file without a terminal
newline, additionally fix the parser/lexer so that it does not error</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>