mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Disallow backslash in passwords https://virtualmin.com/node/44451
This commit is contained in:
@@ -299,6 +299,7 @@ user_priv_create_tablespace=Create Tablespace
|
||||
user_err=Failed to save user
|
||||
user_euser=Missing or invalid username
|
||||
user_ehost=Missing or invalid allow host(s)
|
||||
user_eslash=MySQL does not support a password containing a backslash
|
||||
user_ssl=Required certificate type
|
||||
user_cipher=SSL cipher
|
||||
user_ssl_=None
|
||||
|
||||
@@ -9,6 +9,7 @@ $access{'perms'} == 1 || &error($text{'perms_ecannot'});
|
||||
# Validate inputs
|
||||
$in{'newpass1'} || &error($text{'root_epass1'});
|
||||
$in{'newpass1'} eq $in{'newpass2'} || &error($text{'root_epass2'});
|
||||
$in{'newpass1'} =~ /\\/ && &error($text{'user_eslash'});
|
||||
|
||||
# Update MySQL
|
||||
$esc = &escapestr($in{'newpass1'});
|
||||
|
||||
@@ -19,6 +19,9 @@ else {
|
||||
&error($text{'user_euser'});
|
||||
$in{'host_def'} || $in{'host'} =~ /^\S+$/ ||
|
||||
&error($text{'user_ehost'});
|
||||
if ($in{'mysqlpass_mode'} == 0 && $in{'mysqlpas'} =~ /\\/) {
|
||||
&error($text{'user_eslash'});
|
||||
}
|
||||
|
||||
%perms = map { $_, 1 } split(/\0/, $in{'perms'});
|
||||
@desc = &table_structure($master_db, 'user');
|
||||
|
||||
Reference in New Issue
Block a user