Skip to content

HuskHomes create tables on different database #843

@tagoh

Description

@tagoh

I have a setup of Fabric server 1.21.4 with HuskSync (HuskSync-Fabric-3.8.4+mc.1.21.4.jar). It apparently works as expected such as:

mysql> show databases;
+---------------------+
| Database            |
+---------------------+
| information_schema  |
| minecraft_husksync  |
| minecraft_luckperms |
| mysql               |
| performance_schema  |
| sys                 |
+---------------------+
6 rows in set (0.00 sec)
mysql> use minecraft_husksync;
Database changed
mysql> show tables;
+------------------------------+
| Tables_in_minecraft_husksync |
+------------------------------+
| husksync_map_data            |
| husksync_map_ids             |
| husksync_user_data           |
| husksync_users               |
+------------------------------+
4 rows in set (0.00 sec)

But copying HuskHomes-Fabric-4.9.6+mc.1.21.4.jar into mods folder and restart the server, template name of tables was created into this database even though I modified config.yml for HuskHomes with different database and different user and different password.

mysql> show databases;
+---------------------+
| Database            |
+---------------------+
| information_schema  |
| minecraft_huskhomes |
| minecraft_husksync  |
| minecraft_luckperms |
| mysql               |
| performance_schema  |
| sys                 |
+---------------------+
7 rows in set (0.00 sec)
mysql> use minecraft_huskhomes;
Database changed
mysql> show tables;
+-------------------------------+
| Tables_in_minecraft_huskhomes |
+-------------------------------+
| huskhomes_homes               |
| huskhomes_metadata            |
| huskhomes_position_data       |
| huskhomes_saved_positions     |
| huskhomes_teleports           |
| huskhomes_user_cooldowns      |
| huskhomes_users               |
| huskhomes_warps               |
+-------------------------------+
8 rows in set (0.00 sec)
mysql> use minecraft_husksync;
Database changed
mysql> show tables;
+------------------------------+
| Tables_in_minecraft_husksync |
+------------------------------+
| %home_data%                  |
| %meta_data%                  |
| %player_cooldowns_data%      |
| %player_data%                |
| %position_data%              |
| %saved_position_data%        |
| %teleport_data%              |
| %warp_data%                  |
| husksync_map_data            |
| husksync_map_ids             |
| husksync_user_data           |
| husksync_users               |
+------------------------------+
12 rows in set (0.00 sec)
$ grep -E 'database:\s+[[:alpha:]]+' config/huskhomes/config.yml
    database: minecraft_huskhomes
$ grep -E 'database:\s+[[:alpha:]]+' config/husksync/config.yml
    database: minecraft_husksync

I have a security concern on this behavior why they share a config no matter what is the expected result. In fact, a user of HuskHomes doesn't have rights to access a database for HuskSync:

$ mysql -h localhost -u username_for_HuskHomes -p password
...
mysql> show databases;
+---------------------+
| Database            |
+---------------------+
| information_schema  |
| minecraft_huskhomes |
| performance_schema  |
+---------------------+
3 rows in set (0.00 sec)
mysql> use minecraft_husksync;
ERROR 1044 (42000): Access denied for user 'username_for_HuskHomes'@'localhost' to database 'minecraft_husksync'

and vice versa:

$ mysql -h localhost -u username_for_HuskSync -p password
...
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| minecraft_husksync |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
mysql> use minecraft_huskhomes;
ERROR 1044 (42000): Access denied for user 'username_for_HuskSync'@'localhost' to database 'minecraft_huskhomes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions