Properly handle denormalized href
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 18 May 2020 17:22:41 +0000 (19:22 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 18 May 2020 17:33:34 +0000 (19:33 +0200)
commit4d1ff01654027286d383c1f80e2372ca19e09478
tree21ac5812de19614a2c075f9a526ae33301b9bc36
parent8f1b10ea704d58f8ec12ecf6f93068743fa5bea8
Properly handle denormalized href

In case of denormalized paths in the dav href (presence of . or .. in
the path) simple string startsWith comparison wasn't enough to know if
said href ended up in the right namespace. That's why we're now using
QUrl (pretending local file since we don't have a full URL in the href)
to normalize the path before comparison.

This could happen with broken proxies for instance where we would
wrongly validate the dav information resulting in potentially surprising
syncing and name collisions.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/libsync/networkjobs.cpp
test/testxmlparse.cpp