changeset 3:4734efec5732

Can't move fles in or above HADES_DIR now.
author Atul Varma <varmaa@toolness.com>
date Mon, 08 Dec 2008 13:50:08 -0800
parents 05cece4371a4
children 702b55be9030
files kharon.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kharon.py	Mon Dec 08 13:37:34 2008 -0800
+++ b/kharon.py	Mon Dec 08 13:50:08 2008 -0800
@@ -62,6 +62,11 @@
             if not os.path.exists(filename):
                 print('File does not exist: %s' % arg)
                 sys.exit(-1)
+            realpath = os.path.realpath(filename)
+            if (realpath.startswith(HADES_DIR) or
+                HADES_DIR.startswith(realpath)):
+                print('Cannot move files in or above %s.' % HADES_DIR)
+                sys.exit(-1)
             files.append(filename)
 
         thisid = config.nextid