From 63ce0b05d99225496f31ba9fd444ab2fefdc37e9 Mon Sep 17 00:00:00 2001
From: John Southworth <john.southworth@vyatta.com>
Date: Thu, 14 Jul 2011 18:49:09 -0500
Subject: Don't allow users to set migration comments (cherry picked from
 commit 9f1ff5427e0f72f2bded287be6e1d4cf442945cb)

---
 src/cstore/cstore.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'src/cstore')

diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp
index 9a5961f..c86631b 100644
--- a/src/cstore/cstore.cpp
+++ b/src/cstore/cstore.cpp
@@ -997,6 +997,16 @@ Cstore::commentCfgPath(const Cpath& args)
     output_user("Cannot use the '*' character in a comment\n");
     return false;
   }
+  if (comment.find("CONFIGURATION COMMENTED OUT DURING MIGRATION BELOW") != string::npos){
+    // Don't allow users to set configuration migration comments
+    output_user("Cannot use the string 'CONFIGURATION COMMENTED OUT DURING MIGRATION BELOW' in a comment\n");
+    return false;
+  }
+  if (comment.find("CONFIGURATION COMMENTED OUT DURING MIGRATION ABOVE") != string::npos){
+    // Don't allow users to set configuration migration comments
+    output_user("Cannot use the string 'CONFIGURATION COMMENTED OUT DURING MIGRATION ABOVE' in a comment\n");
+    return false;
+  }
 
   bool ret = false;
   {
-- 
cgit v1.2.3