If I run
configure
repeatedly under Perl v5.18.2 (as shipped with current Ubuntu), the settings
{RCS}{filePermission}
and
{RCS}{dirPermission}
are broken and can't be fixed without manually editing
LocalSite.cfg
. The symptoms are very similar to
Item3529.
The cause is, however, different. It took me quite some time to figure out what's going on, but basically it is
- A plain typo in
lib/TWiki.spec
, colliding with
- questionable coding style in
lib/TWiki/Configure/Type.pm
, colliding with
- a veritable bug in Perl itself, introduced by a commit before 2012, so other recent Perl versions might be affected, too.
The typo: Obvious, isn't it?
diff --git a/twiki/lib/TWiki.spec b/twiki/lib/TWiki.spec
index c9fc4af..42a9d60 100644
--- a/twiki/lib/TWiki.spec
+++ b/twiki/lib/TWiki.spec
@@ -542,7 +542,7 @@ $TWiki::cfg{INCLUDE}{AllowURLs} = $FALSE;
# correctly.
$TWiki::cfg{AllowInlineScript} = $TRUE;
-# **BOOLEAN EXPERT*
+# **BOOLEAN EXPERT**
# In HTML rednering, "<p />" has long been put for a blank line in TML.
# Though "<p />" is self-closing in XML, web browsers handle it as "<p>"
# because the MIME type of most TWiki pages is text/html rather than text/xml.
The questionable coding style: This routine doesn't check
$@
after eval, and it is using
use
where
require
is sufficient. Not actually
wrong, but
perldoc -f use
will tell the difference. It is rather unfortunate that it is this difference which triggers a perl bug.
diff --git a/twiki/lib/TWiki/Configure/Type.pm b/twiki/lib/TWiki/Configure/Type.
index 2907e8b..35dab55 100644
--- a/twiki/lib/TWiki/Configure/Type.pm
+++ b/twiki/lib/TWiki/Configure/Type.pm
@@ -44,7 +44,7 @@ sub load {
my $typer = $knownTypes{$id};
unless ($typer) {
my $typeClass = 'TWiki::Configure::Types::'.$id;
- $typer = eval 'use '.$typeClass.'; new '.$typeClass.'("'.$id.'")';
+ $typer = eval 'require '.$typeClass.'; new '.$typeClass.'("'.$id.'")';
# unknown type - give it default string behaviours
$typer = new TWiki::Configure::Type($id) unless $typer;
$knownTypes{$id} = $typer;
The perl bug:
https://rt.perl.org/Public/Bug/Display.html?id=122107
--
TWiki:Main/HaraldJoerg
- 2014-06-16
Thank you very much Harald! I'll check this in.
--
TWiki:Main.PeterThoeny
- 2014-06-17
Affected support questions:
--
TWiki:Main.PeterThoeny
- 2014-06-17
This is now in SVN trunk and 6.0 branch.
Patch for TWiki-6.0.0 code base:
===================================================================
--- TWiki.spec (revision 27365)
+++ TWiki.spec (working copy)
@@ -542,7 +542,7 @@
# correctly.
$TWiki::cfg{AllowInlineScript} = $TRUE;
-# **BOOLEAN EXPERT*
+# **BOOLEAN EXPERT**
# In HTML rednering, "<p />" has long been put for a blank line in TML.
# Though "<p />" is self-closing in XML, web browsers handle it as "<p>"
# because the MIME type of most TWiki pages is text/html rather than text/xml.
Index: TWiki/Configure/Type.pm
===================================================================
--- TWiki/Configure/Type.pm (revision 27365)
+++ TWiki/Configure/Type.pm (working copy)
@@ -44,7 +44,7 @@
my $typer = $knownTypes{$id};
unless ($typer) {
my $typeClass = 'TWiki::Configure::Types::'.$id;
- $typer = eval 'use '.$typeClass.'; new '.$typeClass.'("'.$id.'")';
+ $typer = eval 'require '.$typeClass.'; new '.$typeClass.'("'.$id.'")';
# unknown type - give it default string behaviours
$typer = new TWiki::Configure::Type($id) unless $typer;
$knownTypes{$id} = $typer;
--
TWiki:Main.PeterThoeny
- 2014-06-17
More better. Thanks!!!
--
TWiki:Main.StephenPreisach
- 2014-06-19
If you run into this issue:
- Apply the patch
- Run configure and set
{RCS}{dirPermission}
to 0755
, and {RCS}{filePermission}
to 0644
--
TWiki:Main.PeterThoeny
- 2014-06-19
Hello
How Can I apply the patch exactly Its somehow confusing me , please help and thanks in advance
--
TWiki:Main.YasserAmir
- 2014-06-23
Yasser: If you are not familiar with applying patches, there's another way: find the file
TWiki.spec
in the
lib
directory of your installation and open it in an editor. On line 545, replace
# **BOOLEAN EXPERT*
by
# **BOOLEAN EXPERT**
...then run configure again to fix permissions.
--
TWiki:Main.HaraldJoerg
- 2014-06-23
Harald
Thanks a lot for the help , now it is fixed
--
TWiki:Main.YasserAmir
- 2014-07-02