Skip to content

Commit a047c97

Browse files
committed
As passwordless MariaDB root account is not enabled all debconf lines
regarding asking and setting passwords could be removed.
1 parent a4b4c95 commit a047c97

File tree

4 files changed

+6
-58
lines changed

4 files changed

+6
-58
lines changed

debian/changelog

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
mariadb-10.0 (10.0.16-1~exp3) experimental; urgency=low
22

33
* Update the mail.ssl test to match new cacert.pem
4+
* Stop asking and setting a database root user password. Instead enable
5+
the auth_socket plugin and let unix user root access MariaDB without
6+
a separate password. Admins using sudo or cron scripts can use the
7+
same access too, and there is no debian-sys-maint password either anymore.
48

59
-- Otto Kekäläinen <[email protected]> Fri, 30 Jan 2015 18:52:55 +0200
610

debian/mariadb-server-10.0.config

-31
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,3 @@ if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
1212
db_input high mariadb-server-10.0/nis_warning || true
1313
db_go
1414
fi
15-
16-
# Only ask this question on fresh installs or during "reconfiguration".
17-
# There is also an additional check for empty root passwords in the
18-
# postinst script.
19-
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
20-
while :; do
21-
RET=""
22-
db_input high mariadb-server/root_password || true
23-
db_go
24-
db_get mariadb-server/root_password
25-
# if password isn't empty we ask for password verification
26-
if [ -z "$RET" ]; then
27-
db_fset mariadb-server/root_password seen false
28-
db_fset mariadb-server/root_password_again seen false
29-
break
30-
fi
31-
ROOT_PW="$RET"
32-
db_input high mariadb-server/root_password_again || true
33-
db_go
34-
db_get mariadb-server/root_password_again
35-
if [ "$RET" == "$ROOT_PW" ]; then
36-
ROOT_PW=''
37-
break
38-
fi
39-
db_fset mariadb-server/password_mismatch seen false
40-
db_input critical mariadb-server/password_mismatch
41-
db_set mariadb-server/root_password ""
42-
db_set mariadb-server/root_password_again ""
43-
db_go
44-
done
45-
fi

debian/mariadb-server-10.0.postinst

+2-9
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ test_passwordless_root_login() {
2929

3030
# call with $1 = "online" to connect to the server, otherwise it bootstraps
3131
set_mysql_rootpw() {
32-
# forget we ever saw the password. don't use reset to keep the seen status
33-
db_set mariadb-server/root_password ""
3432

3533
tfile=`mktemp`
3634
if [ ! -f "$tfile" ]; then
@@ -178,12 +176,11 @@ case "$1" in
178176
echo "$install_plugins" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
179177
set -e
180178
# overly complicated here but ensures a plugin unix_socket is installed and is idpotent if already installed
181-
echo "SET sql_log_bin=0; USE mysql; DELIMITER //; CREATE PROCEDURE debian_plugin_install(IN plugin_name CHAR(50), IN soname CHAR(50)) BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND EXECUTE
182-
inst_plug; set @plugin_name=plugin_name; set @soname=soname ;set @install_plugin=CONCAT(\"INSTALL PLUGIN \",@plugin_name,\" SONAME '\", @soname, \"'\");PREPARE inst_plug FROM @install_plugin ;
179+
echo "SET sql_log_bin=0; USE mysql; DELIMITER //; CREATE PROCEDURE debian_plugin_install(IN plugin_name CHAR(50), IN soname CHAR(50)) BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND EXECUTE
180+
inst_plug; set @plugin_name=plugin_name; set @soname=soname ;set @install_plugin=CONCAT(\"INSTALL PLUGIN \",@plugin_name,\" SONAME '\", @soname, \"'\");PREPARE inst_plug FROM @install_plugin ;
183181
select PLUGIN_NAME INTO @a from information_schema.plugins where PLUGIN_NAME=@plugin_name AND PLUGIN_STATUS='ACTIVE' AND PLUGIN_TYPE='AUTHENTICATION' AND PLUGIN_LIBRARY LIKE concat(@soname,'%'
184182
); DEALLOCATE PREPARE inst_plug; END// CALL debian_plugin_install('unix_socket', 'auth_socket') // DROP PROCEDURE debian_plugin_install//" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
185183

186-
db_get mariadb-server/root_password && rootpw="$RET"
187184
if ! set_mysql_rootpw; then
188185
password_error="yes"
189186
# restore old config file if exists
@@ -212,10 +209,6 @@ esac
212209
# fails for any other reason, nothing happens.
213210
if [ "$1" = "configure" ]; then
214211
if test_passwordless_root_login; then
215-
db_input medium mariadb-server/root_password || true
216-
db_go
217-
db_get mariadb-server/root_password && rootpw="$RET"
218-
219212
if ! set_mysql_rootpw "online"; then
220213
password_error="yes"
221214
fi

debian/mariadb-server-10.0.templates

-18
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ _Description: Remove all MariaDB databases?
4444
recent version or if a different mariadb-server package is already
4545
using it, the data should be kept.
4646

47-
Template: mariadb-server/root_password
48-
Type: password
49-
_Description: New password for the MariaDB "root" user:
50-
While not mandatory, it is highly recommended that you set a password
51-
for the MariaDB administrative "root" user.
52-
.
53-
If this field is left blank, the password will not be changed.
54-
55-
Template: mariadb-server/root_password_again
56-
Type: password
57-
_Description: Repeat password for the MariaDB "root" user:
58-
5947
Template: mariadb-server/error_setting_password
6048
Type: error
6149
_Description: Unable to set password for the MariaDB "root" user
@@ -69,11 +57,6 @@ _Description: Unable to set password for the MariaDB "root" user
6957
Please read the /usr/share/doc/mariadb-server-10.0/README.Debian file
7058
for more information.
7159

72-
Template: mariadb-server/password_mismatch
73-
Type: error
74-
_Description: Password input error
75-
The two passwords you entered were not the same. Please try again.
76-
7760
Template: mariadb-server/oneway_migration
7861
Type: boolean
7962
Default: true
@@ -84,4 +67,3 @@ _Description: Really migrate to MariaDB?
8467
Note that MariaDB has some enhanced features, which do not exist in MySQL
8568
and thus migration back to MySQL might not always work, at least not as
8669
automatically as migrating from MySQL to MariaDB.
87-

0 commit comments

Comments
 (0)