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

Handle zero-length files with no read permission #108

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

peterwaller-arm
Copy link
Contributor

@peterwaller-arm peterwaller-arm commented Jan 28, 2023

These files appear for example in clang's test suite, for testing the behaviour of tooling when it tries to read files it lacks the permission for. So this is a step towards being able to store more directories without manual intervention.

Closes #14.

TODO

  • Tests
  • Haven't actually tried non-loose extract yet which isn't yet implemented and won't work right.

@peterwaller-arm peterwaller-arm force-pushed the zero-length-files branch 4 times, most recently from 98a76e9 to a1a52dd Compare January 28, 2023 21:01
@peterwaller-arm peterwaller-arm self-assigned this Jan 28, 2023
@peterwaller-arm
Copy link
Contributor Author

I consider this ready for review and testing but please leave the merging to me, I want to test it a bit more first.

This is a nop change to introduce a parameter which enables us to
control the permissions of the created file.

Since it defaults to the old behaviour, no functional changes are
intended (NFC).
Soon introducing file metadata as distinct from object metadata.

Object metadata: That which relates to the object as it appears in the
pack.

File metadata: That which relates to the path, such as file modes.
This adds a FileMetadata as a part of the FileHandle.

This does make me question if FileHandle is now appropriately named, but
logically, the file metadata is a part of the file state which should
be considered changed along with the other properties of the FileHandle,
so this seems like the correct place to put this information for now.
Prior to this commit, modes did nothing since they were not populated.
After this commit, they are populated in the index, and that information
is used to specify modes on the created files.

Closes #13.
It appears to be optional on an old Ubuntu installation, but in more
recent versions of nc, -p is rejected with -l.
These files appear for example in clang's test suite, for testing the
behaviour of tooling when it tries to read files it lacks the permission
for. So this is a step towards being able to store more directories
without manual intervention.

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

Successfully merging this pull request may close these issues.

None yet

1 participant