]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2937] Parse CSV in strict mode
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Fri, 17 May 2013 09:24:20 +0000 (11:24 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Fri, 17 May 2013 09:24:20 +0000 (11:24 +0200)
Don't accept invalid inputs. It seems some versions of the csv library
rejected this before, but some didn't. Making sure all of them reject
now, to get more reliable operation and consistent behavior.

src/bin/usermgr/b10-cmdctl-usermgr.py.in

index 37be304d23c0178dce1cc1df66826c9e5625ae95..b0fd30f8a0d9465fa144ac54a89b85b84d76cf0c 100755 (executable)
@@ -75,7 +75,7 @@ class UserManager:
             # Just let any file read error bubble up; it will
             # be caught in the run() method
             with open(self.options.output_file, newline='') as csvfile:
-                reader = csv.reader(csvfile)
+                reader = csv.reader(csvfile, strict=True)
                 for row in reader:
                     self.user_info[row[0]] = row