Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 196681 - GLSA dtd: date format does not match comment
Summary: GLSA dtd: date format does not match comment
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: GLSA Errors (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Security
URL:
Whiteboard:
Keywords:
Depends on: 218312 627350
Blocks: 141909
  Show dependency tree
 
Reported: 2007-10-22 00:00 UTC by Robert Buchholz (RETIRED)
Modified: 2018-01-14 23:46 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Buchholz (RETIRED) gentoo-dev 2007-10-22 00:00:58 UTC
Starting somewhere in 2003 or 2004, the dates in GLSAs differ from the format asserted in the glsa.dtd: http://www.gentoo.org/dtd/glsa.dtd

Example:
  <announced>October 20, 2007</announced>
  <revised>October 20, 2007: 01</revised>

DTD excerpt:

<!--
    Element:      announced
    Description:  Date when the advisory is publicised
                  The format must be "YYYY-mm-dd"

    Example: <announced>2003-11-20</announced>
-->
<!ELEMENT announced (#PCDATA)>

<!--
    Element:      revised
    Description:  Last revision date of the GLSA
    
    Example: <revised>2003-11-20</revised>
-->
<!ELEMENT revised (#PCDATA)>


Either all GLSAs since 2003 should be corrected, or the comment in the DTD be changed.
Comment 1 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-10-22 07:06:51 UTC
I guess the format changed with the introduction of GLSAmaker.
Comment 2 Pierre-Yves Rofes (RETIRED) gentoo-dev 2007-11-11 14:37:34 UTC
Xavier, please advise.
Comment 3 Xavier Neys (RETIRED) gentoo-dev 2007-11-13 13:54:54 UTC
A DTD cannot force any date to use the yyyy-mm-dd format.
Since the yyyy-mm-dd can be validated and formatted by our XSL and is the format we use, I'd favour it over the current format, but it means glsamaker needs to be changed.
I can convert dates in all GLSAs if you want me to.
Last but not least, it would make it easier to fix bug #141909 as the date would not have to be decoded and reformatted for the feed.

FYI, current XSL formats yyyy-mm-dd and leaves anything else as-is.
Old one with YYYY-MM-DD in announced and revised tags:
http://gentoo.org/security/en/glsa/glsa-200312-08.xml
Pre-formatted by glsamaker:
http://gentoo.org/security/en/glsa/glsa-200711-16.xml
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-03 17:36:20 UTC
I've just hit this again while attempting to write XML Schema for GLSAs. Long story short, this is a terrible mess and I can't understand how the hell things like this happen in Gentoo.

In any case, please either update the spec to match the crap you committed, or fix the crap you committed to match the spec.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-01-06 10:41:11 UTC
A little update based on what me and b-man have established.

We have two formats for announced and three formats for revised:

1. ISO8601 [with count="" attr for <revised/>] -- not used at all,

2. ISO8601 [followed by :N for <revised/>] -- used by few old GLSAs,

3. textual date [followed by :N for <revised/>] -- used by GLSAMaker.

The third format is most deployed at the moment but it sucks in terms of machine-readability.

FWICS, the GLSA code in Portage (used by glsa-check) supports all three formats. pkgcore doesn't seem to care about dates at all. GLSA feed on website doesn't use dates either.

So I think it'd be reasonable to go back to the 1st format which is most machine-friendly. This would involve:

1. fixing GLSAMaker to use it,

2. batch-fixing all existing GLEPs to use it.
Comment 6 Aaron Bauman (RETIRED) gentoo-dev 2017-01-15 10:40:23 UTC
(In reply to Michał Górny from comment #5)
> A little update based on what me and b-man have established.
> 
> We have two formats for announced and three formats for revised:
> 
> 1. ISO8601 [with count="" attr for <revised/>] -- not used at all,
> 
> 2. ISO8601 [followed by :N for <revised/>] -- used by few old GLSAs,
> 
> 3. textual date [followed by :N for <revised/>] -- used by GLSAMaker.
> 
> The third format is most deployed at the moment but it sucks in terms of
> machine-readability.
> 
> FWICS, the GLSA code in Portage (used by glsa-check) supports all three
> formats. pkgcore doesn't seem to care about dates at all. GLSA feed on
> website doesn't use dates either.
> 
> So I think it'd be reasonable to go back to the 1st format which is most
> machine-friendly. This would involve:
> 
> 1. fixing GLSAMaker to use it,
> 
> 2. batch-fixing all existing GLEPs to use it.

All dates have been switched in GLSAMaker to use ISO8601 per Alex's commits.

https://gitweb.gentoo.org/proj/glsamaker.git/commit/?id=e3b81e36e6577ee550a046f573002950bc26bea5

https://gitweb.gentoo.org/proj/glsamaker.git/commit/?id=0967557d18629ab6593dd2ef580e4e49c43d8c66

The count="" attr is broken it seems somewhere within glsa-check, but GLSAMaker is outputting the GLSA's with this attr already.  This requires a manual fix before pushing to the repo.  I am testing more to try and find the resolution.

I have a script ready for the repo that has been tested and converts all old standard dates to the new format.  Once everything is fixed we can migrate the repo.
Comment 7 Thomas Deutschmann (RETIRED) gentoo-dev 2017-09-28 21:02:03 UTC
Dates converted via https://gitweb.gentoo.org/data/glsa.git/commit/?id=612f47deca97e8d7ffc2100c1dbc82a602abdf39

Conversion to count attribute usage will follow once >=app-portage/gentoolkit-0.4.0 has been stabilized.
Comment 8 Thomas Deutschmann (RETIRED) gentoo-dev 2018-01-14 23:46:55 UTC
Revision converted into "count" attribute via https://gitweb.gentoo.org/data/glsa.git/commit/?id=f62be9710b7244af8dc15887df52ae442c460d45

All done.