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

Zimbra address book with space in name confuses urlquoting #87

Closed
davidfraser opened this Issue Jul 6, 2014 · 8 comments

Comments

Projects
None yet
3 participants
@davidfraser

davidfraser commented Jul 6, 2014

I have several address books with spaces in their names. If I configure them in the categories list with a space:

categories = Contacts,Emailed Contacts

then the _normalize_href function assertion x.startswith(self.session.url) fails, because href and x (the result of urljoin(session.url, href)) contain the quoted version of the category (Emailed%20Contacts), but session.url contain the unquoted version.
If I rather configure the categories list with a urlquoted-name:

categories = Contacts,Emailed%20Contacts

then the assertion still dies, because href and x now end up containing the unquoted version of the category...

@davidfraser

This comment has been minimized.

davidfraser commented Jul 6, 2014

Workarounds in zimbra-error-logging that change the asserts to a warning - obviously this assert is meant to catch a security violation so a better solution is needed

@davidfraser

This comment has been minimized.

davidfraser commented Jul 6, 2014

In addition, if the server is queried with a URL with a space in, it gives an HTTP error:

java.lang.IllegalArgumentException: Illegal character in path at index 28: /dav/acnt@server.com/Emailed Contacts/e5d2662d-ea83-4bc0-80f5-8ed6a482c359:24778.vcf
    at java.net.URI.create(URI.java:859)
@untitaker

This comment has been minimized.

Member

untitaker commented Jul 6, 2014

Please try out the spaces branch.

@untitaker

This comment has been minimized.

Member

untitaker commented Jul 14, 2014

Any updates on this?

@DmitrySandalov

This comment has been minimized.

DmitrySandalov commented Aug 4, 2014

Got the same exception on calendar sync:

Unhandled exception occured while syncing bob_calendar.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/vdirsyncer/cli.py", line 333, in sync_collection
force_delete=status_name in force_delete
File "/usr/local/lib/python2.7/dist-packages/vdirsyncer/sync.py", line 129, in sync
list_b = prepare_list(storage_b, b_href_to_status)
File "/usr/local/lib/python2.7/dist-packages/vdirsyncer/sync.py", line 76, in prepare_list
prefetch(storage, rv, download)
File "/usr/local/lib/python2.7/dist-packages/vdirsyncer/sync.py", line 86, in prefetch
for href, item, etag in storage.get_multi(hrefs):
File "/usr/local/lib/python2.7/dist-packages/vdirsyncer/storage/dav.py", line 312, in get_multi
hrefs = [self._normalize_href(href) for href in hrefs]
File "/usr/local/lib/python2.7/dist-packages/vdirsyncer/storage/dav.py", line 297, in _normalize_href
assert x.startswith(self.session.url)
AssertionError

config+launch in debug mode:
https://gist.github.com/DmitrySandalov/0c4bad0ce6ec7d1ea257

@untitaker untitaker closed this in 59dd78d Aug 4, 2014

@untitaker

This comment has been minimized.

Member

untitaker commented Aug 4, 2014

Fixed in version 0.2.2.

@davidfraser

This comment has been minimized.

davidfraser commented Oct 2, 2014

Sorry for slow reply; latest versions definitely work correctly - thanks!

----- Original Message -----

From: "Markus Unterwaditzer" notifications@github.com
To: "untitaker/vdirsyncer" vdirsyncer@noreply.github.com
Cc: "David Fraser" davidf@sjsoft.com
Sent: Monday, 14 July, 2014 5:03:48 PM
Subject: Re: [vdirsyncer] Zimbra address book with space in name confuses urlquoting (#87)

Any updates on this?

Reply to this email directly or view it on GitHub .

David Fraser
Technical Advisor
j5 International (Pty) Ltd

@untitaker

This comment has been minimized.

Member

untitaker commented Oct 2, 2014

Glad to hear that it works, and you're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment