[Kde-pim] Review Request 108974: Escape UIDs in resources that use them as filename

Kevin Krammer krammer at kde.org
Tue Feb 26 20:37:12 GMT 2013



> On Feb. 15, 2013, 3:01 p.m., Kevin Krammer wrote:
> > While this certainly fixes the problem of "bad" characters in UIDs, I am wondering if these resources shouldn't be using something like libmaildir's unique IDs.
> > Because even with this fix the resources will assume that the UIDs are sufficiently unique (which of course they should be but we all know that "should" isn't always sufficient).
> >
> 
> Dan Vrátil wrote:
>     This might work for the contacts resources, but not for the calendar resources. Changing event UID from resource crashes KOrganizer, because it uses event UID instead of Akonadi::Id to identify items, thus changing event UID in an Akonadi resource causes KOrganizer to assert, because it gets changed notification for an item with unknown UID.
>     
>     So we can go for your solution, but someone needs to fix KOrganizer first :P

I think we have a misunderstanding :)
I wasn't proposing to overwrite the UID of the payload, but using a different ID scheme for file names. Basically ignore that the payload contains an ID, treating contacts and events like data that doesn't have internal IDs (e.g. like mails).


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108974/#review27514
-----------------------------------------------------------


On Feb. 15, 2013, 2:39 p.m., Dan Vrátil wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108974/
> -----------------------------------------------------------
> 
> (Updated Feb. 15, 2013, 2:39 p.m.)
> 
> 
> Review request for KDEPIM.
> 
> 
> Description
> -------
> 
> Contacts, vcarddir, icaldir and dav resources use KABC::Addressee::uid() or KCalCore::Incidence::uid() as part of the destination filenames. This fails if the UID contains unsafe characters like path delimiter, colon etc.
> 
> This patch uses QUrl::toPercentEncoding() to make sure the UID is safe to use.
> 
> 
> Diffs
> -----
> 
>   resources/contacts/contactsresource.cpp 499f56e 
>   resources/dav/common/davutils.cpp 6b829e2 
>   resources/icaldir/icaldirresource.cpp d653220 
>   resources/vcarddir/vcarddirresource.cpp e5d5ded 
> 
> Diff: http://git.reviewboard.kde.org/r/108974/diff/
> 
> 
> Testing
> -------
> 
> Successfully copied a contact from akonadi_googlecontacts_resource (which uses full http:// URL as UID) to akonadi_contacts_resource (which uses ~/.local/contacts/%contactUID%.vcard as filename).
> 
> 
> Thanks,
> 
> Dan Vrátil
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list