diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-01-12 00:26:39 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-01-12 00:26:39 +0000 |
commit | 7e750974aae0796dff0162ee165a672c848ccccd (patch) | |
tree | b2a2357f2e6157e65a2b2fda7ff3cc41c0fc6ee7 | |
parent | c2672ddbec31f495a01065e7f63007a3d602d8dd (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
-rw-r--r-- | main/file.c | 8 |
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) |