- Added code to preserve permissions of invoices folder in the installer.
- Fixed a problem with german umlauts in monitor.
- Added code to update.php and autoupdate.php that checks the mysql root password before the update starts.
- Fixed: FS#1848 - changing password of ssh user >>> rights in webXX are changed
| | |
| | | die("internal error - MYSQL-Root passord not known"); |
| | | } |
| | | |
| | | //** Test mysql root connection |
| | | if(!@mysql_connect($conf["mysql"]["host"],$conf["mysql"]["admin_user"],$conf["mysql"]["admin_password"])) { |
| | | die("internal error - MYSQL-Root passord wrong"); |
| | | } |
| | | |
| | | /* |
| | | * Check all tables |
| | | */ |
| | |
| | | // Edit the file Edit the file /etc/sudoers and comment out the requiregetty line, otherwise the backup function will fail |
| | | replaceLine('/etc/sudoers','Defaults requiretty','#Defaults requiretty',0,0); |
| | | |
| | | if(is_file($install_dir.'/interface/invoices')) { |
| | | chmod($install_dir.'/interface/invoices', 0770); |
| | | chown($install_dir.'/interface/invoices', 'ispconfig'); |
| | | chgrp($install_dir.'/interface/invoices', 'ispconfig'); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | chgrp($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); |
| | | } |
| | | |
| | | if(is_file($install_dir.'/interface/invoices')) { |
| | | chmod($install_dir.'/interface/invoices', 0770); |
| | | chown($install_dir.'/interface/invoices', 'ispconfig'); |
| | | chgrp($install_dir.'/interface/invoices', 'ispconfig'); |
| | | } |
| | | |
| | | // TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing |
| | | // and must be fixed as this will allow the apache user to read the ispconfig files. |
| | | // Later this must run as own apache server or via suexec! |
| | |
| | | exec('chmod 744 /usr/local/bin/run-getmail.sh'); |
| | | } |
| | | |
| | | if(is_file($install_dir.'/interface/invoices')) { |
| | | chmod($install_dir.'/interface/invoices', 0770); |
| | | chown($install_dir.'/interface/invoices', 'ispconfig'); |
| | | chgrp($install_dir.'/interface/invoices', 'ispconfig'); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | copy('tpl/'.$jk_chrootsh.'.master', $config_dir.'/'.$jk_chrootsh); |
| | | } |
| | | |
| | | //* help jailkit fo find its ini files |
| | | if(!is_link('/usr/jk_socketd.ini')) exec('ln -s /etc/jailkit/jk_socketd.ini /usr/jk_socketd.ini'); |
| | | if(!is_link('/usr/jk_init.ini')) exec('ln -s /etc/jailkit/jk_init.ini /usr/jk_init.ini'); |
| | | |
| | | } |
| | | |
| | | public function configure_mailman($status = 'insert') { |
| | |
| | | chown($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); |
| | | chgrp($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); |
| | | |
| | | if(is_file($install_dir.'/interface/invoices')) { |
| | | chmod($install_dir.'/interface/invoices', 0770); |
| | | chown($install_dir.'/interface/invoices', 'ispconfig'); |
| | | chgrp($install_dir.'/interface/invoices', 'ispconfig'); |
| | | } |
| | | |
| | | } |
| | | |
| | | public function install_crontab() { |
| | |
| | | $clientdb_user = ''; |
| | | $clientdb_password = ''; |
| | | |
| | | //** Ask user for mysql admin_password if empty |
| | | if( empty($conf["mysql"]["admin_password"]) ) { |
| | | |
| | | //** Test mysql root connection |
| | | $finished = false; |
| | | do { |
| | | if(@mysql_connect($conf["mysql"]["host"],$conf["mysql"]["admin_user"],$conf["mysql"]["admin_password"])) { |
| | | $finished = true; |
| | | } else { |
| | | swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error()); |
| | | $conf["mysql"]["admin_password"] = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']); |
| | | } |
| | | } while ($finished == false); |
| | | unset($finished); |
| | | |
| | | /* |
| | | * Prepare the dump of the database |
| | |
| | | } |
| | | else { |
| | | $data = unserialize($record['data']); |
| | | $html .= nl2br($data['output']); |
| | | $html .= nl2br(html_entity_decode($data['output'])); |
| | | } |
| | | $html .= '</div></div>'; |
| | | } else { |
| | |
| | | |
| | | if($this->action == 'insert' || $data["new"]["system_user"] != $data["old"]["system_user"]) { |
| | | // Chown and chmod the directories below the document root |
| | | $this->_exec('chown -R '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'])); |
| | | $this->_exec('chown -R '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root']).'/web'); |
| | | // The document root itself has to be owned by root in normal level and by the web owner in security level 20 |
| | | if($web_config['security_level'] == 20) { |
| | | $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root'])); |
| | | $this->_exec('chown '.$username.':'.$groupname.' '.escapeshellcmd($data['new']['document_root']).'/web'); |
| | | } else { |
| | | $this->_exec('chown root:root '.escapeshellcmd($data['new']['document_root'])); |
| | | $this->_exec('chown root:root '.escapeshellcmd($data['new']['document_root']).'/web'); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //* If the security level is set to high |
| | | if($this->action == 'insert' && $data['new']['type'] == 'vhost') { |
| | | if($web_config['security_level'] == 20) { |
| | | |
| | | $this->_exec('chmod 751 '.escapeshellcmd($data['new']['document_root'])); |
| | |
| | | // make temp directory writable for Apache and the website users |
| | | $this->_exec('chmod 777 '.escapeshellcmd($data['new']['document_root'].'/tmp')); |
| | | } |
| | | } |
| | | |
| | | // Change the ownership of the error log to the owner of the website |
| | | if(!@is_file($data['new']['document_root'].'/log/error.log')) exec('touch '.escapeshellcmd($data['new']['document_root']).'/log/error.log'); |
| | |
| | | if (!file_exists($sshkeys)){ |
| | | // add root's key |
| | | $app->file->mkdirs($sshdir, '0755'); |
| | | file_put_contents($sshkeys, file_get_contents('/root/.ssh/authorized_keys')); |
| | | if(is_file('/root/.ssh/authorized_keys')) file_put_contents($sshkeys, file_get_contents('/root/.ssh/authorized_keys')); |
| | | |
| | | // Remove duplicate keys |
| | | $existing_keys = file($sshkeys); |
| | |
| | | if (!file_exists($sshkeys)){ |
| | | // add root's key |
| | | $app->file->mkdirs($sshdir, '0755'); |
| | | file_put_contents($sshkeys, file_get_contents('/root/.ssh/authorized_keys')); |
| | | if(is_file('/root/.ssh/authorized_keys')) file_put_contents($sshkeys, file_get_contents('/root/.ssh/authorized_keys')); |
| | | |
| | | // Remove duplicate keys |
| | | $existing_keys = file($sshkeys); |
| | |
| | | $this->app->log("ssh-rsa key updated in ".$sshkeys,LOGLEVEL_DEBUG); |
| | | } |
| | | // set proper file permissions |
| | | exec("chown -R ".escapeshellcmd($this->data['new']['puser']).":".escapeshellcmd($this->data['new']['pgroup'])." ".$usrdir); |
| | | // exec("chown -R ".escapeshellcmd($this->data['new']['puser']).":".escapeshellcmd($this->data['new']['pgroup'])." ".$usrdir); |
| | | exec("chmod 600 '$sshkeys'"); |
| | | |
| | | } |
| | |
| | | chown root:root $CHROOT_HOMEDIR |
| | | |
| | | ## Initialize the chroot into the specified directory with the specified applications |
| | | jk_init -f -k -j $CHROOT_HOMEDIR $CHROOT_APP_SECTIONS |
| | | jk_init -f -k -c /etc/jailkit/jk_init.ini -j $CHROOT_HOMEDIR $CHROOT_APP_SECTIONS |
| | | |
| | | ## Create the temp directory |
| | | if [ ! -d "$CHROOT_HOMEDIR/tmp" ] |