Re: Patch for freebsd mail/mutt port
Udo Schweigert <mutt@xxxxxxxxxxxxxxx>:
> > From: Eivind Eklund <eivind@xxxxxxxxxxx>
> >
> > Ideally, this should be replaced with a proper patch to use mkstemp
> > generally
> > in mutt where possible, and be fed back to mutt.org.
Yes, mkstemp seems nicer.
> > The other option is to make mutt use a temp dir around the area where it
> > mktemp. Directories can be created safely, files can't.
Why is creating a directory safer than creating a file with O_EXCL?
(From a shell script, or some other language where you can't set
O_EXCL, it certainly is safer to make a directory, and it's easier,
too, if you're creating several files, because the directory name is
the only variable you need to carry around. If you set TMP and TMPDIR
to your new directory you can sometimes even prevent other programs
you invoke from doing dangerous things.)
Edmund