[Pkg-nagios-changes] [SCM] Debian packaging for Nagios3 branch, master, updated. debian/3.4.1-4-4-g3431b7a
Alexander Wirt
formorer at debian.org
Sun Jul 21 10:07:51 UTC 2013
The following commit has been merged in the master branch:
commit 6abb3024080949b854fae90dfe0dd1b0449028ca
Author: Alexander Wirt <formorer at debian.org>
Date: Sun Jul 21 11:48:07 2013 +0200
Cleanup password handling
diff --git a/debian/nagios3-cgi.config b/debian/nagios3-cgi.config
index 3df26ed..20b0102 100644
--- a/debian/nagios3-cgi.config
+++ b/debian/nagios3-cgi.config
@@ -2,67 +2,32 @@
. /usr/share/debconf/confmodule
-# (taken from the webapps-common httpd functions)
-# wc_httpd_installed: test for installed httpds
-# usage:
-# wc_httpd_installed [ httpd1 httpd2 ... ]
-#
-# no arguments implies to test for all servers
-wc_httpd_installed(){
- local httpds
- if [ "$*" ]; then
- httpds=$*
- else
- httpds=$wc_httpd_supported
- fi
- for f in $httpds; do
- if test -x /usr/sbin/$f; then
- echo $f
- fi
- done
-}
-
+db_fget nagios3/adminpassword seen || true
+password_seen="$RET"
-# list of installed servers to check for
-default_servers=`wc_httpd_installed apache2 apache apache-ssl apache-perl`
-# convert list to comma seperated list
-server_list=`echo $default_servers | sed -e 's/[[:space:]][[:space:]]*/, /g'`
-
-# if they haven't already been prompted, preseed the server selection
-db_fget nagios3/httpd seen
-if [ "$RET" = "false" ]; then
- db_set nagios3/httpd $server_list
+if [ "$1" = "reconfigure" ]; then
+ password_seen=false
fi
-db_input medium nagios3/httpd || true
-db_go || true
-db_get nagios3/httpd
-keepgoing="$RET"
-
-if [ "$keepgoing" ]; then
- db_input medium nagios3/nagios1-in-apacheconf || true
-
- # the passwords are reset at the end of every postinst run,
- # however, they are left in the "seen" state so that the
- # admin is not prompted for them at every upgrade.
- while [ ! "$passwordsmatch" ]; do
- #only ask for a password if no htpasswd exists
- test -f /etc/nagios3/htpasswd.users && break
- db_input high nagios3/adminpassword || true
- db_input high nagios3/adminpassword-repeat || true
- db_go || true
- db_get nagios3/adminpassword
- p1="$RET"
- db_get nagios3/adminpassword-repeat
- p2="$RET"
- if [ "$p1" = "$p2" ]; then
- passwordsmatch="yes"
- else
- db_fset nagios3/adminpassword seen false
- db_fset nagios3/adminpassword-repeat seen false
- db_fset nagios3/adminpassword-mismatch seen false
- db_input critical nagios3/adminpassword-mismatch || true
- fi
- done
+if [ "$rootpassword_seen" != "true" ]; then
+ while [ ! "$passwordsmatch" ]; do
+ #only ask for a password if no htpasswd exists
+ test -f /etc/nagios3/htpasswd.users && break
+ db_input high nagios3/adminpassword || true
+ db_input high nagios3/adminpassword-repeat || true
+ db_go || true
+ db_get nagios3/adminpassword
+ p1="$RET"
+ db_get nagios3/adminpassword-repeat
+ p2="$RET"
+ if [ "$p1" = "$p2" ]; then
+ passwordsmatch="yes"
+ else
+ db_fset nagios3/adminpassword seen false
+ db_fset nagios3/adminpassword-repeat seen false
+ db_fset nagios3/adminpassword-mismatch seen false
+ db_input critical nagios3/adminpassword-mismatch || true
+ fi
+ done
fi
db_go || true
--
Debian packaging for Nagios3
More information about the Pkg-nagios-changes
mailing list