samba_dsdb: Use and maintain compatibleFeatures and requiredFeatures in @SAMBA_DSDB
authorAndrew Bartlett <abartlet@samba.org>
Thu, 12 Jan 2017 03:51:45 +0000 (16:51 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 9 Feb 2017 02:17:16 +0000 (03:17 +0100)
commit8368e06ff65cc70e1cf13a0eb4349033e068fcc6
treeb77de59163c35a71e52648092b4b04fabd8d554b
parent538bbd5e9c492f606215ae55e44aa4bdc22f8a9f
samba_dsdb: Use and maintain compatibleFeatures and requiredFeatures in @SAMBA_DSDB

This will allow us to introduce new database features that are
backward compatible from the point of view of older versions of Samba,
but which will be damaged by modifying the database with such a
version.

For example, if linked attributes are stored in sorted order in 4.7,
and this change, without any values in current_supportedFeatures is
itself included in 4.6, then our sortedLinks are backward compatible
to that release.

That is with 4.6 (including this patch) which doesn't care about
ordering -- but a downgraded 4.7 database used by 4.6 will be broken
when later used with 4.7.  If we add a 'sortedLinks' feature flag in
compatibleFeatures, we can detect that.

This will allow us to determine if the database still contains
unsorted links, as that information allows us to make the code
handling links much more efficient.

We won't add the actual flag until all the code is in place.

Andrew wrote the actual code and Douglas wrote the tests, and they
cross-reviewed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Piar-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest: check for database features flags
source4/dsdb/samdb/ldb_modules/samba_dsdb.c
source4/dsdb/samdb/samdb.h
source4/selftest/tests.py
source4/setup/tests/blackbox_supported_features.sh [new file with mode: 0755]