[FFmpeg-devel] [PATCH] wrap mkstemp with umask

Erik Hovland erik
Mon Jul 21 22:18:49 CEST 2008


On Mon, Jul 21, 2008 at 09:00:29PM +0200, Reimar D?ffinger wrote:
> Hello,
> On Sun, Jul 20, 2008 at 01:52:07PM -0700, Erik Hovland wrote:
> > On Thu, Jul 17, 2008 at 09:39:33PM +0200, Reimar D?ffinger wrote:
> > > On Thu, Jul 17, 2008 at 12:28:45PM -0700, Erik Hovland wrote:
> > > > It is possible that the current umask of the process creating the file
> > > > with mkstemp is such that the temp file could be writable by others then
> > > > the user. When mkstemp is used it can be wrapped with umask() calls to
> > > > make absolutely sure that the temp file cannot be tampered with.
> > > 
> > > That makes it completely thread-unsafe.
> > 
> > Is the only caller using threads? It is likely that the code is not
> > thread-safe to begin with because it has two calls to mkstemp where it
> > changes the template. Whoever uses this call now should really hold a
> > lock (even w/out the umask calls).
> 
> Why should the two mkstemps be a big problem here?

I didn't say it was a 'big' problem. But I retract what I said about it
being a problem at all. I was wrong.

E

-- 
Erik Hovland
mail: erik at hovland.org
web: http://hovland.org/
PGP/GPG public key available on request





More information about the ffmpeg-devel mailing list