[Pkg-nagios-changes] [SCM] Debian packaging of icinga-web branch, master, updated. debian/1.8.0-1-6-g0866d89
Markus Frosch
markus at lazyfrosch.de
Mon Nov 12 22:45:41 UTC 2012
The following commit has been merged in the master branch:
commit aede6fbceee25a6b9a4b2c8f32de9250fa48931c
Author: Markus Frosch <markus at lazyfrosch.de>
Date: Mon Nov 12 23:33:53 2012 +0100
changed root password update
the password now will only be set after it
has been changed via dpkg-reconfigure
Git-Dch: long
diff --git a/debian/icinga-web.config b/debian/icinga-web.config
index d160d5a..28d9847 100644
--- a/debian/icinga-web.config
+++ b/debian/icinga-web.config
@@ -58,7 +58,14 @@ db_go || true
# only when dbconfig-common is used...
###
db_get icinga-web/dbconfig-install || true
-if [ "$RET" = "true" ]; then
+dbconfig_there="$RET"
+db_fget icinga-web/rootpassword seen || true
+rootpassword_seen="$RET"
+if [ "$1" = "reconfigure" ]; then
+ rootpassword_seen=false
+fi
+
+if [ "$dbconfig_there" = "true" ] && [ "$rootpassword_seen" != "true" ]; then
passwordsmatch=no
while [ "$passwordsmatch" != "yes" ]; do
# enter password
@@ -72,6 +79,7 @@ if [ "$RET" = "true" ]; then
p2="$RET"
if [ "$p1" = "$p2" ]; then
passwordsmatch="yes"
+ db_set icinga-web/rootpassword_changed true
else
db_fset icinga-web/rootpassword seen false
db_fset icinga-web/rootpassword-repeat seen false
diff --git a/debian/icinga-web.postinst b/debian/icinga-web.postinst
index 3b55a97..b3170b5 100644
--- a/debian/icinga-web.postinst
+++ b/debian/icinga-web.postinst
@@ -140,6 +140,8 @@ setpassword() {
if dbc_mysql_exec_command "$query"; then
echo "root password updates successfully!"
+ db_set icinga-web/rootpassword_changed false || true
+ db_go || true
else
echo "setting root password failed: $dbc_error" >&2
fi
@@ -152,6 +154,8 @@ setpassword() {
if _dbc_pgsql_exec_command "$query"; then
echo "root password updates successfully!"
+ db_set icinga-web/rootpassword_changed false || true
+ db_go || true
else
echo "setting root password failed: $dbc_error" >&2
fi
@@ -160,15 +164,22 @@ setpassword() {
fi
}
-db_get icinga-web/rootpassword || true
-password="$RET"
+###
+# root password for Icinga Web
+###
+
db_get icinga-web/dbconfig-install || true
-dbinstall="$RET"
-if [ "$dbinstall" = "true" ]; then
- if [ "$password" != "" ]; then
- setpassword $password
+if [ "$RET" = "true" ]; then
+ db_get icinga-web/rootpassword_changed || true
+ if [ "$RET" = "true" ]; then
+ db_get icinga-web/rootpassword || true
+ if [ "$RET" != "" ]; then
+ setpassword $RET
+ else
+ echo "no password configured - root password for Icinga Web will not be set!"
+ fi
else
- echo "no password configured - root password for Icinga Web will not be set!"
+ echo "root password has not been changed."
fi
fi
diff --git a/debian/icinga-web.templates b/debian/icinga-web.templates
index 16b9c57..28652fe 100644
--- a/debian/icinga-web.templates
+++ b/debian/icinga-web.templates
@@ -40,3 +40,6 @@ Type: error
_Description: Password input error
The two passwords you entered were not the same. Please try again.
+Template: icinga-web/rootpassword_changed
+Type: boolean
+
--
Debian packaging of icinga-web
More information about the Pkg-nagios-changes
mailing list