Revision 553f1c1d lib/backend.py

b/lib/backend.py
1026 1026
    return rbd
1027 1027
  return (rbd.dev_path, rbd.major, rbd.minor) + rbd.GetSyncStatus()
1028 1028

  
1029
def _IsJobQueueFile(file_name):
1030
  queue_dir = os.path.normpath(constants.QUEUE_DIR)
1031
  return os.path.commonprefix([queue_dir, file_name]) == queue_dir
1032 1029

  
1033 1030
def UploadFile(file_name, data, mode, uid, gid, atime, mtime):
1034 1031
  """Write a file to the filesystem.
......
1050 1047
    ]
1051 1048
  allowed_files.extend(ssconf.SimpleStore().GetFileList())
1052 1049

  
1053
  if not (file_name in allowed_files or _IsJobQueueFile(file_name)):
1050
  if file_name not in allowed_files:
1054 1051
    logging.error("Filename passed to UploadFile not in allowed"
1055 1052
                 " upload targets: '%s'", file_name)
1056 1053
    return False

Also available in: Unified diff