Revision 748c9884

b/lib/backend.py
2875 2875
    if not utils.IsNormAbsPath(filename):
2876 2876
      _Fail("Path '%s' is not normalized or absolute", filename)
2877 2877

  
2878
    directory = os.path.normpath(os.path.dirname(filename))
2878
    real_filename = os.path.realpath(filename)
2879
    directory = os.path.dirname(real_filename)
2879 2880

  
2880
    if (os.path.commonprefix([constants.EXPORT_DIR, directory]) !=
2881
        constants.EXPORT_DIR):
2882
      _Fail("File '%s' is not under exports directory '%s'",
2883
            filename, constants.EXPORT_DIR)
2881
    if utils.IsBelowDir(constants.EXPORT_DIR, real_filename):
2882
      _Fail("File '%s' is not under exports directory '%s': %s",
2883
            filename, constants.EXPORT_DIR, real_filename)
2884 2884

  
2885 2885
    # Create directory
2886 2886
    utils.Makedirs(directory, mode=0750)

Also available in: Unified diff