aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-12 00:26:39 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-12 00:26:39 +0000
commit7e750974aae0796dff0162ee165a672c848ccccd (patch)
treeb2a2357f2e6157e65a2b2fda7ff3cc41c0fc6ee7 /main
parentc2672ddbec31f495a01065e7f63007a3d602d8dd (diff)
Call execl() directly for a better solution for paths with spaces.
(closes issue #18600) Reported by: ebroad Patches: 20110111__issue18600__2.diff.txt uploaded by tilghman (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@301402 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/file.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/main/file.c b/main/file.c
index a5c99d55a..c37937be1 100644
--- a/main/file.c
+++ b/main/file.c
@@ -310,11 +310,9 @@ static void filestream_destructor(void *arg)
ast_translator_free_path(f->trans);
if (f->realfilename && f->filename) {
- size = strlen(f->filename) + strlen(f->realfilename) + 15;
- cmd = alloca(size);
- memset(cmd,0,size);
- snprintf(cmd, size, "/bin/mv -f \"%s\" \"%s\"", f->filename, f->realfilename);
- ast_safe_system(cmd);
+ if (ast_safe_fork(0) == 0) {
+ execl("/bin/mv", "mv", "-f", f->filename, f->realfilename, SENTINEL);
+ }
}
if (f->filename)