[Csync2] old patches and such
Art -kwaak- van Breemen
ard+csync2 at telegraafnet.nl
Tue Dec 22 11:02:27 CET 2009
Hello,
On Tue, Dec 15, 2009 at 10:45:53PM +0100, Lars Ellenberg wrote:
> btw.
> I also don't really like the tempnam().
> because TMPDIR (if set) from environment will override config file.
> should we use mkstemp, and specifically use the prefix from the config
> file, fall back to P_tmpdir if none is specified explicitly?
Well, yes, I also didn't like it. I took a look at the glibc source
and found out there is only one function that adheres to TMPDIR
and can also accept another directory.
The thing is: we want 2 types of tempfiles:
1) a real tempfile. But we do want to be able to say where to put
that tempfile. tempfile's can get bigger than /tmp or /var/tmp
can hold, since it's a copy of an original file. We don't want to
bail out, just because someone accidentally put a database dump
in the syncable directories.
2) A named tempfile, or something like that, that we can use
later on to mv it into place.
Copying it and stuff like that really hurts. If we can't
immdiately mv, we should cp it to a temporary file within the
same directory, and then mv it.
Actually we want a sane file to be there at all times.
More information about the Csync2
mailing list