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

cr_xml_dump_int() should point to a forbidden character #424

Open
ppisar opened this issue Mar 1, 2024 · 2 comments
Open

cr_xml_dump_int() should point to a forbidden character #424

ppisar opened this issue Mar 1, 2024 · 2 comments
Labels
Priority: LOW Triaged Someone on the DNF team has read the issue and determined the next steps to take

Comments

@ppisar
Copy link
Contributor

ppisar commented Mar 1, 2024

struct cr_XmlStruct cr_xml_dump_int(cr_Package *pkg, gboolean filelists_ext, GError **err) correctly rejects a package whose metadata cannot be represented in XML:

    if (cr_Package_contains_forbidden_control_chars(pkg)) {
        g_set_error(err, CREATEREPO_C_ERROR, CRE_XMLDATA,
                    "Forbidden control chars found (ASCII values <32 except 9, 10 and 13).");
        return result;
    }

But the callers would like to know where the forbidden character is. Requested in #165 (comment).

Because cr_Package_contains_forbidden_control_chars() and lower functions are in public createrepo_c/xml_dump.h header file and they miss an argument for returning the precise location, a fix will need to add new functions (and wrap the current ones) not to break ABI.

@ppisar ppisar added Triaged Someone on the DNF team has read the issue and determined the next steps to take Priority: LOW labels Mar 1, 2024
sergiomb2 added a commit to sergiomb2/createrepo_c that referenced this issue Mar 2, 2024
@sergiomb2
Copy link
Contributor

reference fedora-copr/copr#3163

sergiomb2 added a commit to sergiomb2/createrepo_c that referenced this issue Mar 4, 2024
ppisar pushed a commit that referenced this issue Mar 4, 2024
@ppisar
Copy link
Contributor Author

ppisar commented Mar 4, 2024

PR #425 added printing warning messages which pinpoints a package name, RPM tag name and RPM tag value.

This issue is kept open to:

  • Report exact byte offset in the tag values (it's difficult to locate the offending nonprintablecharacters in the output).
  • Store the warnings into an error buffer and let the caller to print it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: LOW Triaged Someone on the DNF team has read the issue and determined the next steps to take
Projects
Status: Backlog
Development

No branches or pull requests

2 participants