2011-07-13 04:50:24 +04:00
#!/bin/sh
if [ $# -lt 1 ] ; then
cat <<EOF
Usage: dbcheck.sh PREFIX
EOF
exit 1;
fi
PREFIX = " $1 "
shift 1
2016-07-13 04:30:35 +03:00
ARGS = $@
2011-07-13 04:50:24 +04:00
. ` dirname $0 ` /subunit.sh
dbcheck( ) {
2016-07-13 04:30:35 +03:00
$BINDIR /samba-tool dbcheck --cross-ncs $ARGS
2011-07-13 04:50:24 +04:00
}
2016-07-12 00:54:14 +03:00
# This list of attributes can be freely extended
dbcheck_fix_one_way_links( ) {
2016-07-13 04:30:35 +03:00
$BINDIR /samba-tool dbcheck --quiet --fix --yes fix_all_string_dn_component_mismatch --attrs= "lastKnownParent defaultObjectCategory fromServer rIDSetReferences" --cross-ncs $ARGS
2016-07-12 00:54:14 +03:00
}
2016-07-14 01:36:38 +03:00
# This list of attributes can be freely extended
dbcheck_fix_stale_links( ) {
2016-07-21 06:34:13 +03:00
$BINDIR /samba-tool dbcheck --quiet --fix --yes remove_plausible_deleted_DN_links --attrs= "member msDS-NC-Replica-Locations msDS-NC-RO-Replica-Locations" --cross-ncs $ARGS
2016-07-14 01:36:38 +03:00
}
2013-03-22 10:12:43 +04:00
# This test shows that this does not do anything to a current
# provision (that would be a bug)
dbcheck_reset_well_known_acls( ) {
2016-07-13 04:30:35 +03:00
$BINDIR /samba-tool dbcheck --cross-ncs --reset-well-known-acls $ARGS
2013-03-22 10:12:43 +04:00
}
2011-07-13 11:26:59 +04:00
reindex( ) {
2016-07-13 04:30:35 +03:00
$BINDIR /samba-tool dbcheck --reindex $ARGS
2011-07-13 11:26:59 +04:00
}
2014-02-27 06:17:35 +04:00
fixed_attrs( ) {
2016-07-13 04:30:35 +03:00
$BINDIR /samba-tool dbcheck --attrs= cn $ARGS
2014-02-27 06:17:35 +04:00
}
2012-08-23 09:18:13 +04:00
force_modules( ) {
2016-07-13 04:30:35 +03:00
$BINDIR /samba-tool dbcheck --force-modules $ARGS
2012-08-23 09:18:13 +04:00
}
2016-07-12 00:54:14 +03:00
dbcheck_fix_one_way_links
2016-07-14 01:36:38 +03:00
dbcheck_fix_stale_links
2011-07-13 04:50:24 +04:00
testit "dbcheck" dbcheck
2011-07-13 11:26:59 +04:00
testit "reindex" reindex
2014-02-27 06:17:35 +04:00
testit "fixed_attrs" fixed_attrs
2012-08-23 09:18:13 +04:00
testit "force_modules" force_modules
2011-07-13 04:50:24 +04:00
exit $failed