summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2012-10-22 20:54:48 +0000
committerChris Wilson <chris+github@qwirx.com>2012-10-22 20:54:48 +0000
commitc920768ad02b7d3238865afa7d67a5e2a6ee5fdc (patch)
tree5daa25fdc2cc38d10f0156b85a2d0401c4ba1597
parent09fe7a13377f9f4fb0550ad50e2976d661bd23eb (diff)
Refuse login to disabled accounts.
-rw-r--r--lib/backupstore/BackupCommands.cpp7
-rw-r--r--lib/backupstore/backupprotocol.txt1
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/backupstore/BackupCommands.cpp b/lib/backupstore/BackupCommands.cpp
index 66764a3b..aa4d3823 100644
--- a/lib/backupstore/BackupCommands.cpp
+++ b/lib/backupstore/BackupCommands.cpp
@@ -120,6 +120,13 @@ std::auto_ptr<BackupProtocolMessage> BackupProtocolLogin::DoCommand(BackupProtoc
// Load the store info
rContext.LoadStoreInfo();
+ if(!rContext.GetBackupStoreInfo().IsAccountEnabled())
+ {
+ BOX_WARNING("Refused login from disabled client ID " <<
+ BOX_FORMAT_ACCOUNT(mClientID));
+ return PROTOCOL_ERROR(Err_DisabledAccount);
+ }
+
// Get the last client store marker
int64_t clientStoreMarker = rContext.GetClientStoreMarker();
diff --git a/lib/backupstore/backupprotocol.txt b/lib/backupstore/backupprotocol.txt
index 9df62459..aa987e70 100644
--- a/lib/backupstore/backupprotocol.txt
+++ b/lib/backupstore/backupprotocol.txt
@@ -39,6 +39,7 @@ Error 0 IsError(Type,SubType) Reply
CONSTANT Err_DoesNotExistInDirectory 13
CONSTANT Err_PatchConsistencyError 14
CONSTANT Err_MultiplyReferencedObject 15
+ CONSTANT Err_DisabledAccount 16
Version 1 Command(Version) Reply
int32 Version