avoid error message, when using ssh2-vfs-driver in gollem
Michael Gröne <[email protected]> Wed, 16 Sep 2009 17:00:29 +0200
| Newsgroups | gmane.comp.horde.gollem |
|---|---|
| Message-ID | <20090916170029.18373goqwr7aqgsg@horde_dev.web.zew.local> |
Playing around with gollem I ran into a write-error on my filesystem. Not a problem so far - there will be an error-message (Die VFS-Datei "/home/local/ZEW/michael/test/filename" konnte nicht gespeichert werden.), but there will even php-errors be displayed which include the password in cleartext leading to "headers already sent"-errors: Warning: copy() [function.copy]: Unable to open ssh2.sftp://zew\michael:(password)@fileserver.local:2000/home/local/ZEW/michael/test/filename on remote host in /var/www/horde_dev_124/lib/VFS/ssh2.php on line 966 Warning: copy(ssh2.sftp://[email protected]:1984/home/local/ZEW/michael/test/filename) [function.copy]: failed to open stream: Bad file descriptor in /var/www/horde_dev_124/lib/VFS/ssh2.php on line 966 Warning: Cannot modify header information - headers already sent by (output started at /var/www/horde_dev_124/lib/VFS/ssh2.php:966) in /var/www/horde_dev_124/gollem/templates/common-header.inc on line 3 Warning: Cannot modify header information - headers already sent by (output started at /var/www/horde_dev_124/lib/VFS/ssh2.php:966) in /var/www/horde_dev_124/gollem/templates/common-header.inc on line 4 My solution is to call the causing function with @ before (/lib/VFS/ssh2.php, line 966): /** * Sends local file to remote host. * This function exists because the php_scp_* functions doesn't seem to work on some hosts. * * @access private * * @param string $local Full path to the local file. * @param string $remote Full path to the remote location. * * @return boolean TRUE on success, FALSE on failure. */ function _send($local, $remote) { return @copy($local, $this->_wrap($remote)); } /** * Receives file from remote host. * This function exists because the php_scp_* functions doesn't seem to work on some hosts. * * @access private * * @param string $local Full path to the local file. * @param string $remote Full path to the remote location. * * @return boolean TRUE on success, FALSE on failure. */ function _recv($remote, $local) { return @copy($this->_wrap($remote), $local); } Maybe this will be applied to the next version of gollem? -- Gollem mailing list - Join the hunt: http://horde.org/bounties/#gollem Frequently Asked Questions: http://horde.org/faq/ To unsubscribe, mail: [email protected]