Skip to content

Commit 1121025

Browse files
author
Marius Burkard
committed
- fixed invalid argument count on exec_safe in shell_user plugin
1 parent a0fed93 commit 1121025

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/plugins-available/shelluser_base_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ function insert($event_name, $data) {
129129
$app->system->chgrp($homedir,$data['new']['pgroup'],false);
130130
}
131131
$command = 'useradd -d ? -g ? -o ?'; // non unique
132-
if($data['new']['password'] != '') $command .= ' -p ?';
132+
if($data['new']['password'] != '') $command .= ' -p ' . escapeshellarg($data['new']['password']);
133133
$command .= ' -s ? -u ? ?';
134-
$app->system->exec_safe($command, $homedir, $data['new']['pgroup'], $data['new']['password'], $data['new']['shell'], $uid, $data['new']['username']);
134+
$app->system->exec_safe($command, $homedir, $data['new']['pgroup'], $data['new']['shell'], $uid, $data['new']['username']);
135135
$app->log("Executed command: ".$command, LOGLEVEL_DEBUG);
136136
$app->log("Added shelluser: ".$data['new']['username'], LOGLEVEL_DEBUG);
137137

0 commit comments

Comments
 (0)