mirror of
https://github.com/samba-team/samba.git
synced 2025-07-15 16:59:09 +03:00
Fix templates.ldb reprovision handling.
This sets the attributes in a seperate transaction, and allows a
forced delete of the whole file.
Andrew Bartlett
(This used to be commit 423db2468b
)
This commit is contained in:
@ -617,7 +617,17 @@ def setup_templatesdb(path, setup_path, session_info, credentials, lp):
|
||||
"""
|
||||
templates_ldb = SamDB(path, session_info=session_info,
|
||||
credentials=credentials, lp=lp)
|
||||
templates_ldb.erase()
|
||||
# Wipes the database
|
||||
try:
|
||||
templates_ldb.erase()
|
||||
except:
|
||||
os.unlink(path)
|
||||
|
||||
templates_ldb.load_ldif_file_add(setup_path("provision_templates_init.ldif"))
|
||||
|
||||
templates_ldb = SamDB(path, session_info=session_info,
|
||||
credentials=credentials, lp=lp)
|
||||
|
||||
templates_ldb.load_ldif_file_add(setup_path("provision_templates.ldif"))
|
||||
|
||||
|
||||
|
@ -2,16 +2,6 @@
|
||||
# Templates to be put in templates.ldb. Not part of main samdb any more.
|
||||
###
|
||||
|
||||
dn: @OPTIONS
|
||||
checkBaseOnSearch: TRUE
|
||||
|
||||
dn: @INDEXLIST
|
||||
@IDXATTR: cn
|
||||
|
||||
dn: @ATTRIBUTES
|
||||
cn: CASE_INSENSITIVE
|
||||
dn: CASE_INSENSITIVE
|
||||
|
||||
dn: CN=Templates
|
||||
objectClass: top
|
||||
objectClass: container
|
||||
|
10
source4/setup/provision_templates_init.ldif
Normal file
10
source4/setup/provision_templates_init.ldif
Normal file
@ -0,0 +1,10 @@
|
||||
dn: @OPTIONS
|
||||
checkBaseOnSearch: TRUE
|
||||
|
||||
dn: @INDEXLIST
|
||||
@IDXATTR: cn
|
||||
|
||||
dn: @ATTRIBUTES
|
||||
cn: CASE_INSENSITIVE
|
||||
dn: CASE_INSENSITIVE
|
||||
|
Reference in New Issue
Block a user