6.0.0-beta1
7/21/25

[#9497] VFS ssh2 _listFolder() does not return listing with non-Bourne shells
Summary VFS ssh2 _listFolder() does not return listing with non-Bourne shells
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester lstewart (at) room52 (dot) net
Created 01/08/2011 (5308 days ago)
Due
Updated 07/02/2011 (5133 days ago)
Assigned
Resolved 07/02/2011 (5133 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
07/02/2011 05:33:28 PM Jan Schneider Comment #4
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Fixed in Horde_Vfs 1.0.4.
07/02/2011 05:33:00 PM Git Commit Comment #3 Reply to this comment
Changes have been made in Git for this ticket:

[jan] Fix listing files with SSH2 driver if not using a bourne-style 
shell (lstewart@room52.net, Bug #9497).

  2 files changed, 3 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/d5a4883ad61a5b4537fe08ebbc72b72fbb62c674
01/17/2011 11:28:28 PM lstewart (at) room52 (dot) net Comment #2
New Attachment: horde3_vfs_ssh2_env_v2.patch Download
Reply to this comment
According to http://au2.php.net/manual/en/function.ssh2-exec.php, the 
optional 4th argument to ssh2_exec is an array of env vars to run the 
command with. This is an even better way of handling this issue than 
my original patch, and appears to work just fine in my quick bit of 
testing.
01/08/2011 12:55:26 AM lstewart (at) room52 (dot) net Comment #1
Priority ⇒ 2. Medium
New Attachment: horde3_vfs_ssh2_env.patch Download
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ VFS ssh2 _listFolder() does not return listing with non-Bourne shells
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
See this mailing list thread for details: 
http://thread.gmane.org/gmane.comp.horde.user/23294

The summary is that non-Bourne shells don't interpret a command of the 
form "ENV_VAR=VAL command", where "ENV_VAR=VAL" is attempting to set 
an environment variable for "command" to run with.

The solution is to use the env command to set the environment 
variables and run the target command like so: "env ENV_VAR=VAL command".

The attached patch has been tested to work with tcsh on FreeBSD 8 
running horde 3.3.11. As discussed in the email thread, another horde 
user running linux confirmed my analysis to be correct by switching 
his shell to tcsh and observed that the bug manifested itself until he 
switched back to using bash.

Saved Queries