|  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
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:
Bug Type:
From: boris at brdaric dot com
New email:
PHP Version: OS:


 [2020-01-17 10:27 UTC] boris at brdaric dot com
From manual page:
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);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-10 13:27 UTC]
-Status: Open +Status: Verified
 [2021-02-10 13:27 UTC]
Indeed, ssh2_sftp_mkdir() behaves like mkdir() wrt. the umask.
 [2021-02-10 15:26 UTC]
Automatic comment on behalf of
Log: Fix #79136: ssh2_sftp_mkdir affected by umask
 [2021-02-10 15:26 UTC]
-Status: Verified +Status: Closed
 [2021-02-11 15:55 UTC]
Automatic comment on behalf of
Log: Fix #79136: ssh2_sftp_mkdir affected by umask
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 13:01:24 2023 UTC