mirror of
https://github.com/webmin/webmin.git
synced 2026-09-20 04:20:39 +01:00
Extra protection against creating a user called 'webmin' https://www.virtualmin.com/node/65058
This commit is contained in:
@@ -362,6 +362,7 @@ sub create_user
|
||||
my ($user, $clone) = @_;
|
||||
my %miniserv;
|
||||
my @mods = &list_modules();
|
||||
$user->{'name'} eq "webmin" && &error("Invalid username webmin for new user");
|
||||
|
||||
&get_miniserv_config(\%miniserv);
|
||||
|
||||
@@ -530,6 +531,8 @@ sub modify_user
|
||||
my ($username, $user) = @_;
|
||||
my (%miniserv, @pwfile, @acl, @mods, $m);
|
||||
&get_miniserv_config(\%miniserv);
|
||||
$user->{'name'} eq "webmin" &&
|
||||
&error("Invalid username webmin for modified user");
|
||||
|
||||
if ($user->{'proto'}) {
|
||||
# In users and groups DB
|
||||
|
||||
@@ -4134,6 +4134,7 @@ sub save_module_acl
|
||||
{
|
||||
my $u = defined($_[1]) ? $_[1] : $base_remote_user;
|
||||
my $m = defined($_[2]) ? $_[2] : &get_module_name();
|
||||
$u eq "webmin" && &error("Invalid username webmin for ACL");
|
||||
if (!$_[3] && &foreign_check("acl")) {
|
||||
# Check if this user is a member of a group, and if he gets the
|
||||
# module from a group. If so, update its ACL as well
|
||||
|
||||
Reference in New Issue
Block a user