The Samba-Bugzilla – Attachment 12290 Details for
Bug 10882
samba_upgradedns with BIND9_DLZ doesn't recreate dns-hostname account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Delete secrets.ldb record if there's no account in sam.ldb
dns.patch (text/plain), 1.66 KB, created by
Garming Sam
on 2016-07-26 09:21:03 UTC
(
hide
)
Description:
Delete secrets.ldb record if there's no account in sam.ldb
Filename:
MIME Type:
Creator:
Garming Sam
Created:
2016-07-26 09:21:03 UTC
Size:
1.66 KB
patch
obsolete
>From 9a48bb657fbe90aadef8fad64bc3f7ea640252ef Mon Sep 17 00:00:00 2001 >From: Garming Sam <garming@samba.org> >Date: Tue, 26 Jul 2016 11:13:56 +0200 >Subject: [PATCH] samba_upgradedns: Check for both accounts in BIND_DLZ upgrade > >Signed-off-by: Garming Sam <garming@samba.org> >--- > source4/scripting/bin/samba_upgradedns | 12 ++++++++---- > 1 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/source4/scripting/bin/samba_upgradedns b/source4/scripting/bin/samba_upgradedns >index 5963712..d00b67d 100755 >--- a/source4/scripting/bin/samba_upgradedns >+++ b/source4/scripting/bin/samba_upgradedns >@@ -413,13 +413,17 @@ if __name__ == '__main__': > if opts.dns_backend == "BIND9_DLZ": > # Check if dns-HOSTNAME account exists and create it if required > secrets_msgs = ldbs.secrets.search(expression='(samAccountName=dns-%s)' % hostname, attrs=['secret']) >- if len(secrets_msgs) == 0: >+ msg = ldbs.sam.search(base=domaindn, scope=ldb.SCOPE_DEFAULT, >+ expression='(sAMAccountName=dns-%s)' % (hostname), >+ attrs=[]) > >+ if len(secrets_msgs) == 0 or len(msg) == 0: > logger.info("Adding dns-%s account" % hostname) > >- msg = ldbs.sam.search(base=domaindn, scope=ldb.SCOPE_DEFAULT, >- expression='(sAMAccountName=dns-%s)' % (hostname), >- attrs=[]) >+ if len(secrets_msgs) == 1: >+ dn = secrets_msgs[0].dn >+ ldbs.secrets.delete(dn) >+ > if len(msg) == 1: > dn = msg[0].dn > ldbs.sam.delete(dn) >-- >1.7.0.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10882
: 12290 |
12451
|
12699