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

RFE: Disallow duplicate tags in headers #1905

Open
DemiMarie opened this issue Jan 28, 2022 · 2 comments
Open

RFE: Disallow duplicate tags in headers #1905

DemiMarie opened this issue Jan 28, 2022 · 2 comments
Labels
fileformat Matters concerning package (file) format RFE

Comments

@DemiMarie
Copy link
Contributor

If I understand RPM’s source code correctly, it is possible for the same header tag to appear more than once in a package. This makes little sense and should not be allowed. I propose that RPM reject packages where the same tag appears more than once in the same header.

One way to achieve this is to do the following when loading a package from a file, as opposed to a header from the RPMDB:

  • For each entry in the dribble, call findEntry() on the immutable region, and return an error if it finds something.
  • After sorting the entries in the immutable region, check if there are two consecutive entries with the same tag. If so, error out.
@pmatilai
Copy link
Member

Yeah it's always been permitted, and it does seem bizarre, maybe there once was some use-cases depending on the behavior.

@DemiMarie
Copy link
Contributor Author

Is rejecting all dribbles in packages + requiring all headers in packages to be sorted an option? That would make checking for duplicates trivial, by requiring that each entry have a strictly greater tag than the one preceding it.

@pmatilai pmatilai changed the title Disallow duplicate entries in packages Disallow duplicate tags in headers Feb 22, 2022
@pmatilai pmatilai added RFE fileformat Matters concerning package (file) format labels Apr 14, 2022
@pmatilai pmatilai changed the title Disallow duplicate tags in headers RFE: Disallow duplicate tags in headers Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fileformat Matters concerning package (file) format RFE
Projects
No open projects
RPM v6 format
  
Awaiting triage
Development

No branches or pull requests

2 participants