diff options
author | Aaron Haslett <aaronhaslett@catalyst.net.nz> | 2019-05-10 18:10:51 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-05-22 04:42:28 +0000 |
commit | 474e55523224430781ed22aa2d0c8a474306e794 (patch) | |
tree | 3903ab71c535f701bf7e493cc1c9a28a4b1d6fc6 /lib/ldb/include/ldb_module.h | |
parent | 3e6661fd73bb24ef5700a98f676f1df5eeca408b (diff) | |
download | samba-474e55523224430781ed22aa2d0c8a474306e794.tar.gz |
ldb: baseinfo pack format check on init
We will be adding a new packing format in forthcoming commits and there
may be more versions in the future. We need to make sure the database
contains records in a format we know how to read and write.
Done by fetching the @BASEINFO record and reading the first 4
bytes which contain the packing format version.
NOTE: Configure with --abi-check-disable to build this commit. This
patch is part of a set of LDB ABI changes, and the version update is
done on the last commit.
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib/ldb/include/ldb_module.h')
-rw-r--r-- | lib/ldb/include/ldb_module.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ldb/include/ldb_module.h b/lib/ldb/include/ldb_module.h index 759a54a3169..d9114e99e34 100644 --- a/lib/ldb/include/ldb_module.h +++ b/lib/ldb/include/ldb_module.h @@ -544,12 +544,21 @@ int ldb_unpack_data_flags(struct ldb_context *ldb, struct ldb_message *message, unsigned int flags); +int ldb_unpack_get_format(const struct ldb_val *data, + uint32_t *pack_format_version); + /* currently unused (was NO_DATA_ALLOC) 0x0001 */ #define LDB_UNPACK_DATA_FLAG_NO_DN 0x0002 #define LDB_UNPACK_DATA_FLAG_NO_VALUES_ALLOC 0x0004 #define LDB_UNPACK_DATA_FLAG_NO_ATTRS 0x0008 #define LDB_UNPACK_DATA_FLAG_READ_LOCKED 0x0010 +/* In-use packing formats */ +#define LDB_PACKING_FORMAT 0x26011967 + +/* Old packing formats */ +#define LDB_PACKING_FORMAT_NODN 0x26011966 + /** Forces a specific ldb handle to use the global event context. |