set and epoch's name must comprise alphanum chars
[sitarba.git] / sitarba
diff --git a/sitarba b/sitarba
index c236ba0589e68018b41991ba3231ef40b6396ed3..3ff4bfff4754abd7fd37c110f803315cfefb3a8f 100755 (executable)
--- a/sitarba
+++ b/sitarba
@@ -224,6 +224,10 @@ class Config:
         e = Epoch()
         if name in self.epochs:
             raise Config.ReadError("Epoch '{0}' already defined.".format(name))
+        p = re.compile(r'^\w+$')
+        if not p.match(name):
+            raise Config.ReadError("Epoch name '{0}' does not only " + \
+                    "comprise alphanumeric characters.".format(name))
         if name in Epoch.units:
             e.unit = name
 
@@ -267,6 +271,11 @@ class Config:
 
     def _read_set(self, config, sec):
         name = sec[4:].strip()
+        p = re.compile(r'^\w+$')
+        if not p.match(name):
+            raise Config.ReadError("Set name '{0}' does not only " + \
+                    "comprise alphanumeric characters.".format(name))
+
         dirs = []
         excludes = []