1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

fix alignment bug for pulldb

(This used to be ctdb commit f1188289c18805c2c5f8bae61d73df3fc762faee)
This commit is contained in:
Ronnie Sahlberg 2007-05-08 14:42:00 +10:00
parent 54d2acec40
commit e11eebd070

View File

@ -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;
}