Till Brehm
2014-09-24 6d6643de2b6fc47b15e27c46266f22866c1cd1a8
server/lib/classes/system.inc.php
@@ -1722,7 +1722,7 @@
   function getinitcommand($servicename, $action, $init_script_directory = ''){
      global $conf;
      // systemd
      if(is_executable('/bin/systemd')){
      if(is_executable('/bin/systemd') || is_executable('/usr/bin/systemctl')){
         return 'systemctl '.$action.' '.$servicename.'.service';
      }
      // upstart
@@ -1824,7 +1824,7 @@
      $name_blacklist = array('root','ispconfig','vmail','getmail');
      if(in_array($username,$name_blacklist)) return false;
      
      if(preg_match('/^[\w\.\-]{0,32}$/', $username) == false) return false;
      if(preg_match('/^[a-zA-Z0-9\.\-_]{1,32}$/', $username) == false) return false;
      
      if($check_id && intval($this->getuid($username)) < $this->min_uid) return false;
      
@@ -1833,15 +1833,15 @@
      return true;
   }
   
   public function is_allowed_group($groupname, $restrict_names = false) {
   public function is_allowed_group($groupname, $check_id = true, $restrict_names = false) {
      global $app;
      
      $name_blacklist = array('root','ispconfig','vmail','getmail');
      if(in_array($groupname,$name_blacklist)) return false;
      
      if(preg_match('/^[\w\.\-]{0,32}$/', $groupname) == false) return false;
      if(preg_match('/^[a-zA-Z0-9\.\-_]{1,32}$/', $groupname) == false) return false;
      
      if(intval($this->getgid($groupname)) < $this->min_gid) return false;
      if($check_id && intval($this->getgid($groupname)) < $this->min_gid) return false;
      
      if($restrict_names == true && preg_match('/^client\d+$/', $groupname) == false) return false;