6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
11/9/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#12284] Expect driver params broken when used with Composite driver
*
Your Email Address
*
Spam protection
Enter the letters below:
. ,.__ .__ __ . , \./ [__)[ __/ ` \./ | [__)[_./\__. |
Comment
> The Expect driver works well by itself, with the following backend.local.php > > $backends['expect']['disabled'] = false; > $backends['expect']['params']['script'] = PASSWD_BASE . > '/scripts/passwd-expect'; > $backends['expect']['params']['params'] = '-host servername'; > > The successful command called by Driver/Expect.php is > > LANG=C LC_ALL=C /usr/bin/expect -f > '/horde/passwd/lib/../scripts/passwd-expect' -- -host servername -log > '/var/tmp/passwdZ4aqha' > > Now trying to use Expect with the Composite driver: > > $backends['combo'] = array( > 'disabled' => false, > 'name' => 'Passwords', > 'driver' => 'Composite', > 'policy' => array( > 'minLength' => 6, > 'minNumeric' => 1, > ), > 'params' => array('drivers' => array( > 'expect' => array( > 'name' => 'Unix Server', > 'driver' => 'Expect', > 'required' => true, > 'params' => array( > 'program' => '/usr/bin/expect', > 'script' => PASSWD_BASE . '/scripts/passwd-expect', > 'params' => '-host servername', > ), > ), > 'samba' => array( > 'name' => 'Samba Server', > 'driver' => 'Smbpasswd', > 'params' => array( > 'program' => '/usr/bin/smbpasswd', > 'host' => 'sambaserver', > ), > ), > )), > ); > > Expect fail to connect to server. Debugging the code in > Driver/Expect.php, the command that it is trying to execute is > > LANG=C LC_ALL=C /usr/bin/expect -f > '/horde/passwd/lib/../scripts/passwd-expect' -- Array -log > '/var/tmp/passwdiBa4pa' > > Note "Array" in the command instead of the script params "-host > servername" ($this->_params['params'] in the Expect.php code) > > The following is a workaround for the Expect driver, but the bug > might be somewhere in the Composite driver: > > --- Driver/Expect.php.orig Wed May 29 12:07:22 2013 > +++ Driver/Expect.php Wed May 29 14:16:33 2013 > @@ -34,10 +34,12 @@ > // Temporary logfile for error messages. > $log = Horde::getTempFile('passwd'); > > + $params = is_array($this->_params['params']) ? > $this->_params['params']['params'] : $this->_params['params']; > + > // Open expect script for writing. > $prog = 'LANG=C LC_ALL=C ' . $this->_params['program'] . > ' -f ' . escapeshellarg($this->_params['script']) . > - ' -- ' . $this->_params['params'] . ' -log ' . > escapeshellarg($log); > + ' -- ' . $params . ' -log ' . escapeshellarg($log); > > $exp = @popen($prog, 'w'); > @fwrite($exp, $user . "\n"); >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers