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

Collapse All | Expand All

(-)a/base/univention-server/server_password_change (-2 / +2 lines)
 Lines 196-202   run-parts --verbose --arg localchange --regex '^univention-samba4' -- /usr/lib/u Link Here 
196
# if samba-tool user setpassword fails, reset the old password.
196
# if samba-tool user setpassword fails, reset the old password.
197
if [ $? != 0 ]; then
197
if [ $? != 0 ]; then
198
	revert_password_change
198
	revert_password_change
199
	FAIL "resetting old server password for $ldap_hostdn, because samba could not set the new password locally."
199
	FAIL "Failed to set new password in samba, machine password set back to old password for $ldap_hostdn."
200
fi
200
fi
201
201
202
# The password is changed on the master now, but it is not clear if
202
# The password is changed on the master now, but it is not clear if
 Lines 218-224   do Link Here 
218
		# changes that would only worsen the situation. Instead, try to rollback.
218
		# changes that would only worsen the situation. Instead, try to rollback.
219
		# Reset the old password with UDM and give up.
219
		# Reset the old password with UDM and give up.
220
		revert_password_change
220
		revert_password_change
221
		FAIL "resetting old server password for $ldap_hostdn, because access to local LDAP did not work with the new password"
221
		FAIL "Access to local LDAP did not work with the new password, machine password set back to old password for $ldap_hostdn."
222
	fi
222
	fi
223
	trial_counter=$(( trial_counter - 1))
223
	trial_counter=$(( trial_counter - 1))
224
done
224
done
(-)a/services/univention-samba4/server_password_change.d/univention-samba4 (+3 lines)
 Lines 50-55   set_machine_secret() { Link Here 
50
	-
50
	-
51
	%EOF
51
	%EOF
52
	if [ "$?" -ne "0" ]; then
52
	if [ "$?" -ne "0" ]; then
53
		echo "ERROR: Storing new password in samba secrets.ldb failed."
53
		install -m 0600 /etc/krb5.keytab.SAVE /etc/krb5.keytab
54
		install -m 0600 /etc/krb5.keytab.SAVE /etc/krb5.keytab
54
		exit 1
55
		exit 1
55
	fi
56
	fi
 Lines 63-68   if [ "$1" = "localchange" ]; then Link Here 
63
64
64
	## if samba-tool user setpassword fails, revert changes to secrets.ldb and krb5.keytab
65
	## if samba-tool user setpassword fails, revert changes to secrets.ldb and krb5.keytab
65
	if [ "$?" -ne "0" ]; then
66
	if [ "$?" -ne "0" ]; then
67
		echo "ERROR: Changing machine password in Samba failed."
68
		echo "INFO: Restoring secrets.ldb and krb5.keytab."
66
		old_password=$(tail -n 1 /etc/machine.secret.old | sed -n 's/^[0-9]*: //p')
69
		old_password=$(tail -n 1 /etc/machine.secret.old | sed -n 's/^[0-9]*: //p')
67
		ldbmodify -H /var/lib/samba/private/secrets.ldb <<-%EOF
70
		ldbmodify -H /var/lib/samba/private/secrets.ldb <<-%EOF
68
		dn: flatname=${windows_domain},cn=Primary Domains
71
		dn: flatname=${windows_domain},cn=Primary Domains

Return to bug 49193