You are here: Foswiki>Tasks Web>Item709 (08 Sep 2010, KennethLavrsen)Edit Attach

Item709: Foswiki in virtual hosting with SuexecUserGroup creates directories with wrong permissions

pencil
Priority: Normal
Current State: Closed
Released In: 1.0.10, 1.1.0
Target Release: patch
Applies To: Engine
Component: Store
Branches:
Reported By: GeorgeClark
Waiting For: Foswiki:Main.GeorgeClark
Last Change By: KennethLavrsen
RcsFile.pm uses File::Path::mkpath to create the pub path for topic attachments.

Perl honors umask when creating files: From perldoc -f umask

"permission (or "mode") values you pass mkdir or sysopen are modified by your umask, so even if you tell sysopen to create a file with permissions 0777, if your umask is 0022 then the file will actually be created with permissions 0755"

Apache Suexec enforces a umask of 077 which causes the directories to be created without the "x" bit. Later, Apache is unable traverse the directories and is unable to read attachments until the directory is changed to 755.

RcsFile.pm should issue an explicit chmod on new directories to set the permissions per $Foswiki::cfg{RCS}{dirPermission}


It appears that on Linux, it is sufficient to issue a umask calculated as oct(777)-$Foswiki::cfg{RCS}{dirPermission} Adding umask(oct(777)-$Foswiki::cfg{RCS}{dirPermission}); to Handler.pm just prior to the call to make the directory path resolves the issue.

Checking in for additional testing.

ItemTemplate edit

Summary Foswiki in virtual hosting with SuexecUserGroup creates directories with wrong permissions
ReportedBy GeorgeClark
Codebase 1.0.9, trunk
SVN Range Foswiki-1.0.0-beta3, Fri, 02 Jan 2009, build 1697
AppliesTo Engine
Component Store
Priority Normal
CurrentState Closed
WaitingFor Foswiki:Main.GeorgeClark
Checkins distro:8e45f54b5f29 distro:2653afe07c84
TargetRelease patch
ReleasedIn 1.0.10, 1.1.0
Topic revision: r7 - 08 Sep 2010, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy