Item1505: Plugin installation fails on windows - read-only files cannot be replaced.
Priority: Urgent
Current State: Closed
Released In: 1.0.5
Target Release: patch
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