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

(-)a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py (-1 / +7 lines)
 Lines 358-365   def run_scripts( progressParser, restartServer = False ): Link Here 
358
	subprocess.call( CMD_DISABLE_EXEC, stdout = f, stderr = f )
358
	subprocess.call( CMD_DISABLE_EXEC, stdout = f, stderr = f )
359
359
360
	for scriptpath in sorted_files_in_subdirs( PATH_SETUP_SCRIPTS ):
360
	for scriptpath in sorted_files_in_subdirs( PATH_SETUP_SCRIPTS ):
361
		try:
361
			# launch script
362
			# launch script
362
			MODULE.info('Running script %s\n' % scriptpath)
363
			MODULE.info('Running script %s\n' % scriptpath)
364
			f.write('Running script %s\n' % (scriptpath,))
363
			p = subprocess.Popen( scriptpath, stdout = subprocess.PIPE, stderr = subprocess.STDOUT )
365
			p = subprocess.Popen( scriptpath, stdout = subprocess.PIPE, stderr = subprocess.STDOUT )
364
			while True:
366
			while True:
365
				line = p.stdout.readline()
367
				line = p.stdout.readline()
 Lines 367-373   def run_scripts( progressParser, restartServer = False ): Link Here 
367
					break
369
					break
368
				progressParser.parse( line )
370
				progressParser.parse( line )
369
				f.write( line )
371
				f.write( line )
370
			p.wait()
372
			rv = p.wait()
373
			f.write('Finished script %s: %d\n' % (scriptpath, rv))
374
		except Exception as ex:
375
			f.write('Exception script %s: %s\n' % (scriptpath, ex))
376
			raise
371
377
372
	# enable execution of servers again
378
	# enable execution of servers again
373
	subprocess.call(CMD_ENABLE_EXEC, stdout=f, stderr=f)
379
	subprocess.call(CMD_ENABLE_EXEC, stdout=f, stderr=f)
(-)a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/usr/lib/univention-system-setup/scripts/40_ssl/10ssl (-26 / +18 lines)
 Lines 30-41    Link Here 
30
# /usr/share/common-licenses/AGPL-3; if not, see
30
# /usr/share/common-licenses/AGPL-3; if not, see
31
# <http://www.gnu.org/licenses/>.
31
# <http://www.gnu.org/licenses/>.
32
32
33
force_recreate=0
33
recreate=false
34
34
35
while [ "$#" -gt 0 ]; do
35
while [ "$#" -gt 0 ]; do
36
	case $1 in
36
	case "$1" in
37
		--force-recreate)
37
		--force-recreate)
38
			force_recreate=1
38
			recreate=true
39
			shift 1
39
			shift 1
40
			;;
40
			;;
41
		*)
41
		*)
 Lines 69-80   for var in "common" "locality" "organization" "country" "state" "organizationalu Link Here 
69
	new="new_ssl_$var"
69
	new="new_ssl_$var"
70
70
71
	if [ -n "${!new}" -a "${!old}" != "${!new}" ]; then
71
	if [ -n "${!new}" -a "${!old}" != "${!new}" ]; then
72
		recreate="yes"
72
		recreate=true
73
		break
73
		break
74
	fi
74
	fi
75
done
75
done
76
76
77
if [ "$recreate" = "yes" -o "$force_recreate" = "1" ]; then
77
if "$recreate"
78
then
78
	# remove old backup
79
	# remove old backup
79
	if [ -d /etc/univention/ssl.orig ]; then
80
	if [ -d /etc/univention/ssl.orig ]; then
80
		rm -rf /etc/univention/ssl.orig
81
		rm -rf /etc/univention/ssl.orig
 Lines 90-124   if [ "$recreate" = "yes" -o "$force_recreate" = "1" ]; then Link Here 
90
91
91
	# set UCR variables
92
	# set UCR variables
92
	for var in "common" "locality" "organization" "country" "state" "organizationalunit" "email"; do
93
	for var in "common" "locality" "organization" "country" "state" "organizationalunit" "email"; do
93
		old="ssl_$var"
94
		new="new_ssl_$var"
94
		new="new_ssl_$var"
95
		if [ -n "${!new}" ]; then
95
		if [ -n "${!new}" ]; then
96
			univention-config-registry set "${old/_//}=${!new}"
96
			echo "ssl/$var=${!new}"
97
		fi
97
		fi
98
	done
98
	done | xargs -r -d'\n' univention-config-registry set
99
99
100
	# create new CA und certificates
100
	# create new CA und certificates
101
	. /usr/share/univention-ssl/make-certificates.sh
101
	. /usr/share/univention-ssl/make-certificates.sh
102
	init
102
	init
103
	(
103
	(
104
		cd /etc/univention/ssl.orig
104
		cd /etc/univention/ssl.orig
105
		for fqdn in *; do
105
		for fqdn in *.*
106
		do
106
			# just check directories for certificates
107
			# just check directories for certificates
107
			if [ ! -d "$fqdn" ]; then
108
			[ -d "$fqdn" ] || continue
108
				continue
109
			fi
110
			# ignore ucsCA and directory not containing a dot
111
			if [ "$fqdn" = "ucsCA" ] || ! echo "$fqdn" | grep '\.' &>/dev/null; then
112
				continue
113
			fi
114
			# if there is no certificate, ignore it
109
			# if there is no certificate, ignore it
115
			if [ ! -e "$fqdn/cert.pem" ]; then
110
			[ -e "$fqdn/cert.pem" ] || continue
116
				continue
111
			univention-certificate new -name "$fqdn"
112
			if [ "$fqdn" -ne "${fqdn%.$domainname}" ]
113
			then
114
				ln -sf "$fqdn" "/etc/univention/ssl/${fqdn%%.*}"
117
			fi
115
			fi
118
			# get the hostname
119
			host=$(echo $fqdn | sed 's/\([^.]*\)\..*/\1/')
120
			univention-certificate new -name $fqdn
121
			ln -sf /etc/univention/ssl/$host.$domainname /etc/univention/ssl/$host
122
		done
116
		done
123
	)
117
	)
124
118
 Lines 126-140   if [ "$recreate" = "yes" -o "$force_recreate" = "1" ]; then Link Here 
126
	for file in cert.pem private.key; do
120
	for file in cert.pem private.key; do
127
		if [ -e "/var/lib/cyrus/$file" ]
121
		if [ -e "/var/lib/cyrus/$file" ]
128
		then
122
		then
129
			cp /etc/univention/ssl/$hostname.$domainname/$file /var/lib/cyrus/$file
123
			install -o cyrus -m 600 "/etc/univention/ssl/$hostname.$domainname/$file" "/var/lib/cyrus/$file"
130
			chown cyrus /var/lib/cyrus/$file
131
			chmod 600 /var/lib/cyrus/$file
132
		fi
124
		fi
133
	done
125
	done
134
126
135
	# restart services
127
	# restart services
136
	for service in slapd apache2 cyrus postfix; do
128
	for service in slapd apache2 cyrus postfix; do
137
		invoke-rc.d --quiet $service restart
129
		invoke-rc.d --quiet "$service" restart
138
	done
130
	done
139
fi
131
fi
140
132
(-)a/branches/ucs-3.2/ucs-3.2-0/base/univention-server/debian/univention-server-master.preinst (-1 / +1 lines)
 Lines 47-53   if [ -n "$hostname" -a -n "$domainname" ]; then Link Here 
47
	if ! test -e /etc/univention/ssl/$hostname/cert.pem; then
47
	if ! test -e /etc/univention/ssl/$hostname/cert.pem; then
48
		. /usr/share/univention-ssl/make-certificates.sh
48
		. /usr/share/univention-ssl/make-certificates.sh
49
		gencert "$hostname.$domainname" "$hostname.$domainname"
49
		gencert "$hostname.$domainname" "$hostname.$domainname"
50
		ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
50
		ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
51
	fi
51
	fi
52
fi
52
fi
53
53
(-)a/branches/ucs-3.2/ucs-3.2-0/base/univention-ssl/debian/univention-ssl.postinst (-2 / +2 lines)
 Lines 77-83   if [ "$server_role" = "domaincontroller_master" ] || [ -z "$server_role" ] || [ Link Here 
77
		. /usr/share/univention-ssl/make-certificates.sh
77
		. /usr/share/univention-ssl/make-certificates.sh
78
		init
78
		init
79
		univention-certificate new -name "$hostname.$domainname"
79
		univention-certificate new -name "$hostname.$domainname"
80
		ln -sf "/etc/univention/ssl/$hostname.$domainname" "/etc/univention/ssl/$hostname"
80
		ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
81
	else
81
	else
82
		echo "skipped. SSL Certificate found in $CERTPATH"
82
		echo "skipped. SSL Certificate found in $CERTPATH"
83
	fi
83
	fi
 Lines 91-97   if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 1.3; then Link Here 
91
fi
91
fi
92
92
93
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
93
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
94
	ln -sf "/etc/univention/ssl/$hostname.$domainname" "/etc/univention/ssl/$hostname"
94
	ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
95
fi
95
fi
96
96
97
# update to 3.1
97
# update to 3.1
(-)a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/usr/lib/univention-system-setup/scripts/10_basis/10hostname (-3 / +3 lines)
 Lines 258-266   if [ "$server_role" != "basesystem" ]; then Link Here 
258
258
259
		if [ -d /etc/cups/ssl ]; then
259
		if [ -d /etc/cups/ssl ]; then
260
			rm -f /etc/cups/ssl/server.crt
260
			rm -f /etc/cups/ssl/server.crt
261
			ln -s /etc/univention/ssl/$new_hostname.$domainname/cert.pem /etc/cups/ssl/server.crt
261
			ln -s "/etc/univention/ssl/$new_hostname.$domainname/cert.pem" /etc/cups/ssl/server.crt
262
			rm -f /etc/cups/ssl/server.key
262
			rm -f /etc/cups/ssl/server.key
263
			ln -s /etc/univention/ssl/$new_hostname.$domainname/private.key /etc/cups/ssl/server.key
263
			ln -s "/etc/univention/ssl/$new_hostname.$domainname/private.key" /etc/cups/ssl/server.key
264
		fi
264
		fi
265
	fi
265
	fi
266
266
 Lines 268-274   if [ "$server_role" != "basesystem" ]; then Link Here 
268
	echo `date` : "Create new host certificate"  >> /var/log/univention/setup.log
268
	echo `date` : "Create new host certificate"  >> /var/log/univention/setup.log
269
269
270
	rm -f /etc/univention/ssl/$new_hostname
270
	rm -f /etc/univention/ssl/$new_hostname
271
	ln -sf /etc/univention/ssl/$new_hostname.$domainname /etc/univention/ssl/$new_hostname
271
	ln -sf "$new_hostname.$domainname" /etc/univention/ssl/$new_hostname
272
272
273
273
274
	if [ -d "/var/lib/cyrus/" ]; then
274
	if [ -d "/var/lib/cyrus/" ]; then
(-)a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/usr/lib/univention-system-setup/scripts/10_basis/12domainname (-2 / +2 lines)
 Lines 207-213   if [ "$server_role" = "domaincontroller_master" ]; then # create the new certif Link Here 
207
	rm -rf /etc/univention/ssl/univention-directory-manager.$old_domainname
207
	rm -rf /etc/univention/ssl/univention-directory-manager.$old_domainname
208
	univention-certificate new -name "univention-directory-manager.$new_domainname"
208
	univention-certificate new -name "univention-directory-manager.$new_domainname"
209
	rm -f /etc/univention/ssl/univention-directory-manager
209
	rm -f /etc/univention/ssl/univention-directory-manager
210
	ln -sf /etc/univention/ssl/univention-directory-manager.$new_domainname /etc/univention/ssl/univention-directory-manager
210
	ln -sf "univention-directory-manager.$new_domainname" /etc/univention/ssl/univention-directory-manager
211
elif [ "$server_role" != "basesystem" ]; then # download certificate from master
211
elif [ "$server_role" != "basesystem" ]; then # download certificate from master
212
	if [ -x "/usr/sbin/univention-scp" ]; then
212
	if [ -x "/usr/sbin/univention-scp" ]; then
213
		echo `date` : "Download host certificate"  >> /var/log/univention/setup.log
213
		echo `date` : "Download host certificate"  >> /var/log/univention/setup.log
 Lines 232-238   fi Link Here 
232
232
233
if [ "$server_role" != "basesystem" ]; then
233
if [ "$server_role" != "basesystem" ]; then
234
	rm -f /etc/univention/ssl/$hostname
234
	rm -f /etc/univention/ssl/$hostname
235
	ln -sf /etc/univention/ssl/$hostname.$new_domainname /etc/univention/ssl/$hostname
235
	ln -sf "$hostname.$new_domainname" "/etc/univention/ssl/$hostname"
236
236
237
	if [ -d "/etc/univention/ssl/$hostname.$new_domainname" ]; then
237
	if [ -d "/etc/univention/ssl/$hostname.$new_domainname" ]; then
238
		echo `date` : "Include new host certificate for Cyrus"  >> /var/log/univention/setup.log
238
		echo `date` : "Include new host certificate for Cyrus"  >> /var/log/univention/setup.log
(-)a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/usr/lib/univention-system-setup/scripts/setup-join.sh (-1 / +1 lines)
 Lines 151-157   if [ "$server_role" = "domaincontroller_master" ]; then Link Here 
151
fi
151
fi
152
152
153
univention-certificate new -name "$hostname.$domainname"
153
univention-certificate new -name "$hostname.$domainname"
154
ln -sf "/etc/univention/ssl/$hostname.$domainname" "/etc/univention/ssl/$hostname"
154
ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
155
155
156
run-parts /usr/lib/univention-system-setup/scripts/45_modules/
156
run-parts /usr/lib/univention-system-setup/scripts/45_modules/
157
157
(-)a/branches/ucs-3.2/ucs-3.2-0/packaging/ucslint/testframework/0010-2-3-4-5/debian/postinst (-5 / +5 lines)
 Lines 77-88   if [ "$server_role" = "domaincontroller_master" ] || [ -z "$server_role" ] || [ Link Here 
77
		# Bug #13549
77
		# Bug #13549
78
		rdate time.fu-berlin.de || rdate 130.133.1.10 || true
78
		rdate time.fu-berlin.de || rdate 130.133.1.10 || true
79
79
80
		. /usr/share/univention-ssl/make-certificates.sh;
80
		. /usr/share/univention-ssl/make-certificates.sh
81
		init;
81
		init
82
		univention-certificate new -name $hostname.$domainname
82
		univention-certificate new -name $hostname.$domainname
83
		ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
83
		ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
84
	else
84
	else
85
		echo "skipped. SSL Certificate found in $CERTPATH ";
85
		echo "skipped. SSL Certificate found in $CERTPATH "
86
	fi
86
	fi
87
fi
87
fi
88
88
 Lines 94-100   if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 1.3; then Link Here 
94
fi
94
fi
95
95
96
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
96
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
97
	ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
97
	ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
98
fi
98
fi
99
99
100
if [ "$1" = "$configure" -a -z "$2" ]; then
100
if [ "$1" = "$configure" -a -z "$2" ]; then
(-)a/branches/ucs-3.2/ucs-3.2-0/packaging/ucslint/testframework/0011-2-3-4-5-6-7-8/debian/postinst (-2 / +2 lines)
 Lines 78-84   if [ "$server_role" = "domaincontroller_master" ] || [ -z "$server_role" ] || [ Link Here 
78
		. /usr/share/univention-ssl/make-certificates.sh;
78
		. /usr/share/univention-ssl/make-certificates.sh;
79
		init;
79
		init;
80
		univention-certificate new -name $hostname.$domainname
80
		univention-certificate new -name $hostname.$domainname
81
		ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
81
		ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
82
	else
82
	else
83
		echo "skipped. SSL Certificate found in $CERTPATH ";
83
		echo "skipped. SSL Certificate found in $CERTPATH ";
84
	fi
84
	fi
 Lines 92-98   if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 1.3; then Link Here 
92
fi
92
fi
93
93
94
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
94
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
95
	ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
95
	ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
96
fi
96
fi
97
97
98
if [ "$1" = "$configure" -a -z "$2" ]; then
98
if [ "$1" = "$configure" -a -z "$2" ]; then
(-)a/branches/ucs-3.2/ucs-3.2-0/packaging/ucslint/testframework/0013-2/debian/postinst (-2 / +2 lines)
 Lines 78-84   if [ "$server_role" = "domaincontroller_master" ] || [ -z "$server_role" ] || [ Link Here 
78
		. /usr/share/univention-ssl/make-certificates.sh;
78
		. /usr/share/univention-ssl/make-certificates.sh;
79
		init;
79
		init;
80
		univention-certificate new -name $hostname.$domainname
80
		univention-certificate new -name $hostname.$domainname
81
		ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
81
		ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
82
	else
82
	else
83
		echo "skipped. SSL Certificate found in $CERTPATH ";
83
		echo "skipped. SSL Certificate found in $CERTPATH ";
84
	fi
84
	fi
 Lines 92-98   if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 1.3; then Link Here 
92
fi
92
fi
93
93
94
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
94
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
95
	ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
95
	ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
96
fi
96
fi
97
97
98
if [ "$1" = "$configure" -a -z "$2" ]; then
98
if [ "$1" = "$configure" -a -z "$2" ]; then
(-)a/branches/ucs-3.2/ucs-3.2-0/packaging/ucslint/testframework/0015-2/debian/postinst (-2 / +2 lines)
 Lines 78-84   if [ "$server_role" = "domaincontroller_master" ] || [ -z "$server_role" ] || [ Link Here 
78
		. /usr/share/univention-ssl/make-certificates.sh;
78
		. /usr/share/univention-ssl/make-certificates.sh;
79
		init;
79
		init;
80
		univention-certificate new -name $hostname.$domainname
80
		univention-certificate new -name $hostname.$domainname
81
		ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
81
		ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
82
	else
82
	else
83
		echo "skipped. SSL Certificate found in $CERTPATH ";
83
		echo "skipped. SSL Certificate found in $CERTPATH ";
84
	fi
84
	fi
 Lines 92-98   if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 1.3; then Link Here 
92
fi
92
fi
93
93
94
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
94
if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.3-1; then
95
	ln -sf /etc/univention/ssl/$hostname.$domainname /etc/univention/ssl/$hostname
95
	ln -sf "$hostname.$domainname" "/etc/univention/ssl/$hostname"
96
fi
96
fi
97
97
98
if [ "$1" = "$configure" -a -z "$2" ]; then
98
if [ "$1" = "$configure" -a -z "$2" ]; then

Return to bug 34106