From: Ronnie Sahlberg Date: Tue, 8 May 2007 04:42:00 +0000 (+1000) Subject: fix alignment bug for pulldb X-Git-Tag: tevent-0.9.20~348^2~2766^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e11eebd070b8e1cdb92a959f0517e268690724e4;p=thirdparty%2Fsamba.git fix alignment bug for pulldb (This used to be ctdb commit f1188289c18805c2c5f8bae61d73df3fc762faee) --- diff --git a/ctdb/common/ctdb_control.c b/ctdb/common/ctdb_control.c index f79aaf0ce8d..85c61273012 100644 --- a/ctdb/common/ctdb_control.c +++ b/ctdb/common/ctdb_control.c @@ -92,6 +92,7 @@ static int traverse_getkeys(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data len+=4; /*lmaster*/ len+=4; /*key len*/ len+=4; /*data len */ + len=(len+CTDB_DS_ALIGNMENT-1)& ~(CTDB_DS_ALIGNMENT-1); len+=key.dsize; len=(len+CTDB_DS_ALIGNMENT-1)& ~(CTDB_DS_ALIGNMENT-1); len+=sizeof(struct ctdb_ltdb_header); @@ -122,6 +123,7 @@ static int traverse_getkeys(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data ptr = outdata->dptr+(((ptr-outdata->dptr)+CTDB_DS_ALIGNMENT-1)& ~(CTDB_DS_ALIGNMENT-1)); memcpy(ptr, data.dptr+sizeof(struct ctdb_ltdb_header), data.dsize-sizeof(struct ctdb_ltdb_header)); + ptr = outdata->dptr+(((ptr-outdata->dptr)+CTDB_DS_ALIGNMENT-1)& ~(CTDB_DS_ALIGNMENT-1)); return 0; }