It's better when it's simple

User Tools

Site Tools


File creation modes

FIXME page needs to be linked from somewhere

DokuWiki's handling of file creation modes changed recently. Previously it modified the proccess' umask directly this made some problems (97,698). Now it makes use of chmod calls when necessary.

DokuWiki provides two options to configure how files and directories are created: fmode and dmode.

DokuWiki will check if your configuration differs from what the system would use automatically and will call chmod after creating the files or directories to set up the wanted permissions. It will not alter your system's umask settings.

Some Background

Why do we have the “umask” in the first place?

Well, the system calls for creating a new file(ie. open, fopen, etc.) do not have a parameter for setting the UNIX permissions ((probably for legacy reasons), but a file needs permission settings when it is created. By default this is a mode of 0666. Unfortunately this means eryone would be able to write to our file when it is first opened

This is where umask comes into the picture, to make sure the file has sane permissions the umask is applied to the default permissions. Specifically, permissions in the umask are turned off from default mode. Eg. (0666 & ~0022) = 0644.

Creating a directory (mkdir) is a little bit diffrent, here you can set the permissions but the umask is also applied, so we still need to take that into account.

devel/filemodes.txt · Last modified: 2009-10-03 13:29 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki