Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

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

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine Store Foswiki:Main.GeorgeClark
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 Foswikirev:7179 Foswikirev:7744
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 CopyrightStatement. Creative Commons License