mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
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/branches/1.8@301402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -310,11 +310,9 @@ static void filestream_destructor(void *arg)
|
|||||||
ast_translator_free_path(f->trans);
|
ast_translator_free_path(f->trans);
|
||||||
|
|
||||||
if (f->realfilename && f->filename) {
|
if (f->realfilename && f->filename) {
|
||||||
size = strlen(f->filename) + strlen(f->realfilename) + 15;
|
if (ast_safe_fork(0) == 0) {
|
||||||
cmd = alloca(size);
|
execl("/bin/mv", "mv", "-f", f->filename, f->realfilename, SENTINEL);
|
||||||
memset(cmd,0,size);
|
}
|
||||||
snprintf(cmd, size, "/bin/mv -f \"%s\" \"%s\"", f->filename, f->realfilename);
|
|
||||||
ast_safe_system(cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f->filename)
|
if (f->filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user