Revision cf00dba0 lib/backend.py

b/lib/backend.py
668 668
  blockdevs = {}
669 669

  
670 670
  for devpath in devices:
671
    if os.path.commonprefix([DEV_PREFIX, devpath]) != DEV_PREFIX:
671
    if not utils.IsBelowDir(DEV_PREFIX, devpath):
672 672
      continue
673 673

  
674 674
    try:
......
2507 2507
  fs_dir = os.path.normpath(fs_dir)
2508 2508
  base_fstore = cfg.GetFileStorageDir()
2509 2509
  base_shared = cfg.GetSharedFileStorageDir()
2510
  if ((os.path.commonprefix([fs_dir, base_fstore]) != base_fstore) and
2511
      (os.path.commonprefix([fs_dir, base_shared]) != base_shared)):
2510
  if not (utils.IsBelowDir(base_fstore, fs_dir) or
2511
          utils.IsBelowDir(base_shared, fs_dir)):
2512 2512
    _Fail("File storage directory '%s' is not under base file"
2513 2513
          " storage directory '%s' or shared storage directory '%s'",
2514 2514
          fs_dir, base_fstore, base_shared)

Also available in: Unified diff