From a040c4569c5d3aa73aa4166472ef256c8437be46 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 5 Feb 2009 17:15:04 +0000 Subject: [PATCH] protect against spaces in filenames --- PLC/Methods/GetBootMedium.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PLC/Methods/GetBootMedium.py b/PLC/Methods/GetBootMedium.py index 3e260ed..e2d1ebf 100644 --- a/PLC/Methods/GetBootMedium.py +++ b/PLC/Methods/GetBootMedium.py @@ -464,11 +464,11 @@ class GetBootMedium(Method): generic_path = "%s/%s" % (self.GENERICDIR,generic_name) if filename: - ret=os.system ("cp %s %s"%(generic_path,filename)) + ret=os.system ('cp "%s" "%s"'%(generic_path,filename)) if ret==0: return filename else: - raise PLCPermissionDenied, "Could not copy %s into"%(generic_path,filename) + raise PLCPermissionDenied, "Could not copy %s into %s"%(generic_path,filename) else: ### return the generic medium content as-is, just base64 encoded return base64.b64encode(file(generic_path).read()) @@ -542,7 +542,7 @@ class GetBootMedium(Method): # handle result if filename: - ret=os.system("mv %s %s"%(node_image,filename)) + ret=os.system('mv "%s" "%s"'%(node_image,filename)) if ret != 0: self.trash.append(node_image) self.cleantrash() -- 2.43.0