https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r301402 | tilghman | 2011-01-11 18:26:39 -0600 (Tue, 11 Jan 2011) | 7 lines
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: https://origsvn.digium.com/svn/asterisk/trunk@301403
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
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)