This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
+ version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
* Author: Andrew Tridgell
*/
-#include "includes.h"
-#include "ldb/include/includes.h"
-
-#include "ldb/ldb_tdb/ldb_tdb.h"
+#include "ldb_tdb.h"
/* change this if the data format ever changes */
#define LTDB_PACKING_FORMAT 0x26011967
const struct ldb_message *message,
struct TDB_DATA *data)
{
- struct ldb_context *ldb = module->ldb;
+ struct ldb_context *ldb;
unsigned int i, j, real_elements=0;
size_t size;
- char *dn;
+ const char *dn;
uint8_t *p;
size_t len;
- dn = ldb_dn_linearize(ldb, message->dn);
+ ldb = ldb_module_get_ctx(module);
+
+ dn = ldb_dn_get_linearized(message->dn);
if (dn == NULL) {
errno = ENOMEM;
return -1;
/* allocate it */
data->dptr = talloc_array(ldb, uint8_t, size);
if (!data->dptr) {
- talloc_free(dn);
errno = ENOMEM;
return -1;
}
}
}
- talloc_free(dn);
return 0;
}
const struct TDB_DATA *data,
struct ldb_message *message)
{
- struct ldb_context *ldb = module->ldb;
+ struct ldb_context *ldb;
uint8_t *p;
unsigned int remaining;
unsigned int i, j;
unsigned format;
size_t len;
+ ldb = ldb_module_get_ctx(module);
message->elements = NULL;
p = data->dptr;