[pmwiki-users] umask'ing wiki.d

Patrick R. Michaud pmichaud at pobox.com
Mon Jan 31 08:07:44 CST 2005


On Mon, Jan 31, 2005 at 02:13:51PM +1300, Robin wrote:
> > PmWiki is likely trying to preserve your ability to access
> > (i.e., remove/rename) the files in wiki.d/ .  If the files receive
> > 0640 permissions, you wouldn't be able to access or remove them
> > unless you're logging in as www-data.
> That's fine, that's what the magical sudo command is for :)

Oh.  I went back and looked at the pmwiki code -- if you want your
files to be created with 0640 permissions you should be able to do it
by adding

    umask(007);

to your config.php.  Note that this will only change permissions on
the files as the corresponding pages are edited.

> > But I could be wrong about this.  Those "s" permissions on wiki.d/
> > look a little funny to me; PmWiki likes it when wiki.d is rwxrwsr-x,
> > but I'm not too sure about that first 's' or how it got there.
> OK. s(u|g)id bits on directories is something I don't fully understand the 
> workings of. I'll set it to what you suggest, and see how that goes.

The setgid bit on a directory causes all files and subdirectories created
in that directory to have the same group ownership as the directory itself.
PmWiki uses this to make sure that the group ownership of any directories
and files it creates matches the group of the pmwiki directory.

The setuid bit on a directory isn't used by PmWiki, but often it means
that files within the directory can only be removed by their owner.

Pm



More information about the pmwiki-users mailing list