@@ -1821,7 +1821,11 @@ public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'a
18211821 public function is_allowed_user ($ username , $ check_id = true , $ restrict_names = false ) {
18221822 global $ app ;
18231823
1824- if ($ username == 'root ' ) return false ;
1824+ $ name_blacklist = array ('root ' ,'ispconfig ' ,'vmail ' ,'getmail ' );
1825+ if (in_array ($ username ,$ name_blacklist )) return false ;
1826+
1827+ if (preg_match ('/^[\w\.\-]{0,32}$/ ' , $ username ) == false ) return false ;
1828+
18251829 if ($ check_id && intval ($ this ->getuid ($ username )) < $ this ->min_uid ) return false ;
18261830
18271831 if ($ restrict_names == true && preg_match ('/^web\d+$/ ' , $ username ) == false ) return false ;
@@ -1832,7 +1836,11 @@ public function is_allowed_user($username, $check_id = true, $restrict_names = f
18321836 public function is_allowed_group ($ groupname , $ restrict_names = false ) {
18331837 global $ app ;
18341838
1835- if ($ groupname == 'root ' ) return false ;
1839+ $ name_blacklist = array ('root ' ,'ispconfig ' ,'vmail ' ,'getmail ' );
1840+ if (in_array ($ groupname ,$ name_blacklist )) return false ;
1841+
1842+ if (preg_match ('/^[\w\.\-]{0,32}$/ ' , $ groupname ) == false ) return false ;
1843+
18361844 if (intval ($ this ->getgid ($ groupname )) < $ this ->min_gid ) return false ;
18371845
18381846 if ($ restrict_names == true && preg_match ('/^client\d+$/ ' , $ groupname ) == false ) return false ;
0 commit comments