stratis-storage/dbus-signature-pyparsing

Parser fails to observe some maximum sizes

mulkieran opened this issue · 2 comments

It succeeds in parsing some dbus signatures which it should fail to parse because because some portion of the signature exceeds the maximum limits.

I think that the added complexity is not worth the trouble. Let's just document this fact; that it will parse some signatures that are invalid not because they are ill-formed but because they exceed some maximum, and move on.

Or we can do a post-check on the parsed value and raise an exception on ones that exceed the limits. The constraints on signatures are all specified, a bit unclearly, in the subheading "Valid Signatures". The first bullet point, we do observe. It's the remaining three that we don't. The problem is that the specification is vague. "The maximum length of a signature is 255." 255 whats? Characters, complete types? Depending on the units, the judgement is very different And because the original documentation didn't specify the units, the only way to find out is to ask, or to read the reference implementation and find out.

Since in order to document this, we'ld have to refer to existing D-Bus documentation that is deeply ambiguous and confusing, we'ld do more harm than good by documenting it, so currently no action is the best course.