Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple text files interpreted as mtree #507

Open
kwrobot opened this issue Apr 11, 2015 · 2 comments
Open

Simple text files interpreted as mtree #507

kwrobot opened this issue Apr 11, 2015 · 2 comments

Comments

@kwrobot
Copy link

kwrobot commented Apr 11, 2015

Original issue 399 created by Google Code user JanWielemaker on 2015-02-04T15:02:30.000Z:

<b>What steps will reproduce the problem?</b>
1. Create a file with content this content (a single line without quotes):
  &quot;b704c67b39978aff8cc254e78976f001ea07a6d0&quot;
2. Open the archive using format all|raw
3. Run archive_read_next_header() on ther archive

<b>What is the expected output? What do you see instead?</b>

Expected:
Get the plain entry, reported as &quot;data&quot;, format &quot;raw&quot;

Instead:
ERROR: Missing type keyword in mtree specification

<b>What version are you using?</b>

3.1.2

<b>On what operating system?</b>

Ubuntu

<b>How did you build?  (cmake, configure, or pre-packaged binary)</b>

pre-packaged

<b>What compiler or development environment (please include version)?</b>


<b>Please provide any additional information below.</b>

According to mtree(5), mtree files must start with
&quot;#mtree&quot;.  How can it be that the file is misinterpreted?

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #1 originally posted by kientzle on 2015-02-05T05:00:49.000Z:

mtree(5) is wrong.  There is no required header text.

That said, it should be possible to improve the mtree bidder to reject files that are obviously missing required text.

Mixing raw + mtree is a particularly risky combination, since it is very hard to distinguish mtree from plain text files.   I generally recommend that people not mix raw with any other format handler except 'empty.'

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #2 originally posted by kientzle on 2015-02-22T20:16:14.000Z:

I've started to put together a test that tries to verify that the mtree bidder is doing the right thing.

Please take a look at the attached file and see if these cases all make sense.  If you can think of other cases that would help us to fine-tune the mtree bid logic, please let us know.

Note:  The current code gets most of these right, but not all.

See attachment: test_read_format_mtree_bid.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant