bdev: Add functions to verify file storage paths
authorMichael Hanselmann <hansmi@google.com>
Thu, 4 Oct 2012 14:58:26 +0000 (16:58 +0200)
committerMichael Hanselmann <hansmi@google.com>
Fri, 5 Oct 2012 16:22:57 +0000 (18:22 +0200)
commitfbdac0d912e794705b18637a611c9d87265c1501
treeab1ffc73b454abcb67a2d784fe5aea33b8698c34
parent045694691691af1b10d1d055bdac55cf205e47de
bdev: Add functions to verify file storage paths

- LoadAllowedFileStoragePaths: Loads a list of allowed file storage
  paths from a file
- CheckFileStoragePath: Checks a path against the list of allowed paths

The unit test for “utils.IsBelowDir” is updated with cases which weren't
tested before.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
lib/bdev.py
lib/errors.py
lib/pathutils.py
test/ganeti.bdev_unittest.py
test/ganeti.utils.io_unittest.py