php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79136 ssh2_sftp_mkdir affected by umask
Submitted: 2020-01-17 10:27 UTC Modified: 2021-02-10 13:27 UTC
From: boris at brdaric dot com Assigned:
Status: Closed Package: ssh2 (PECL)
PHP Version: Irrelevant OS: Debian Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: boris at brdaric dot com
New email:
PHP Version: OS:

 

 [2020-01-17 10:27 UTC] boris at brdaric dot com
Description:
------------
---
From manual page: https://php.net/function.ssh2-sftp-chmod
---
Please confirm and note/document that permissions for directory created using this function are affected by system umask setting.

Test script:
---------------
/* Create directory */
ssh2_sftp_mkdir($sftp, '/home/site',0774);

# If system umask default is 022, as it's default on most Linux distributions
# you will end up with directory that has permission 754
# If you really want permissions set to 0774, you have to use ssh2_sftp_chmod

/* Make sure proper permissions are set */
ssh2_sftp_chmod($sftp, '/home/site',0774);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-10 13:27 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2021-02-10 13:27 UTC] cmb@php.net
Indeed, ssh2_sftp_mkdir() behaves like mkdir() wrt. the umask.
 [2021-02-10 15:26 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=e154522a5a4d7927d91b540cec3e9f98e41e9922
Log: Fix #79136: ssh2_sftp_mkdir affected by umask
 [2021-02-10 15:26 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2021-02-11 15:55 UTC] mumumu@php.net
Automatic comment on behalf of mumumu@mumumu.org
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=a0bd886cdc2707c4c23aa6084f30c6c6380b66e0
Log: Fix #79136: ssh2_sftp_mkdir affected by umask
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 12:01:26 2024 UTC