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

Item1505: Plugin installation fails on windows - read-only files cannot be replaced.

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Engine BuildContrib  
Plugin installation from shell or web fails with Permission denied

Problem appears to be due to files in the manifest marked 444. This sets the Read-only flag and the installer is unable to overwrite them.

If you issue the attrib -r command to unprotect the files, then the installation works. However if you repeat the install, it fails again because the new files are set to read-only per the manifest.

So far, SlideShowPlugin and PreferencesPlugin cannot be upgraded.

Archive unpacked
Install data/System/VarSLIDESHOWSTART.txt, permissions 0644
Install lib/Foswiki/Plugins/SlideShowPlugin/SlideShow.pm, permissions 0444
Install templates/view.slideshow.tmpl, permissions 0444
Could not create templates/view.slideshow.tmpl.bak: Permission denied
Failed to move C:\DOCUME~1\gac\LOCALS~1\Temp\bw8UoZlJ7O/templates/view.slideshow
.tmpl to templates/view.slideshow.tmpl: Permission denied

The installer does document that the web server needs to be able to write everywhere, but the installer should be able to overwrite files that it sets to read-only on a previous run (or during Foswiki installation for default plugins).

The following fix appears to resolve the problem on Windows and does not appear to hurt installation on linux:

Index: extender.pl
===================================================================
--- extender.pl (revision 3656)
+++ extender.pl (working copy)
@@ -813,6 +813,8 @@
         print "Install $target, permissions $MANIFEST->{$file}->{perms}\n";
         unless ($inactive) {
             if ( -e $target ) {
+                           chmod( oct(666), "$target");
+                           chmod( oct(666), "$target.bak") if ( -e "$target.bak");
                 unless ( File::Copy::move( $target, "$target.bak" ) ) {
                     print STDERR "Could not create $target.bak: $!\n";
                 }

-- GeorgeClark - 24 Apr 2009

permissions that are too loose might be a problem with SELinux, mod_security, and similar packages.

-- WillNorris - 24 Apr 2009

Will, Would 600 be better? If it works on Windows it will probably still work on linux. ? I'll try it tonight, but I don't have SELinux available to try.

-- GeorgeClark - 24 Apr 2009

600 works fine on Windows. Plugins re-install without issues, and the same fix to rewriteshbang.pl fixes the rewriting of the protected scripts in bin.

-- GeorgeClark - 24 Apr 2009

We decided to merge this into 1.0.5 as this should help many Windows users

-- KennethLavrsen - 25 Apr 2009
 

ItemTemplate edit

Summary Plugin installation fails on windows - read-only files cannot be replaced.
ReportedBy GeorgeClark
Codebase 1.0.4
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component BuildContrib
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:ae305775d1fc distro:712cae212a25 distro:f5dd220ec34e distro:3268359b3688
TargetRelease patch
ReleasedIn 1.0.5
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r12 - 02 Nov 2012, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License