Ensure GetFolderEncryptStatusJob gets all the folders

We ensure the PROPFIND Depth is infinity by explicitly specifying the
header (turns out our implementation just doesn't assume infinity
otherwise). This way we have a clear picture about *all* the folders of
the user, otherwise ClientSideEncryption couldn't be a trustable oracle
on the encryption state for any folder not on the root and all the
encryption code assumes it has a full picture of encryption.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
Kevin Ottens 2020-06-18 13:34:47 +02:00
parent f93fdafa80
commit 3db267a03b

View file

@ -35,6 +35,7 @@ void GetFolderEncryptStatusJob::start()
req.setPriority(QNetworkRequest::HighPriority); req.setPriority(QNetworkRequest::HighPriority);
req.setRawHeader("OCS-APIREQUEST", "true"); req.setRawHeader("OCS-APIREQUEST", "true");
req.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/xml")); req.setHeader(QNetworkRequest::ContentTypeHeader, QByteArrayLiteral("application/xml"));
req.setRawHeader("Depth", "infinity");
QByteArray xml = R"(<d:propfind xmlns:d="DAV:"> <d:prop xmlns:nc="http://nextcloud.org/ns"> <nc:is-encrypted/> </d:prop> </d:propfind>)"; QByteArray xml = R"(<d:propfind xmlns:d="DAV:"> <d:prop xmlns:nc="http://nextcloud.org/ns"> <nc:is-encrypted/> </d:prop> </d:propfind>)";
auto *buf = new QBuffer(this); auto *buf = new QBuffer(this);