Revision 714ea7ca lib/backend.py

b/lib/backend.py
23 23

  
24 24
@var _ALLOWED_UPLOAD_FILES: denotes which files are accepted in
25 25
     the L{UploadFile} function
26
@var _ALLOWED_CLEAN_DIRS: denotes which directories are accepted
27
     in the L{_CleanDirectory} function
26 28

  
27 29
"""
28 30

  
......
57 59

  
58 60

  
59 61
_BOOT_ID_PATH = "/proc/sys/kernel/random/boot_id"
62
_ALLOWED_CLEAN_DIRS = frozenset([
63
  constants.DATA_DIR,
64
  constants.JOB_QUEUE_ARCHIVE_DIR,
65
  constants.QUEUE_DIR,
66
  ])
60 67

  
61 68

  
62 69
class RPCFail(Exception):
......
143 150
      to the empty list
144 151

  
145 152
  """
153
  if path not in _ALLOWED_CLEAN_DIRS:
154
    _Fail("Path passed to _CleanDirectory not in allowed clean targets: '%s'",
155
          path)
156

  
146 157
  if not os.path.isdir(path):
147 158
    return
148 159
  if exclude is None:

Also available in: Unified diff