Launchpadlib support in Ubuntu Developer Tools

Stefan Potyra stefan.potyra at
Thu Jan 15 10:07:46 GMT 2009


On Thursday 15 January 2009 01:48:44 Kees Cook wrote:
> Now I have to redeem my embarrassment by suggesting this as a way to avoid
> the create/chmod race when fchmod is unavailable:
>         credfd = tempfile.NamedTemporaryFile(dir=os.path.dirname(credfile))
>, credfile)
>         credfd.close()
> The link will fail if the target exists, and the close will clean up the
> original file.  Wheee  :)

how about simply using to avoid the race in the first place?
Or mangle the umask to the right thing before the (fd)open?


More information about the ubuntu-devel mailing list