6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
7/26/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#7403] VFS ssh2 doesnt work correctly
*
Your Email Address
*
Spam protection
Enter the letters below:
._.. ..__ .___..__ | |__|[__) _/ [__) _|_| |[__)./__.|
Comment
> I tried to use in gollem the ssh2 driver. But in the list of files > returned the filename was wrong: > > "1000 50 112 30. Okt 2004 ldap" > > But other names were correct, except that there was an space in front > of the name. > > The ones that worked, had an time in the year field. > > I looked in the ssh2.php of the VFS and noticed that it was connected > to the following line 542: > > $file['name'] = substr($line, strpos($line, sprintf("%s %2s %5s", > $item[5], $item[6], $item[7])) + 13); > > When I changed it to > > $file['name'] = substr($line, strpos($line, sprintf("%3s %3s %-5s", > $item[5], $item[6], $item[7])) + 14); > > That worked for the mayority of files but not for all. It seems to be > connected to my locale, for this user it is LC_ALL=de_DE.utf8. > > At the end I had the best result with follwoing solution, and seems > to be the most stable: > > Line 488 old: > > $stream = @ssh2_exec($this->_stream, 'LC_TIME=C ls -' . $ls_args . ' > ' . escapeshellarg($path)); > > to > > $stream = @ssh2_exec($this->_stream, 'LC_TIME=C ls --time-style=+"%d > %m %Y" -' . $ls_args . ' ' . escapeshellarg($path)); > > > > Line 542 to > > $file['name'] = substr($line, strpos($line, sprintf("%2s %2s %4s", > $item[5], $item[6], $item[7])) + 11); > > > > Line 601 > > $file['date'] = strtotime('00:00:00' . $item[5] . ' ' . $item[6] . ' > ' . $item[7]); > > to > > $file['date'] = strtotime('00:00:00' . $item[5] . '.' . $item[6] . > '.' . $item[7]); > > > > Thanks
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