ftimme
2013-02-19 cc1d576124a8350abfae7787b82f1b565f720e87
- Fixed FS#2655 - usermod fails with "user xyz is currently logged in".
7 files modified
36 ■■■■ changed files
interface/web/login/lib/lang/de.lng 2 ●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 4 ●●●● patch | view | raw | blame | history
server/plugins-available/cron_jailkit_plugin.inc.php 10 ●●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 6 ●●●●● patch | view | raw | blame | history
server/plugins-available/shelluser_base_plugin.inc.php 2 ●●● patch | view | raw | blame | history
server/plugins-available/shelluser_jailkit_plugin.inc.php 8 ●●●● patch | view | raw | blame | history
server/scripts/create_jailkit_user.sh 4 ●●●● patch | view | raw | blame | history
interface/web/login/lib/lang/de.lng
@@ -7,7 +7,7 @@
$wb['pw_reset'] = 'Das Passwort wurde zurückgesetzt und wird per E-Mail an Sie geschickt.';
$wb['pw_error'] = 'Benutzername oder E-Mail Adresse stimmen nicht überein.';
$wb['pw_error_noinput'] = 'Bitte geben Sie Ihre E-Mail Adresse und Ihren Benutzernamen ein.';
$wb['pw_reset_mail_msg'] = 'Das Passwort wurde zurückgesetzt. Das neue Passwort lautet :';
$wb['pw_reset_mail_msg'] = 'Das Passwort wurde zurückgesetzt. Das neue Passwort lautet: ';
$wb['pw_reset_mail_title'] = 'Ihr Passwort wurde zurückgesetzt.';
$wb['user_regex_error'] = 'Benutzername beinhaltet nicht erlaubte Zeichen oder ist länger als 64 Zeichen.';
$wb['pw_error_length'] = 'Die Passwortlänge ist > 64 Zeichen.';
server/plugins-available/apache2_plugin.inc.php
@@ -465,7 +465,7 @@
                $command = 'killall -u '.escapeshellcmd($data['new']['system_user']).' && usermod';
                $command .= ' --home '.escapeshellcmd($data['new']['document_root']);
                $command .= ' --gid '.escapeshellcmd($data['new']['system_group']);
                $command .= ' '.escapeshellcmd($data['new']['system_user']);
                $command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null';
                exec($command);
            }
            
@@ -701,7 +701,7 @@
                if($web_config['add_web_users_to_sshusers_group'] == 'y') {
                    $command = 'usermod';
                    $command .= ' --groups sshusers';
                    $command .= ' '.escapeshellcmd($data['new']['system_user']);
                    $command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null';
                    $this->_exec($command);
                }
server/plugins-available/cron_jailkit_plugin.inc.php
@@ -124,7 +124,7 @@
                
                $this->_add_jailkit_user();
                
                $command .= 'usermod -U '.escapeshellcmd($parent_domain["system_user"]);
                $command .= 'usermod -U '.escapeshellcmd($parent_domain["system_user"]).' 2>/dev/null';
                exec($command);
                
                $this->_update_website_security_level();
@@ -223,7 +223,7 @@
                $command = '/usr/local/ispconfig/server/scripts/create_jailkit_chroot.sh';
                $command .= ' '.escapeshellcmd($this->parent_domain['document_root']);
                $command .= ' \''.$this->jailkit_config['jailkit_chroot_app_sections'].'\'';
                exec($command);
                exec($command.' 2>/dev/null');
                
                $this->app->log("Added jailkit chroot with command: ".$command,LOGLEVEL_DEBUG);
                
@@ -268,14 +268,14 @@
        $command = '/usr/local/ispconfig/server/scripts/create_jailkit_programs.sh';
        $command .= ' '.escapeshellcmd($this->parent_domain['document_root']);
        $command .= ' \''.$this->jailkit_config['jailkit_chroot_app_programs'].'\'';
        exec($command);
        exec($command.' 2>/dev/null');
        
        $this->app->log("Added programs to jailkit chroot with command: ".$command,LOGLEVEL_DEBUG);
        
        $command = '/usr/local/ispconfig/server/scripts/create_jailkit_programs.sh';
        $command .= ' '.escapeshellcmd($this->parent_domain['document_root']);
        $command .= ' \''.$this->jailkit_config['jailkit_chroot_cron_programs'].'\'';
        exec($command);
        exec($command.' 2>/dev/null');
        
        $this->app->log("Added cron programs to jailkit chroot with command: ".$command,LOGLEVEL_DEBUG);
    }
@@ -299,7 +299,7 @@
            $command .= ' '.escapeshellcmd($this->parent_domain['document_root']);
            $command .= ' '.$jailkit_chroot_userhome;
            $command .= ' '.escapeshellcmd("/bin/bash");
            exec($command);
            exec($command.' 2>/dev/null');
                
            $this->app->log("Added jailkit user to chroot with command: ".$command,LOGLEVEL_DEBUG);
                
server/plugins-available/nginx_plugin.inc.php
@@ -469,7 +469,7 @@
                $command = 'killall -u '.escapeshellcmd($data['new']['system_user']).' && usermod';
                $command .= ' --home '.escapeshellcmd($data['new']['document_root']);
                $command .= ' --gid '.escapeshellcmd($data['new']['system_group']);
                $command .= ' '.escapeshellcmd($data['new']['system_user']);
                $command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null';
                exec($command);
            }
@@ -705,7 +705,7 @@
                if($web_config['add_web_users_to_sshusers_group'] == 'y') {
                    $command = 'usermod';
                    $command .= ' --groups sshusers';
                    $command .= ' '.escapeshellcmd($data['new']['system_user']);
                    $command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null';
                    $this->_exec($command);
                }
@@ -1666,8 +1666,6 @@
                        }
                    }
                }
            }
            if(is_array($subdomain_hosts) && !empty($subdomain_hosts)){
                $log_folders = array();
server/plugins-available/shelluser_base_plugin.inc.php
@@ -114,7 +114,7 @@
                
                //* Disable shell user temporarily if we use jailkit
                if($data['new']['chroot'] == 'jailkit') {
                    $command = 'usermod -s /bin/false -L '.escapeshellcmd($data['new']['username']);
                    $command = 'usermod -s /bin/false -L '.escapeshellcmd($data['new']['username']).' 2>/dev/null';
                    exec($command);
                    $app->log("Disabling shelluser temporarily: ".$command,LOGLEVEL_DEBUG);
                }
server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -104,7 +104,7 @@
                $app->system->usermod($data['new']['username'], 0, 0, '', '/usr/sbin/jk_chrootsh', '', '');
                
                //* Unlock user
                $command = 'usermod -U '.escapeshellcmd($data['new']['username']);
                $command = 'usermod -U '.escapeshellcmd($data['new']['username']).' 2>/dev/null';
                exec($command);
                
                $this->_update_website_security_level();
@@ -212,7 +212,7 @@
                $command = '/usr/local/ispconfig/server/scripts/create_jailkit_chroot.sh';
                $command .= ' '.escapeshellcmd($this->data['new']['dir']);
                $command .= ' \''.$this->jailkit_config['jailkit_chroot_app_sections'].'\'';
                exec($command);
                exec($command.' 2>/dev/null');
                
                $this->app->log("Added jailkit chroot with command: ".$command,LOGLEVEL_DEBUG);
                
@@ -258,7 +258,7 @@
        $command = '/usr/local/ispconfig/server/scripts/create_jailkit_programs.sh';
        $command .= ' '.escapeshellcmd($this->data['new']['dir']);
        $command .= ' \''.$this->jailkit_config['jailkit_chroot_app_programs'].'\'';
        exec($command);
        exec($command.' 2>/dev/null');
        
        $this->app->log("Added programs to jailkit chroot with command: ".$command,LOGLEVEL_DEBUG);
    }
@@ -290,7 +290,7 @@
            $command .= ' '.escapeshellcmd($this->data['new']['shell']);
            $command .= ' '.$this->data['new']['puser'];
            $command .= ' '.$jailkit_chroot_puserhome;
            exec($command);
            exec($command.' 2>/dev/null');
            
            //* Change the homedir of the shell user and parent user
            //* We have to do this manually as the usermod command fails 
server/scripts/create_jailkit_user.sh
@@ -25,9 +25,9 @@
jk_jailuser -n -s $CHROOT_SHELL -j $CHROOT_HOMEDIR $CHROOT_USERNAME
### Reconfigure the chroot home directory for the user ###
usermod --home=$CHROOT_HOMEDIR/.$CHROOT_USERHOMEDIR $CHROOT_USERNAME
usermod --home=$CHROOT_HOMEDIR/.$CHROOT_USERHOMEDIR $CHROOT_USERNAME 2>/dev/null
### We have to reconfigure the chroot home directory for the parent user ###
if [ "$CHROOT_P_USER" != "" ]; then
  usermod --home=$CHROOT_HOMEDIR/.$CHROOT_P_USER_HOMEDIR $CHROOT_P_USER
  usermod --home=$CHROOT_HOMEDIR/.$CHROOT_P_USER_HOMEDIR $CHROOT_P_USER 2>/dev/null
fi