View | Details | Raw Unified | Return to bug 45090 | Differences between
and this patch

Collapse All | Expand All

(-)a/services/univention-bind/debian/changelog (+6 lines)
 Lines 1-3    Link Here 
1
univention-bind (11.0.1-2) unstable; urgency=low
2
3
  * Bug #45090: Fix password change mechanism with LDAP backend
4
5
 -- Philipp Hahn <hahn@univention.de>  Fri, 28 Jul 2017 10:56:49 +0200
6
1
univention-bind (11.0.1-1) unstable; urgency=medium
7
univention-bind (11.0.1-1) unstable; urgency=medium
2
8
3
  * Execute univention-fix-ucr-dns in univention-bind postinst only if
9
  * Execute univention-fix-ucr-dns in univention-bind postinst only if
(-)a/services/univention-bind/usr/lib/univention-server/server_password_change.d/univention-bind (-32 / +3 lines)
 Lines 36-74   if [ -n "$bind_bindpw" -a "$bind_bindpw" != "/etc/machine.secret" ]; then Link Here 
36
	exit 0
36
	exit 0
37
fi
37
fi
38
38
39
bind_service () {
40
	local action="$1"
41
42
	# start / stop bind9 only if the ldap backend is configured
43
	if [ "$dns_backend" = "ldap" ]; then
44
		if [ "$action" = "start" ]; then
45
			# start bind9 only if it has been stopped by this script
46
			if [ "$dns_bind9_stoppedbyserverpasswordchange" = "yes" ] ; then
47
				echo "starting bind9 after server password change" | logger -t "server-password-change"
48
				invoke-rc.d bind9 start >/dev/null
49
				univention-config-registry unset dns/bind9/stoppedbyserverpasswordchange >/dev/null
50
			fi
51
		fi
52
		if [ "$action" = "stop" ]; then
53
			if invoke-rc.d bind9 status | grep -q "is running" ; then
54
				univention-config-registry set dns/bind9/stoppedbyserverpasswordchange=yes >/dev/null
55
				echo "stopping bind9 due to upcoming server password change" | logger -t "server-password-change"
56
				invoke-rc.d bind9 stop >/dev/null
57
			fi
58
		fi
59
	fi
60
}
61
62
if [ "$1" = "prechange" ] ; then
63
	bind_service stop
64
fi
65
66
if [ "$1" = "nochange" ] ; then
67
	bind_service start
68
fi
69
70
if [ "$1" = "postchange" ] ; then
39
if [ "$1" = "postchange" ] ; then
71
	# update zone files
40
	# update zone files
72
	sed -i "s|\!x-bindpw=\(.*\),x-tls|\!x-bindpw=$(cat /etc/machine.secret),x-tls|" /etc/bind/univention.conf.d/*
41
	sed -i "s|\!x-bindpw=\(.*\),x-tls|\!x-bindpw=$(cat /etc/machine.secret),x-tls|" /etc/bind/univention.conf.d/*
73
	bind_service start
42
	# Reload or restart LDAP-BIND (if running)
43
	[ "$dns_backend" = "ldap" ] &&
44
		systemctl reload-or-try-restart bind9.service
74
fi
45
fi
(-)a/test/ucs-test/debian/changelog (+6 lines)
 Lines 1-3    Link Here 
1
ucs-test (7.0.23-11) unstable; urgency=low
2
3
  * Bug #45090: Fix password change mechanism with LDAP backend
4
5
 -- Philipp Hahn <hahn@univention.de>  Fri, 28 Jul 2017 11:19:04 +0200
6
1
ucs-test (7.0.23-10) unstable; urgency=medium
7
ucs-test (7.0.23-10) unstable; urgency=medium
2
8
3
  * Bug #45087: 52_s4connector/139sync_repeated_ntsd_modifications
9
  * Bug #45087: 52_s4connector/139sync_repeated_ntsd_modifications
(-)a/test/ucs-test/tests/01_base/02server_password_change_ldap-bind (-1 / +29 lines)
Line 0    Link Here 
0
- 
1
#!/usr/share/ucs-test/runner bash
2
## desc: Change the server password and check LDAP-BIND
3
## bugs: [45090]
4
## roles-not: [basesystem]
5
## tags:
6
##  - SKIP-UCSSCHOOL
7
##  - basic
8
##  - apptest
9
## packages:
10
##  - univention-bind
11
## exposure: dangerous
12
## join: true
13
14
. "$TESTLIBPATH/base.sh" || exit 137
15
. "$TESTLIBPATH/ucr.sh" || exit 137
16
17
# Only with LDAP-BIND
18
case "$dns_backend" in
19
ldap) ;;
20
*) exit 77
21
esac
22
# Only when BIND is running/used
23
systemctl is-active bind9.service || exit 77
24
25
trap ucr_restore EXIT
26
ucr set server/password/interval=0
27
set -e -x
28
/usr/lib/univention-server/server_password_change
29
dig @127.0.0.1 -p 7777 "$DOMAIN" soa

Return to bug 45090