From 1ecc8a3eef4271931dc11edef6fb4d849657f7c7 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sat, 4 Jan 2020 17:15:06 -0500 Subject: [PATCH] Enforce seperate license keys for connected replicas Former-commit-id: bc005cb50b1010a2bc9170e261cd93dba849c35f --- src/replication.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++++ src/server.h | 22 ++++++++++++---------- 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/src/replication.cpp b/src/replication.cpp index 730746081..44fa91452 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -985,6 +985,19 @@ LError: return; } +void processReplconfLicense(client *c, robj *arg) +{ + if (cserver.license_key != nullptr) + { + if (strcmp(cserver.license_key, szFromObj(arg)) == 0) { + addReplyError(c, "Each replica must have a unique license key"); + c->flags |= CLIENT_CLOSE_AFTER_REPLY; + return; + } + } + addReply(c, shared.ok); +} + /* REPLCONF