<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 - cat foo.nft | nft -f - produces syntax error not seen with nft -f foo.nft"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1354">1354</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>cat foo.nft | nft -f - produces syntax error not seen with nft -f foo.nft
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>nftables
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86_64
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Debian GNU/Linux
          </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>jonas@zombofant.net
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=565" name="attach_565" title="File reproducing the issue">attachment 565</a> <a href="attachment.cgi?id=565&action=edit" title="File reproducing the issue">[details]</a></span>
File reproducing the issue

root is not needed to reproduce this.

How to reproduce:

1. Download the attached file
2. Execute cat foo.nft | nft -f -
3. Execute nft -f foo.nft

I expect both commands to behave exactly the same, given that the inputs are
exactly the same (just delivered through a different mechanism).

However, cat foo.nft | nft -f - produces an error message:

/dev/stdin:819:5-10: Error: syntax error, unexpected string

nft -f foo.nft works.

I dug further into this with other examples, and it looks to me as if -f - eats
single bytes from the input before they reach the parser. I don't have an
example at hand which reproduces this though.

(The example file is obviously contrived to reproduce the bug.)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>