On 06/14/2018 08:36 AM, Richard W.M. Jones wrote:
There are a few other issues that Coverity found, but I believe
all can be ignored ... except one:

We don't set umask anywhere inside nbdkit.  Coverity complains that
this is a problem where we create temporary files, since the result of
mkstemp depends implicitly on the umask value.  I think we might
consider setting umask anyway (eg. to 022) just to make plugin
behaviour more predictable.  What do you think?

Setting umask() is not threadsafe - it must be done up front before any threads can be created (and is therefore unsafe to do in a library that might be linked into a larger multithreaded program). But setting a sane umask up front seems reasonable to me.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to