php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79915 Explanation about umask parameter
Submitted: 2020-07-30 11:11 UTC Modified: 2020-07-30 18:39 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: petra dot bertova at gmail dot com Assigned:
Status: Open Package: Filesystem function related
PHP Version: Irrelevant OS: ubuntu
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: petra dot bertova at gmail dot com
New email:
PHP Version: OS:

 

 [2020-07-30 11:11 UTC] petra dot bertova at gmail dot com
Description:
------------
---
From manual page: https://php.net/function.umask
---
Umask function seems to accept parameter in reverse binary code.
Full access is not umask(0777), but umask(0000)
-rwxrwx--- is not umask(0770), but umask(0007)
-rwxrwxr-x is not umask(0775), but umask(0003)

Please, update documentation and add more examples.

Actual result:
--------------
When I write 
umask(0777)
I have no permissions to a directory/file

When I write 
umask(03)
I have -rwxrwxr-x permissions to a directory/file

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-30 18:39 UTC] requinix@php.net
-Summary: umask parameter +Summary: Explanation about umask parameter -Package: Unknown/Other Function +Package: Filesystem function related
 [2020-07-30 18:39 UTC] requinix@php.net
As stated in the top comment, umask is about revoking permissions, not granting them. This is how the standard umask(2) works.
https://man7.org/linux/man-pages/man2/umask.2.html
 [2023-01-18 08:12 UTC] k dot imiasaldamo dot 9881 at gmail dot com
That was so amazing. 

(https://www.landstaronline.me/)github.com
 [2023-01-20 08:25 UTC] amin dot jaberfgari242 at gmail dot com
That was amazing. 

(https://www.facetimeapps.org/)github.com
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 23:01:28 2024 UTC