Bug 28815 - provides/conflicts/requires/obsoletes not parsed properly when they contain square brackets
Summary: provides/conflicts/requires/obsoletes not parsed properly when they contain s...
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-20 21:30 CEST by Pascal Terjan
Modified: 2021-04-22 15:03 CEST (History)
0 users

See Also:
Source RPM: perl-URPM
CVE:
Status comment:


Attachments
Patch adding a test reproducing the problem (1.25 KB, patch)
2021-04-20 21:32 CEST, Pascal Terjan
Details | Diff
Patch adding the test and a fix making it pass (6.24 KB, patch)
2021-04-22 15:03 CEST, Pascal Terjan
Details | Diff

Description Pascal Terjan 2021-04-20 21:30:14 CEST
For example "python3dist(fonttools[ufo])[== 4.18.2]" gets parsed as "python3dist(fonttools" being the name of it.
Comment 1 Pascal Terjan 2021-04-20 21:32:02 CEST
Created attachment 12658 [details]
Patch adding a test reproducing the problem

Reading the source, it should not happen when the header is present.

A test using synthesis reproduced the problem, attaching it.
Comment 2 Pascal Terjan 2021-04-20 21:40:07 CEST
The assumption that [] can not be in the name part is at several places unfortunately.

Pkg_obsoletes_overlap
Urpm_ranges_overlap
callback_list_str_overlap
return_list_str
update_provides
update_obsoletes
Comment 3 Jani Välimaa 2021-04-21 16:20:15 CEST
Assigning to perl-URPM maintainer.

Assignee: bugsquad => thierry.vignaud

Comment 4 Pascal Terjan 2021-04-21 16:30:23 CEST
I started looking into it yesterday, I wanted to create a new parsing function but it was less easy than expected as the code currently modifies original string to add '\0' and use parts of it and then restores the string so I think a separate function would need to allocate new strings and they would need to be released afterwards.
Comment 5 Pascal Terjan 2021-04-21 16:31:00 CEST
Alternatively it could give a struct name, namelen or end of name, etc
Comment 6 Pascal Terjan 2021-04-22 15:03:22 CEST
Created attachment 12663 [details]
Patch adding the test and a fix making it pass

Here is what I wrote last night, it makes the test pass but should be cleaned up.

Attachment 12658 is obsolete: 0 => 1


Note You need to log in before you can comment on or make changes to this bug.