diff options
author | Aaron Haslett <aaronhaslett@catalyst.net.nz> | 2019-07-22 15:29:03 +1200 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2019-08-20 03:40:28 +0000 |
commit | c4aebb15001c830a46d5a6ad8ea11a6f9ea4fd04 (patch) | |
tree | aaf9b1a24c270759cd9b8dcd95679ee3274b9cd6 /source4/scripting | |
parent | 8a05d2b074d588a481aa372f2923f55cfb3e3a23 (diff) | |
download | samba-c4aebb15001c830a46d5a6ad8ea11a6f9ea4fd04.tar.gz |
downgradedatabase: comply with samba.tests.source
In next commit we'll install the script, samba.tests.source picked up the
lack of a copyright message and some whitespace errors, so this patch
fixes that stuff first.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/scripting')
-rwxr-xr-x | source4/scripting/bin/sambadowngradedatabase | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/source4/scripting/bin/sambadowngradedatabase b/source4/scripting/bin/sambadowngradedatabase index 9d1e2b8cc76..87a989bfd6a 100755 --- a/source4/scripting/bin/sambadowngradedatabase +++ b/source4/scripting/bin/sambadowngradedatabase @@ -1,4 +1,24 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 +# +# Unix SMB/CIFS implementation. +# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2019 +# +# Downgrade a database from 4.11 format to 4.7 format. 4.7 Format will +# run on any version of Samba AD, and Samba will repack/reconfigure the +# database if necessary. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. from __future__ import print_function import optparse import sys @@ -38,9 +58,9 @@ samdb = ldb.Ldb(url=url, options=["modules:"]) partitions = samdb.search(base="@PARTITION", - scope=ldb.SCOPE_BASE, + scope=ldb.SCOPE_BASE, attrs=["backendStore", "partition"]) - + backend = str(partitions[0].get('backendStore', 'tdb')) if backend == "mdb": |