View | Details | Raw Unified | Return to bug 46842
Collapse All | Expand All

(-)a/management/univention-directory-manager-modules/univention-dnsedit (-1 / +1 lines)
 Lines 102-108   def parse(): Link Here 
102
	if options.bindpwdfile:
102
	if options.bindpwdfile:
103
		options.bindpwd = open(options.bindpwdfile).read().strip()
103
		options.bindpwd = open(options.bindpwdfile).read().strip()
104
	if options.binddn and not options.bindpwd:
104
	if options.binddn and not options.bindpwd:
105
		msg = 'authentication error: missing --bindpwd'
105
		msg = 'authentication error: missing any of --bindpwdfile or --bindpwd'
106
	elif not options.binddn and options.bindpwd:
106
	elif not options.binddn and options.bindpwd:
107
		msg = 'authentication error: missing --binddn'
107
		msg = 'authentication error: missing --binddn'
108
	if msg:
108
	if msg:
(-)a/management/univention-join/joinscripthelper.lib (-19 / +12 lines)
 Lines 294-314   joinscript_log_error() { Link Here 
294
	done
294
	done
295
}
295
}
296
296
297
# 1 binddn, 2 bindpwdfile, create join credential files /var/univention-join/binddn and /var/univention-join/bindpwd
297
# 1 binddn, 2 bindpwdfile, create join credential files /var/run/univention-join/binddn and /var/run/univention-join/bindpwd
298
joinscript_create_credentialfiles () {
298
joinscript_create_credentialfiles () {
299
	mkdir -p /var/univention-join
299
	mkdir -p /var/run/univention-join
300
	touch /var/univention-join/binddn
300
	chmod 700 /var/run/univention-join
301
	chmod 600 /var/univention-join/binddn
301
	touch /var/run/univention-join/binddn
302
	echo "$1" > /var/univention-join/binddn
302
	chmod 600 /var/run/univention-join/binddn
303
	touch /var/univention-join/bindpwd
303
	echo "$1" > /var/run/univention-join/binddn
304
	chmod 600 /var/univention-join/bindpwd
304
	touch /var/run/univention-join/bindpwd
305
	cp "$2" /var/univention-join/bindpwd
305
	chmod 600 /var/run/univention-join/bindpwd
306
	cp "$2" /var/run/univention-join/bindpwd
306
}
307
}
307
308
308
# remove join credential files
309
# remove join credential files
309
joinscript_remove_credentialfiles () {
310
joinscript_remove_credentialfiles () {
310
	test -e /var/univention-join/bindpwd && rm /var/univention-join/bindpwd
311
	rm -f /var/run/univention-join/bindpwd \
311
	test -e /var/univention-join/binddn && rm /var/univention-join/binddn
312
		/var/run/univention-join/binddn
312
}
313
}
313
314
314
# join script can be called with --bindpwdfile
315
# join script can be called with --bindpwdfile
 Lines 319-325   joinscript_check_api_bindpwdfile () { Link Here 
319
	return 1
320
	return 1
320
}
321
}
321
322
322
# join script does not need domain credentials at all
323
# join script does not require domain credentials to be passed
323
joinscript_check_api_nocredentials () {
324
joinscript_check_api_nocredentials () {
324
	if grep -q '^## joinscript api: nocredentials$' "$1"; then
325
	if grep -q '^## joinscript api: nocredentials$' "$1"; then
325
		return 0
326
		return 0
 Lines 327-338   joinscript_check_api_nocredentials () { Link Here 
327
	return 1
328
	return 1
328
}
329
}
329
330
330
# join script gets credentials from /var/univention-join/binddn and /var/univention-join/bindpwd by itself
331
joinscript_check_api_credentialfiles () {
332
	if grep -q '^## joinscript api: credentialfiles$' "$1"; then
333
		return 0
334
	fi
335
	return 1
336
}
337
338
# vim:set ft=sh:
331
# vim:set ft=sh:
(-)a/management/univention-join/univention-join (-1 / +2 lines)
 Lines 191-196   run_join_scripts () { Link Here 
191
191
192
	LC_COLLATE="C"
192
	LC_COLLATE="C"
193
	joinscript_check_status_file
193
	joinscript_check_status_file
194
	trap "rm -f '$DCPWD' /var/run/univention-join/binddn /var/run/univention-join/bindpwd" EXIT
194
	joinscript_create_credentialfiles "$binddn" "$DCPWD"
195
	joinscript_create_credentialfiles "$binddn" "$DCPWD"
195
196
196
	if test -d "/usr/lib/univention-install/"; then
197
	if test -d "/usr/lib/univention-install/"; then
 Lines 207-213   run_join_scripts () { Link Here 
207
			local args=()
208
			local args=()
208
			if joinscript_check_api_bindpwdfile "$i"; then
209
			if joinscript_check_api_bindpwdfile "$i"; then
209
				args=(--binddn "$binddn" --bindpwdfile "$DCPWD")
210
				args=(--binddn "$binddn" --bindpwdfile "$DCPWD")
210
			elif joinscript_check_api_nocredentials "$i" || joinscript_check_api_credentialfiles "$i"; then
211
			elif joinscript_check_api_nocredentials "$i"; then
211
				args=()
212
				args=()
212
			else
213
			else
213
				args=(--binddn "$binddn" --bindpwd "$(<"$DCPWD")")
214
				args=(--binddn "$binddn" --bindpwd "$(<"$DCPWD")")
(-)a/management/univention-join/univention-run-join-scripts (-2 / +2 lines)
 Lines 143-149   if [ ! "$server_role" = "domaincontroller_master" ] || [ -n "$ASK_PASS" ] ; then Link Here 
143
		echo -n "Enter DC Master Password: "
143
		echo -n "Enter DC Master Password: "
144
		read -s password
144
		read -s password
145
		DCPWD=$(mktemp)
145
		DCPWD=$(mktemp)
146
		trap "rm -f '$DCPWD'" EXIT
146
		trap "rm -f '$DCPWD' /var/run/univention-join/binddn /var/run/univention-join/bindpwd" EXIT
147
		echo -n "$password" >>"$DCPWD"
147
		echo -n "$password" >>"$DCPWD"
148
		echo ""
148
		echo ""
149
		echo ""
149
		echo ""
 Lines 246-252   then Link Here 
246
			args=()
246
			args=()
247
			if joinscript_check_api_bindpwdfile "$i"; then
247
			if joinscript_check_api_bindpwdfile "$i"; then
248
				args=(--binddn "$binddn" --bindpwdfile "$DCPWD")
248
				args=(--binddn "$binddn" --bindpwdfile "$DCPWD")
249
			elif joinscript_check_api_nocredentials "$i" || joinscript_check_api_credentialfiles "$i"; then
249
			elif joinscript_check_api_nocredentials "$i"; then
250
				args=()
250
				args=()
251
			else
251
			else
252
				args=(--binddn "$binddn" --bindpwd "$(<"$DCPWD")")
252
				args=(--binddn "$binddn" --bindpwd "$(<"$DCPWD")")

Return to bug 46842