Fix global ACL cleanup when deleting groups

This PR fixes deleted groups leaving their global ACL file behind.

It removes that file alongside the group's module ACL files. Recreating a group with the same name no longer restores its old global permissions.
This commit is contained in:
Ilia Ross
2026-10-23 20:28:25 +02:00
parent 1cade5b59e
commit ad2a1dc44a

View File

@@ -1183,7 +1183,9 @@ my $lref = &read_file_lines("$config_directory/webmin.groups");
@$lref = grep { !/^([^:]+):/ || $1 ne $groupname } @$lref;
&flush_file_lines();
&unlock_file("$config_directory/webmin.groups");
&unlink_file(map { "$config_directory/$_/$groupname.gacl" } &list_modules());
# Remove global permissions too, so reusing the name cannot revive old ACLs.
&unlink_file(map { "$config_directory/$_/$groupname.gacl" }
("", &list_modules()));
if ($miniserv{'userdb'}) {
# Also delete from group database