ssconf: Verify file size when reading, add some tests
authorMichael Hanselmann <hansmi@google.com>
Wed, 28 Nov 2012 08:23:28 +0000 (09:23 +0100)
committerMichael Hanselmann <hansmi@google.com>
Wed, 28 Nov 2012 11:48:36 +0000 (12:48 +0100)
commit911dfc49c432bdc486876b7dd3d3067db3edb961
tree76221d29b9b39e7e7a8f1d000a16df41b502ae4e
parent965a542a382f74c30b14b2283d972dd371b23dae
ssconf: Verify file size when reading, add some tests

Until now ssconf would limit the amount read from files to 128 KiB and
silently ignored files larger than that. With this patch a check is
added by using fstat(2) on the file descriptor while it's being read.

There were no tests file ssconf at all, so some are added.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Makefile.am
lib/ssconf.py
test/ganeti.ssconf_unittest.py [new file with mode: 0755]