Commit 97628462 authored by Iustin Pop's avatar Iustin Pop
Browse files

Change a hardcoded path into its proper constant

The function backend.UploadFile still uses "/etc/hosts" directly instead
of the existing constant; this patch fixes this.

Reviewed-by: ultrotter
parent bd249e2f
......@@ -921,8 +921,11 @@ def UploadFile(file_name, data, mode, uid, gid, atime, mtime):
file_name)
return False
allowed_files = [constants.CLUSTER_CONF_FILE, "/etc/hosts",
constants.SSH_KNOWN_HOSTS_FILE]
allowed_files = [
constants.CLUSTER_CONF_FILE,
constants.ETC_HOSTS,
constants.SSH_KNOWN_HOSTS_FILE,
]
allowed_files.extend(ssconf.SimpleStore().GetFileList())
if file_name not in allowed_files:
logger.Error("Filename passed to UploadFile not in allowed"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment