summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAaron Haslett <aaronhaslett@catalyst.net.nz>2019-07-22 15:29:03 +1200
committerKarolin Seeger <kseeger@samba.org>2019-08-26 07:06:18 +0000
commitbe508cda25d97b825fef3d605938faa3726cde44 (patch)
tree0ef06140aa0f629d386e6c94dc001c56b69bcd22 /source4
parentd18896d19988b1096849c00a80dda42a727d5c4c (diff)
downloadsamba-be508cda25d97b825fef3d605938faa3726cde44.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> (cherry picked from commit c4aebb15001c830a46d5a6ad8ea11a6f9ea4fd04)
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/scripting/bin/sambadowngradedatabase26
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":