Skip to content

Commit 42b3854

Browse files
committed
Fixed jailkit scripts on fedora.
1 parent 130cd42 commit 42b3854

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

server/plugins-available/shelluser_jailkit_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function _setup_jailkit_chroot()
188188
$tpl->setVar('home_dir',$this->_get_home_dir(""));
189189

190190
$bashrc = escapeshellcmd($this->data['new']['dir']).'/etc/bash.bashrc';
191-
exec('rm '.$bashrc);
191+
if(@is_file($bashrc)) exec('rm '.$bashrc);
192192

193193
file_put_contents($bashrc,$tpl->grab());
194194
unset($tpl);
@@ -201,7 +201,7 @@ function _setup_jailkit_chroot()
201201
$tpl->setVar('domain',$web['domain']);
202202

203203
$motd = escapeshellcmd($this->data['new']['dir']).'/var/run/motd';
204-
exec('rm '.$motd);
204+
if(@is_file($motd)) exec('rm '.$motd);
205205

206206
file_put_contents($motd,$tpl->grab());
207207

server/scripts/create_jailkit_chroot.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ chown root:root $CHROOT_HOMEDIR
2424
jk_init -f -k -j $CHROOT_HOMEDIR $CHROOT_APP_SECTIONS
2525

2626
## Create the temp directory
27-
mkdir $CHROOT_HOMEDIR/tmp
27+
if [ ! -d "$CHROOT_HOMEDIR/tmp" ]
28+
then
29+
mkdir $CHROOT_HOMEDIR/tmp
30+
fi
2831
chmod a+rwx $CHROOT_HOMEDIR/tmp
2932

3033

3134
# mysql needs the socket in the chrooted environment
3235
mkdir $CHROOT_HOMEDIR/var
3336
mkdir $CHROOT_HOMEDIR/var/run
3437
mkdir $CHROOT_HOMEDIR/var/run/mysqld
35-
ln /var/run/mysqld/mysqld.sock $CHROOT_HOMEDIR/var/run/mysqld/mysqld.sock
38+
39+
# ln /var/run/mysqld/mysqld.sock $CHROOT_HOMEDIR/var/run/mysqld/mysqld.sock
40+
if [ -e "/var/run/mysqld/mysqld.sock" ]
41+
then
42+
ln /var/run/mysqld/mysqld.sock $CHROOT_HOMEDIR/var/run/mysqld/mysqld.sock
43+
fi

0 commit comments

Comments
 (0)