Skip to content

Commit 79ae1af

Browse files
committed
force update jails on cron/shell_user update
1 parent f43d23f commit 79ae1af

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

server/plugins-available/cron_jailkit_plugin.inc.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,13 @@ function _setup_jailkit_chroot()
275275
unset($options['allow_hardlink']);
276276
}
277277
}
278+
// force update existing jails
279+
$options[] = 'force';
278280

279-
$app->system->update_jailkit_chroot($this->data['new']['dir'], $options);
281+
$sections = $this->jailkit_config['jailkit_chroot_app_sections'];
282+
$programs = $this->jailkit_config['jailkit_chroot_app_programs'];
283+
284+
$app->system->update_jailkit_chroot($this->data['new']['dir'], $sections, $programs, $options);
280285
}
281286
$this->_add_jailkit_programs();
282287

@@ -288,11 +293,13 @@ function _add_jailkit_programs()
288293
{
289294
global $app;
290295

296+
$opts = array('force');
297+
291298
//copy over further programs and its libraries
292-
$app->system->create_jailkit_programs($this->parent_domain['document_root'], $this->jailkit_config['jailkit_chroot_app_programs']);
299+
$app->system->create_jailkit_programs($this->parent_domain['document_root'], $this->jailkit_config['jailkit_chroot_app_programs'], $opts);
293300
$this->app->log("Added app programs to jailkit chroot", LOGLEVEL_DEBUG);
294301

295-
$app->system->create_jailkit_programs($this->parent_domain['document_root'], $this->jailkit_config['jailkit_chroot_cron_programs']);
302+
$app->system->create_jailkit_programs($this->parent_domain['document_root'], $this->jailkit_config['jailkit_chroot_cron_programs'], $opts);
296303
$this->app->log("Added cron programs to jailkit chroot", LOGLEVEL_DEBUG);
297304
}
298305

server/plugins-available/shelluser_jailkit_plugin.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ function delete($event_name, $data) {
284284

285285
$app->log("Jailkit Plugin -> delete username:".$data['old']['username'], LOGLEVEL_DEBUG);
286286

287-
288287
}
289288

290289
function _setup_jailkit_chroot()
@@ -339,8 +338,13 @@ function _setup_jailkit_chroot()
339338
unset($options['allow_hardlink']);
340339
}
341340
}
341+
// force update existing jails
342+
$options[] = 'force';
343+
344+
$sections = $this->jailkit_config['jailkit_chroot_app_sections'];
345+
$programs = $this->jailkit_config['jailkit_chroot_app_programs'];
342346

343-
$app->system->update_jailkit_chroot($this->data['new']['dir'], $options);
347+
$app->system->update_jailkit_chroot($this->data['new']['dir'], $sections, $programs, $options);
344348
}
345349

346350
// might need to update master db here? checking....

0 commit comments

Comments
 (0)