<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 22, 2016 at 7:56 PM, James Cowgill <span dir="ltr"><<a href="mailto:jcowgill@debian.org" target="_blank">jcowgill@debian.org</a>></span> wrote:<br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
</span>Thinking about this some more, there is a slight race condition here if<br>
the user deletes the file after the checks, but before it's written. I<br>
think the best fix would break the smogrify API unfortunately. One<br>
alternative is to use to use open(2)'s O_CREATE | O_EXCL flags, but this<br>
will only work if the file does not exist beforehand.<br>
<span class=""></span></blockquote><div><br><br></div><div>Actually I just had a much simpler idea. Since we are only interested in getting the value, I can alter this function so that the value is written to stdout instead of to /tmp.<br><br><br></div><div><br><br> </div></div></div></div>