php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59880 ssh2_sftp_chmod - missing function
Submitted: 2011-08-02 15:15 UTC Modified: 2012-06-17 20:55 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: sts at tradebyte dot biz Assigned: langemeijer (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.3.3 OS: Linux (Debian/squeeze)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sts at tradebyte dot biz
New email:
PHP Version: OS:

 

 [2011-08-02 15:15 UTC] sts at tradebyte dot biz
Description:
------------
PHP's chmod function doesn't work on remote files, i.e. calls like chmod("ssh2.sftp:// ...")  do NOT work.

Besides there is no function like ssh2_sftp_chmod which would allow to chmod files via SFTP directly.

The provided patch adds a new PHP function "ssh2_sftp_chmod" which uses libssh2's libssh2_sftp_stat_ex to achieve that.

Function signature is:

bool ssh2_sftp_chmod(resource $sftp, string $dirname, int $mode)

Returns true on success, false on error.

cheers,
  Stefan


Reproduce code:
---------------
http://brokenpipe.de/misc/patches/ssh2-0.11.0+chmod.diff


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-17 20:53 UTC] langemeijer@php.net
Automatic comment from SVN on behalf of langemeijer
Revision: http://svn.php.net/viewvc/?view=revision&revision=326206
Log: Added feature ssh2_sftp_chmod() - closes bug #59880
 [2012-06-17 20:55 UTC] langemeijer@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: langemeijer
 [2012-06-17 20:55 UTC] langemeijer@php.net
Your patch made SVN almost unmodified. Thank you!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC