[Csync2] old patches and such

Lars Ellenberg lars.ellenberg at linbit.com
Tue Dec 22 13:28:14 CET 2009


On Tue, Dec 22, 2009 at 11:02:27AM +0100, Art -kwaak- van Breemen wrote:
> 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.

Absolutely.
Maybe it is even the same?
The temporary file to be moved in place should be created
alongside the original in the same directory.
There is code we can borrow directly from rsync for that.
Someone just has to do it ;)

Though I'm unsure about how the ACL problem is solved.
I think Clifford did it this truncated and copy-over
way, to be sure the (not necessarily Windows) ACLs
of the original file are retained.

But since currently ACL changes are neither detected nor replicated
properly, we may get away with ignoring them for now,
or at least add an option to switch to/from "move in place"
and the curent "truncate and copy over" method.


-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.


More information about the Csync2 mailing list