virtualmin / virtualmin-gpl

Virtualmin web hosting control panel for Webmin
https://www.virtualmin.com
GNU General Public License v3.0
331 stars 102 forks source link

Database names start with a " " blank #460

Open ghost235 opened 2 years ago

ghost235 commented 2 years ago
SYSTEM INFORMATION
OS type and version Debian Linux 9
Webmin version 2.000
Usermin version 1.860
Virtualmin version 7.1-1 Pro
Cloudmin version 9.6 Pro
Theme version 20.00
Package updates 3 package updates are available

Hi,

I've the issue that new databases are createt with a leeding blan from the script installers.

grafik

If I want to create a DB manual I got.

Failed to create database : Missing or invalid database name - only letters, numbers and _ are allowed

The server tamplate looks like this.

grafik

Missed I something? Where can I look/ edit this?

iliajie commented 2 years ago

Hello,

Do you expect leading space work with a database name?

ghost235 commented 2 years ago

Hi, it is working for the configs (Wordpress,Nextcloud) with arounding ‘‘. For mysqldump it won’t work. Also mysql> use „ database“ give me an error. edit: assigning to a „virtual server“ don‘t work too.

iliajie commented 2 years ago

Also mysql> use „ database“ give me an error.

Try using tildas ` to quote your database name, i.e. ` database`.

ghost235 commented 2 years ago

Is might work for this. Maybe also mysqldump will work with it. But assigning to a domain/virtualserver wouldn’t work.

iliajie commented 2 years ago

We don't expect it to work.

chris001 commented 2 years ago

On the server template, do you have a space in front of the "Default database name" or "Prefix for additional databases", like ${DOM} ?

ghost235 commented 2 years ago

On the server template, do you have a space in front of the "Default database name" or "Prefix for additional databases", like ${DOM} ?

No.

ghost235 commented 2 years ago

Can I check the ${DOM} from console?

marclaporte commented 1 year ago

On the server template, do you have a space in front of the "Default database name" or "Prefix for additional databases", like ${DOM} ?

No.

It sure looks like you have a space: Screenshot_20230813-164909

marclaporte commented 1 year ago

Indirectly related: It's not rare to get support requests that originate from an extra space in a copy-paste.

Here are related fixes/discussions to add a warning:

One of our junior devs is exploring Virtualmin and will attempt to generate a merge request for this. Even if it's not accepted, it's a good way to learn Virtualmin and we'll put it in WikiSuite (which uses Virtualmin)

jcameron commented 1 year ago

Yes, please send a PR to precent spaces at the start or end of usernames..

iliajie commented 1 year ago

If the data passed through the field doesn't support trailing and/or leading spaces it should be trimmed on the server side upon submit.

So, if we don't really want that trailing space to be there — it has to be simply truncated upon submit.

It was also a similar issue on Webmin login page, with usernames in the past.

jcameron commented 1 year ago

That would also work!

marclaporte commented 1 year ago

Ok, our junior dev will explore the various places where this could happen and prepare a proposal.