After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 663177 - tpf-persona.vala:792: Failed to parse new birthday string 'Sat 01 Jan 2011'
tpf-persona.vala:792: Failed to parse new birthday string 'Sat 01 Jan 2011'
Status: RESOLVED DUPLICATE of bug 675155
Product: folks
Classification: Platform
Component: Telepathy backend
git master
Other OpenBSD
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2011-11-01 16:03 UTC by Jasper Lievisse Adriaanse
Modified: 2012-04-30 13:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jasper Lievisse Adriaanse 2011-11-01 16:03:06 UTC
Upon viewing a contact with Empathy, the following message is printed to the console:
tpf-persona.vala:792: Failed to parse new birthday string 'Sat 01 Jan 2011'

Any idea what's going wrong?
Comment 1 Philip Withnall 2011-11-01 21:48:38 UTC
Looks like Telepathy's passing an invalid BDAY vCard field to libfolks. BDAY is defined as ISO 8601 in the vCard specification and XEP 0054, so Telepathy is incorrect here.

What protocol was the contact on? (i.e. Which Telepathy connection manager was providing the contact information?)
Comment 2 Danielle Madeley 2011-11-01 22:17:53 UTC
Assuming this comes from Gabble (XMPP), I suspect it's just being passed through from a bad vCard provided by the server. Gabble simply copies the data from the vCard it's provided with without doing any parsing.

A debug log, with XMPP stanzas would show what we're getting from the server (search for BDAY).

I don't think it's wrong for Tp to pass the data it's given, even if that data would seem to be nonsense, if the data claims to be spec compliant. Someone has to parse it and generate a warning that it's nonsense, and I think it should be the last thing in the chain.
Comment 3 Philip Withnall 2011-11-03 09:06:20 UTC
(In reply to comment #2)
> I don't think it's wrong for Tp to pass the data it's given, even if that data
> would seem to be nonsense, if the data claims to be spec compliant. Someone has
> to parse it and generate a warning that it's nonsense, and I think it should be
> the last thing in the chain.

I disagree. Given that there are lots of applications which use Telepathy (and which should theoretically be doing interesting things with vCard data), I think that making them all implement date parsing code is a bad idea. Quite apart from the security implications of passing them unvalidated data off the network, the code duplication (and potential duplication of translation efforts for the warning strings) would be rather pointless.

If the code doesn't land in Gabble, I think it should at least go in tp-glib so that we end up with a single, secure implementation.
Comment 4 Danielle Madeley 2011-11-03 11:54:51 UTC
Gabble is not going to parse this date correctly, we can't just attempt to parse arbitrary dates, anything not in ISO 8601 is just bad data.

GLib already has code to read ISO 8601 dates (and I've asked for #662060 for GDateTime specific support). Security concerns should be referred here IMO.

It's worth noting that Telepathy CMs do not contain translated strings, nor is there capability to return such an in the vCard. telepathy-glib also does not contain translated strings. If anything, this would be better in a library like Folks, which lots of clients will use.
Comment 5 Philip Withnall 2011-11-07 09:13:59 UTC
(In reply to comment #4)
> Gabble is not going to parse this date correctly, we can't just attempt to
> parse arbitrary dates, anything not in ISO 8601 is just bad data.
> 
> GLib already has code to read ISO 8601 dates (and I've asked for #662060 for
> GDateTime specific support). Security concerns should be referred here IMO.

Right.

> It's worth noting that Telepathy CMs do not contain translated strings, nor is
> there capability to return such an in the vCard. telepathy-glib also does not
> contain translated strings. If anything, this would be better in a library like
> Folks, which lots of clients will use.

I guess it would be fine for a warning string to not be translated, since it's only ever going to end up in .xsession-errors. I still think this warning should go in tp-glib rather than folks.
Comment 6 Philip Withnall 2012-04-30 13:33:48 UTC
So, Guillaume went ahead and changed the warning() to a debug() in folks anyway in bug #675155, thus ending the discussion. I still think tp-glib shouldn’t be passing on invalid vCard data, though.

*** This bug has been marked as a duplicate of bug 675155 ***
Comment 7 Guillaume Desmottes 2012-04-30 13:40:52 UTC
(In reply to comment #6)
> So, Guillaume went ahead and changed the warning() to a debug() in folks anyway
> in bug #675155, thus ending the discussion. I still think tp-glib shouldn’t be
> passing on invalid vCard data, though.

I opened https://bugs.freedesktop.org/show_bug.cgi?id=49300 summarising my position about this.