diff --git a/src/server/handler/modify.cpp b/src/server/handler/modify.cpp --- a/src/server/handler/modify.cpp +++ b/src/server/handler/modify.cpp @@ -140,8 +140,9 @@ } if (cmd.modifiedParts() & Protocol::ModifyCollectionCommand::RemoteID) { - if (cmd.remoteId() != collection.remoteId()) { + if (cmd.remoteId() != collection.remoteId() && !cmd.remoteId().isEmpty()) { if (!connection()->isOwnerResource(collection)) { + qWarning() << "Invalid attempt to modify the collection remoteID from" << collection.remoteId() << "to" << cmd.remoteId(); return failureResponse("Only resources can modify remote identifiers"); } collection.setRemoteId(cmd.remoteId()); diff --git a/src/server/handler/store.cpp b/src/server/handler/store.cpp --- a/src/server/handler/store.cpp +++ b/src/server/handler/store.cpp @@ -238,8 +238,9 @@ } if (item.isValid() && cmd.modifiedParts() & Protocol::ModifyItemsCommand::RemoteID) { - if (item.remoteId() != cmd.remoteId()) { + if (item.remoteId() != cmd.remoteId() && !cmd.remoteId().isEmpty()) { if (!connection()->isOwnerResource(item)) { + qWarning() << "Invalid attempt to modify the remoteID for item" << item.id() << "from" << item.remoteId() << "to" << cmd.remoteId(); return failureResponse("Only resources can modify remote identifiers"); } item.setRemoteId(cmd.remoteId());