Skip to content

Commit

Permalink
Merge pull request #3187 from nextcloud/bugfix/fixCfRegisterSyncRoot
Browse files Browse the repository at this point in the history
fix errors when calling CfRegisterSyncRoot by setting more fields
  • Loading branch information
mgallien authored Apr 26, 2021
2 parents 5404c8c + 97d785f commit 74b5ca3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libsync/vfs/cfapi/cfapiwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <QFileInfo>
#include <QLocalSocket>
#include <QLoggingCategory>
#include <QUuid>

#include <sddl.h>
#include <cfapi.h>
Expand Down Expand Up @@ -467,14 +468,17 @@ OCC::Result<void, QString> OCC::CfApiWrapper::registerSyncRoot(const QString &pa
const auto version = std::wstring(providerVersion.toStdWString().data());

CF_SYNC_REGISTRATION info;
info.StructSize = sizeof(info) + (name.length() + version.length()) * sizeof(wchar_t);
info.ProviderName = name.data();
info.ProviderVersion = version.data();
info.SyncRootIdentity = nullptr;
info.SyncRootIdentityLength = 0;
info.FileIdentity = nullptr;
info.FileIdentityLength = 0;
info.ProviderId = QUuid::createUuid();

CF_SYNC_POLICIES policies;
policies.StructSize = sizeof(policies);
policies.Hydration.Primary = CF_HYDRATION_POLICY_FULL;
policies.Hydration.Modifier = CF_HYDRATION_POLICY_MODIFIER_NONE;
policies.Population.Primary = CF_POPULATION_POLICY_ALWAYS_FULL;
Expand Down

0 comments on commit 74b5ca3

Please sign in to comment.