You are here: Foswiki>Tasks Web>Item9928 (12 Dec 2017, GeorgeClark)Edit Attach

Item9928: Gauge plugin changes the umask to hardcoded 002 - which can break other extensions.

pencil
Priority: Urgent
Current State: Needs Developer
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: GaugePlugin
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
GaugePlugin should set the umask to 777 - {RCS}{dirPermissions}

GaugePlugin.pm sets umask to 002. This will cause directories created by other extensions to potentially have broader permissions than intended by the configure settings.

Suggested code: umask( oct(777) - $Foswiki::cfg{RCS}{dirPermission} );

-- GeorgeClark - 30 Oct 2010

Thanks. Now fixed.

-- AndrewJones - 04 May 2011

Reopened for current Foswiki Version where dirPermission is defined in Store, not RCS!

The relevant umask related lines should be changed to
   if ( !-e "$dir" ) {
      umask( oct(777) - $Foswiki::cfg{Store}{dirPermission} );
      mkdir( $dir, 0755 );
   }

   if ( !-e "$tempPath" ) {
      umask( oct(777) - $Foswiki::cfg{Store}{dirPermission} );
      mkdir( $tempPath, 0755 );
   }

and

   umask( oct(777) - $Foswiki::cfg{Store}{filePermission} );
   open( IMAGE, ">", "$dir/$filename" )
     || return _make_error "Can't create '$dir/$filename': $!";

respectively when writing the image file (don't forget the code lines for debug mode too!).

And by the way, there's another typo in the code
sub _make_gauge {
   my ( $sesstion, 
should be
sub _make_gauge {
   my ( $session,
(mind the additional t)

Cheers!

-- FranzJosefGigler - 24 Apr 2015

 

ItemTemplate edit

Summary Gauge plugin changes the umask to hardcoded 002 - which can break other extensions.
ReportedBy GeorgeClark
Codebase 1.2.0 beta1
SVN Range
AppliesTo Extension
Component GaugePlugin
Priority Urgent
CurrentState Needs Developer
WaitingFor
Checkins GaugePlugin:e378a751a475
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r5 - 12 Dec 2017, GeorgeClark
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