From 976284626ff55fbc2b7984a1440eb2c2b497dc60 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sun, 20 Jan 2008 22:09:31 +0000
Subject: [PATCH] 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
---
 lib/backend.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/backend.py b/lib/backend.py
index da969c0f2..8b6291a0a 100644
--- a/lib/backend.py
+++ b/lib/backend.py
@@ -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"
-- 
GitLab