From dcc48f248dc848e66e05e0d57ebeb28b6ff189dd Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 1 Oct 2013 14:47:50 -0500 Subject: Use atomic_move to put the file, rather than shelling out Fixes #4321 Conflicts: library/utilities/accelerate --- library/utilities/accelerate | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/library/utilities/accelerate b/library/utilities/accelerate index 4ac2fa478a..9ff84c6e2e 100644 --- a/library/utilities/accelerate +++ b/library/utilities/accelerate @@ -380,14 +380,7 @@ class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): if final_path: vvv("moving %s to %s" % (out_path, final_path)) - args = ['sudo','cp',out_path,final_path] - rc, stdout, stderr = self.server.module.run_command(args, close_fds=True) - if rc != 0: - return dict(failed=True, stdout="failed to copy the file into position with sudo") - args = ['sudo','chown',final_user,out_path,final_path] - rc, stdout, stderr = self.server.module.run_command(args, close_fds=True) - if rc != 0: - return dict(failed=True, stdout="failed to chown the file via sudo") + self.server.module.atomic_move(out_path, final_path) return dict() def daemonize(module, password, port, timeout, minutes): -- cgit v1.2.1