<html><head></head><body>Hi,<br><br>Besides Steve's portability objections, this patch does not make much sense. It suffers from the exact same problems as the existing code, just more complicated and without a warning.<br><br><div class="gmail_quote">Le 27 septembre 2020 23:30:20 GMT+03:00, Lyndon Brown <jnqnfe@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">attached. preview:<br><br>From: Lyndon Brown <jnqnfe@gmail.com><br>Date: Fri, 29 Mar 2019 14:31:38 +0000<br>Subject: record: use vlc_mkstemp instead of tempnam<br><br>resolves compile warning about insecure function<br><br>diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c<br>index ce2ce958e7..f205c610f6 100644<br>--- a/modules/stream_out/record.c<br>+++ b/modules/stream_out/record.c<br>@@ -465,10 +465,20 @@ static void OutputStart( sout_stream_t *p_stream )<br> char *psz_file;<br> int i_es;<br> <br>- psz_file = tempnam( NULL, "vlc" );<br>+ psz_file = strdup( DIR_SEP"tmp"DIR_SEP"vlc-recording.XXXXXX" );<br> if( !psz_file )<br> continue;<br> <br>+ int fd = vlc_mkstemp( psz_file );<br>+<br>+ if( fd == -1 )<br>+ continue;<br>+<br>+ /* FIXME: unlink after creation, we only want to create it here,<br>+ not hold it open since sout takes a path to open not an FD of<br>+ an already open file */<br>+ vlc_unlink( psz_file );<br>+<br> msg_Dbg( p_stream, "probing muxer %s", ppsz_muxers[i][0] );<br> i_es = OutputNew( p_stream, ppsz_muxers[i][0], psz_file, NULL );<br> <br></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>