[Bug 306697] New: libzypp does not throw ParseException if it tries to parse an xml file of repo file
https://bugzilla.novell.com/show_bug.cgi?id=306697 Summary: libzypp does not throw ParseException if it tries to parse an xml file of repo file Product: openSUSE 10.3 Version: Beta 2 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: libzypp AssignedTo: dmacvicar@novell.com ReportedBy: jkupec@novell.com QAContact: kkaempf@novell.com CC: ma@novell.com Found By: --- Reproducable easily with zypper addrepo -r URL_to_xml_file. It should definitely throw in this case. But it should throw even if it is an ini file, but not a repo file (by checking mandatory intries, non-emptinness, etc.. perhaps). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=306697
Ján Kupec
https://bugzilla.novell.com/show_bug.cgi?id=306697
Arvin Schnell
https://bugzilla.novell.com/show_bug.cgi?id=306697#c2
--- Comment #2 from Arvin Schnell
https://bugzilla.novell.com/show_bug.cgi?id=306697#c3
--- Comment #3 from Arvin Schnell
https://bugzilla.novell.com/show_bug.cgi?id=306697#c4
Arvin Schnell
https://bugzilla.novell.com/show_bug.cgi?id=306697
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=306697#c5
Ján Kupec
I have discussed the issue with ma:
1) About parsing XML-files: We can make the INI-parser more strict by requiring: - Lines that are not empty, comments or sections must contain a "=". - No spaces in keys.
This is good!
2) The parser should only throw on real parsing errors but not on missing, empty or even invalid keys and values.
I agree for the IniParser, but why not RepoFileReader? It could throw an InvalidRepoFile exception for missing URL or mandatory key (like the 'baseurl'). Or even a NotARepoFile exception if there is something upon which we can decide that it is not. Uhm.. well, a minor problem could be that we support multiple repos per file, but still.. what do you think?
This would make it impossible to modify those repos with libzypp.
I don't see your point here.. Currently we do modifications to .repo files by completely rewriting them.
So the check for a missing URL should be done inside zypper.
Doing the validation in the libzypp user code asks for duplication of code. Zypper will validate, yast will validate, ... It makes no sense for the RepoFileReader to return invalid RepoInfos. Anyway.. we probably don't have to do a thorough validation, checking for non-empty alias and URL in zypper as you suggested is probably enough. I just want to check this idea with you a bit further. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=306697
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=306697#c6
--- Comment #6 from Ján Kupec
https://bugzilla.novell.com/show_bug.cgi?id=306697
User aschnell@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=306697#c7
Arvin Schnell
participants (1)
-
bugzilla_noreply@novell.com