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

testutil/pkgdata: Handle empty names in MakeDeb() #85

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

woky
Copy link
Contributor

@woky woky commented Jun 21, 2023

MakeDeb() now expects that all provided tar entries have a non-empty
name. Otherwise it panics on array out of bounds access. Fix it.

We can create tarballs containing entries with empty name just fine. It
makes GNU tar fail when extracting, but it fails gracefully with

tar: Substituting `.' for empty member name
-rw-r--r-- root/root 0 1970-01-01 01:00
tar: .: Cannot open: File exists
tar: Exiting with failure status due to previous errors

@woky woky added the Priority Look at me first label Jun 21, 2023
@cjdcordeiro cjdcordeiro removed the Priority Look at me first label Jun 22, 2023
MakeDeb() now expects that all provided tar entries have a non-empty
name. Otherwise it panics on array out of bounds access. Fix it.

We can create tarballs containing entries with empty name just fine. It
makes GNU tar fail when extracting, but it fails gracefully with

  tar: Substituting `.' for empty member name
  -rw-r--r-- root/root         0 1970-01-01 01:00
  tar: .: Cannot open: File exists
  tar: Exiting with failure status due to previous errors
@woky woky force-pushed the pub/testutil-pkgdata-empty-names branch from 4c652ba to 990f689 Compare June 22, 2023 10:38
@woky woky changed the title testutil: Handle empty names in MakeDeb() testutil/pkgdata: Handle empty names in MakeDeb() Jun 22, 2023
@cjdcordeiro cjdcordeiro added the Simple Nice for a quick look on a minute or two label Aug 28, 2023
}, {
testutil.TarEntry{
Header: tar.Header{
Name: "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That feels like a strange case that makes me tempted to just complain about. That said, this is a test package, so I can imagine it being used precisely for testing, so sounds okay I guess.

@niemeyer niemeyer merged commit a6e7c43 into canonical:main Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple Nice for a quick look on a minute or two
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants