#3249(FFmpeg:new): File names containing colon results in automatic file overwrite
#3249: File names containing colon results in automatic file overwrite --------------------------------+-------------------------------------- Reporter: jnvsor | Type: defect Status: new | Priority: minor Component: FFmpeg | Version: git-master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | --------------------------------+-------------------------------------- When using colons in file names (And adding the `file://` protocol to prevent ffmpeg mistaking filename for protocol) ffmpeg automatically overwrites any existing file without prompt. {{{ ffmpeg -i in.avi "file://$HOME/out:file.webm" # creates file ffmpeg -i in.avi "file://$HOME/out:file.webm" # No overwrite prompt ffmpeg -i in.avi out-file.webm # creates file ffmpeg -i in.avi out-file.webm # Overwrite prompt }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/3249> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3249: File names containing colon results in automatic file overwrite ------------------------------------+---------------------------------- Reporter: jnvsor | Owner: Type: defect | Status: new Priority: minor | Component: FFmpeg Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 1 | ------------------------------------+---------------------------------- Changes (by beastd): * analyzed: 0 => 1 * reproduced: 0 => 1 Comment: I can see it here too. Seems the heuristic in function assert_file_overwrite in ffmpeg_opt.c is not recognizing those colon file names as file names. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3249#comment:1> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3249: File names containing colon results in automatic file overwrite ------------------------------------+---------------------------------- Reporter: jnvsor | Owner: Type: defect | Status: open Priority: minor | Component: FFmpeg Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 1 | ------------------------------------+---------------------------------- Changes (by beastd): * status: new => open -- Ticket URL: <https://trac.ffmpeg.org/ticket/3249#comment:2> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3249: File names containing colon results in automatic file overwrite ------------------------------------+---------------------------------- Reporter: jnvsor | Owner: Type: defect | Status: open Priority: minor | Component: FFmpeg Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 1 | ------------------------------------+---------------------------------- Comment (by beastd): Replying to [comment:1 beastd]:
Seems the heuristic in function assert_file_overwrite in ffmpeg_opt.c is not recognizing those colon file names as file names.
I wonder if the heuristic is needed when opening output files. I guess not. But there might be other places where it helps. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3249#comment:3> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3249: File names containing colon results in automatic file overwrite ------------------------------------+---------------------------------- Reporter: jnvsor | Owner: Type: defect | Status: open Priority: minor | Component: FFmpeg Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 1 | ------------------------------------+---------------------------------- Comment (by beastd): I attached a hackish [attachment:beastd-file-overwrite-hackish-partial- fix.diff patch] that fixes the problem for `file:` output files. '''But it still has problems for `file:` specifications that refer to relative file names without using `./` or `../`'''. '''I assume it could even do very wrong things''' depending on the exact file name provided. So do not use it if you cannot guarantee that you file names are always absolute or relative names start with `./` or `../`. I am still searching for a way to fix this properly for all cases including the ones that do not specify `file:` names. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3249#comment:4> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3249: File names containing colon results in automatic file overwrite ------------------------------------+---------------------------------- Reporter: jnvsor | Owner: Type: defect | Status: open Priority: minor | Component: FFmpeg Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 1 | ------------------------------------+---------------------------------- Comment (by beastd): Patch series sent to ffmpeg-devel ML for discussion: http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/172819 Testing welcome. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3249#comment:5> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#3249: File names containing colon results in automatic file overwrite ------------------------------------+---------------------------------- Reporter: jnvsor | Owner: Type: defect | Status: open Priority: minor | Component: FFmpeg Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 1 | ------------------------------------+---------------------------------- Comment (by beastd): Part of this is fixed in ffmpeg git master commit 77015443a84bb5dbed38eafc2ea26a2bf2641ed6 So if you always use the `file:<path>` syntax the overwrite check will now work. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3249#comment:6> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg