Upgrading Perl to 5.20 Prevents Foswiki From Working

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Upgrading Perl to 5.20 Prevents Foswiki From Working

George Clark-2
Hi Doug,

You need to edit the Foswiki code and remove the "qw{-any}".

They should be changed simply to "use CGI;    eliminate the entire
qw(...) phrase

As far as CGI version goes,  4.15 should be fine, although you may get a
number of warnings about some additional deprecated functions.  CGI has
made some very major changes which we've been dealing with for the
upcoming Foswiki 1.2


There might be some other compatibility issues, but this should get you
started:

diff --git a/bin/configure b/bin/configure
index 8edb8fd..ecd322a 100755
--- a/bin/configure
+++ b/bin/configure
@@ -261,7 +261,7 @@ if ($@) {
     unshift( @INC, File::Spec->catfile( @root, 'lib' ) );
 }

-::_loadBasicModule('CGI qw(:any)');
+::_loadBasicModule('CGI');

 $| = 1;    # no buffering on STDOUT

diff --git a/lib/Foswiki/Configure/Type.pm b/lib/Foswiki/Configure/Type.pm
index dad2f5d..aeddd50 100644
--- a/lib/Foswiki/Configure/Type.pm
+++ b/lib/Foswiki/Configure/Type.pm
@@ -18,7 +18,7 @@ package Foswiki::Configure::Type;
 use strict;
 use warnings;

-use CGI qw( :any );
+use CGI;

 use Foswiki::Configure::Types::UNKNOWN;

diff --git a/lib/Foswiki/Contrib/MailerContrib.pm
b/lib/Foswiki/Contrib/MailerContrib.pm
index 5be0bbc..7ed95f4 100644
--- a/lib/Foswiki/Contrib/MailerContrib.pm
+++ b/lib/Foswiki/Contrib/MailerContrib.pm
@@ -16,7 +16,7 @@ use strict;
 use warnings;

 use URI ();
-use CGI qw(-any);
+use CGI;

 use Foswiki                                    ();
 use Foswiki::Plugins                           ();
diff --git a/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
b/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
index edbd86e..e1b09f9 100644
--- a/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
+++ b/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
@@ -9,7 +9,7 @@ use Foswiki;
 use Foswiki::Plugins;
 use Foswiki::Store;
 use Foswiki::Attrs;
-use CGI qw( -any );
+use CGI;

 package Foswiki::Plugins::CommentPlugin::Comment;

diff --git a/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
b/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
index b2b8f84..8f39274 100644
--- a/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
+++ b/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
@@ -9,7 +9,7 @@ use warnings;
 use Assert;
 use Error (':try');

-use CGI qw( :cgi -any );
+use CGI;

 use Encode ();

diff --git a/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
b/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
index f477393..138b203 100644
--- a/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
+++ b/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
@@ -19,7 +19,7 @@ TML syntax is not supported.

 package Foswiki::Plugins::WysiwygPlugin::TML2HTML;

-use CGI qw( -any );
+use CGI;
 use Error qw( :try );

 use Foswiki;


George Clark

-----

Hello all-

Last week I upgraded Perl to version 5.20 and that seems to have stopped
Foswiki from working. Trying to execute
http://<server_FQDN>/foswiki/bin/configure resulted in an error message
stating "An internal server error has occurred. Please see your
administrator" or something to that effect. Executing
http://<server_FQDN> produces the default index page.

The following note was found in the FreeBSD's ports update file:

...

I am at loss as to what next steps to take in order to remedy this. Do I
need to install p5-CGI.pm-3.63_1,1 in place of or in addition to
p5-CGI-4.15? See
https://www.freebsd.org/cgi/ports.cgi?query=cgi&stype=all&sektion=all
for further information on available Perl ports for the FreeBSD platform.

Also I am unsure as to what I need to do in order to comply with the
directive to audit my code for an use of any unsupported or incorrectly
spelled tags in the CGI.pm module at line 929.

Any advice you could provide would be greatly appreciated!

~Doug







------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss

------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Perl to 5.20 Prevents Foswiki From Working

Doug Sampson
I made the changes as you suggested below and now I am able to run 'configure'. Thank you, Geroge!

While I was there, I noticed there were an error and a warning in the extensions section related to the JQueryPlugin. It appears that the themeswitcher has been deprecated as well as the Tooltip. So I went ahead and unchecked these two and clicked "Save changes". An error message came up as follows:

Software error:

CGI::param called in list context from /usr/local/www/foswiki/lib/Foswiki/Configure/UIs/AUTH.pm line 44, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/local/lib/perl5/site_perl/CGI.pm line 408.

For help, please send mail to the webmaster ([hidden email]), giving this error message and the time and date of the error.


What can I do to fix this error?

~Doug

> -----Original Message-----
> From: George Clark [mailto:[hidden email]]
> Sent: Wednesday, May 27, 2015 1:55 PM
> To: '[hidden email]'; Doug Sampson
> Subject: [Foswiki-discuss] Upgrading Perl to 5.20 Prevents Foswiki From
> Working
>
> Hi Doug,
>
> You need to edit the Foswiki code and remove the "qw{-any}".
>
> They should be changed simply to "use CGI;    eliminate the entire
> qw(...) phrase
>
> As far as CGI version goes,  4.15 should be fine, although you may get a
> number of warnings about some additional deprecated functions.  CGI has
> made some very major changes which we've been dealing with for the
> upcoming Foswiki 1.2
>
>
> There might be some other compatibility issues, but this should get you
> started:
>
> diff --git a/bin/configure b/bin/configure
> index 8edb8fd..ecd322a 100755
> --- a/bin/configure
> +++ b/bin/configure
> @@ -261,7 +261,7 @@ if ($@) {
>      unshift( @INC, File::Spec->catfile( @root, 'lib' ) );
>  }
>
> -::_loadBasicModule('CGI qw(:any)');
> +::_loadBasicModule('CGI');
>
>  $| = 1;    # no buffering on STDOUT
>
> diff --git a/lib/Foswiki/Configure/Type.pm b/lib/Foswiki/Configure/Type.pm
> index dad2f5d..aeddd50 100644
> --- a/lib/Foswiki/Configure/Type.pm
> +++ b/lib/Foswiki/Configure/Type.pm
> @@ -18,7 +18,7 @@ package Foswiki::Configure::Type;
>  use strict;
>  use warnings;
>
> -use CGI qw( :any );
> +use CGI;
>
>  use Foswiki::Configure::Types::UNKNOWN;
>
> diff --git a/lib/Foswiki/Contrib/MailerContrib.pm
> b/lib/Foswiki/Contrib/MailerContrib.pm
> index 5be0bbc..7ed95f4 100644
> --- a/lib/Foswiki/Contrib/MailerContrib.pm
> +++ b/lib/Foswiki/Contrib/MailerContrib.pm
> @@ -16,7 +16,7 @@ use strict;
>  use warnings;
>
>  use URI ();
> -use CGI qw(-any);
> +use CGI;
>
>  use Foswiki                                    ();
>  use Foswiki::Plugins                           ();
> diff --git a/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
> b/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
> index edbd86e..e1b09f9 100644
> --- a/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
> +++ b/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
> @@ -9,7 +9,7 @@ use Foswiki;
>  use Foswiki::Plugins;
>  use Foswiki::Store;
>  use Foswiki::Attrs;
> -use CGI qw( -any );
> +use CGI;
>
>  package Foswiki::Plugins::CommentPlugin::Comment;
>
> diff --git a/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
> b/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
> index b2b8f84..8f39274 100644
> --- a/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
> +++ b/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
> @@ -9,7 +9,7 @@ use warnings;
>  use Assert;
>  use Error (':try');
>
> -use CGI qw( :cgi -any );
> +use CGI;
>
>  use Encode ();
>
> diff --git a/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
> b/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
> index f477393..138b203 100644
> --- a/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
> +++ b/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
> @@ -19,7 +19,7 @@ TML syntax is not supported.
>
>  package Foswiki::Plugins::WysiwygPlugin::TML2HTML;
>
> -use CGI qw( -any );
> +use CGI;
>  use Error qw( :try );
>
>  use Foswiki;
>
>
> George Clark
>
> -----
>
> Hello all-
>
> Last week I upgraded Perl to version 5.20 and that seems to have stopped
> Foswiki from working. Trying to execute
> http://<server_FQDN>/foswiki/bin/configure resulted in an error message
> stating "An internal server error has occurred. Please see your
> administrator" or something to that effect. Executing
> http://<server_FQDN> produces the default index page.
>
> The following note was found in the FreeBSD's ports update file:
>
> ...
>
> I am at loss as to what next steps to take in order to remedy this. Do I
> need to install p5-CGI.pm-3.63_1,1 in place of or in addition to
> p5-CGI-4.15? See
> https://www.freebsd.org/cgi/ports.cgi?query=cgi&stype=all&sektion=all
> for further information on available Perl ports for the FreeBSD platform.
>
> Also I am unsure as to what I need to do in order to comply with the
> directive to audit my code for an use of any unsupported or incorrectly
> spelled tags in the CGI.pm module at line 929.
>
> Any advice you could provide would be greatly appreciated!
>
> ~Doug
>
>
>
>
>
>
>
> --------------------------------------------------------------------------
> ----
> _______________________________________________
> Foswiki-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/foswiki-discuss

------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Perl to 5.20 Prevents Foswiki From Working

Doug Sampson
Never mind- I found this: http://foswiki.org/Support.Question1540

The suggested changes worked!

~Doug

> -----Original Message-----
> From: Doug Sampson [mailto:[hidden email]]
> Sent: Thursday, May 28, 2015 4:59 PM
> To: '[hidden email]'
> Subject: Re: [Foswiki-discuss] Upgrading Perl to 5.20 Prevents Foswiki
> From Working
>
> I made the changes as you suggested below and now I am able to run
> 'configure'. Thank you, Geroge!
>
> While I was there, I noticed there were an error and a warning in the
> extensions section related to the JQueryPlugin. It appears that the
> themeswitcher has been deprecated as well as the Tooltip. So I went ahead
> and unchecked these two and clicked "Save changes". An error message came
> up as follows:
>
> Software error:
>
> CGI::param called in list context from
> /usr/local/www/foswiki/lib/Foswiki/Configure/UIs/AUTH.pm line 44, this can
> lead to vulnerabilities. See the warning in "Fetching the value or values
> of a single named parameter" at /usr/local/lib/perl5/site_perl/CGI.pm line
> 408.
>
> For help, please send mail to the webmaster ([hidden email]), giving
> this error message and the time and date of the error.
>
>
> What can I do to fix this error?
>
> ~Doug
>
> > -----Original Message-----
> > From: George Clark [mailto:[hidden email]]
> > Sent: Wednesday, May 27, 2015 1:55 PM
> > To: '[hidden email]'; Doug Sampson
> > Subject: [Foswiki-discuss] Upgrading Perl to 5.20 Prevents Foswiki From
> > Working
> >
> > Hi Doug,
> >
> > You need to edit the Foswiki code and remove the "qw{-any}".
> >
> > They should be changed simply to "use CGI;    eliminate the entire
> > qw(...) phrase
> >
> > As far as CGI version goes,  4.15 should be fine, although you may get a
> > number of warnings about some additional deprecated functions.  CGI has
> > made some very major changes which we've been dealing with for the
> > upcoming Foswiki 1.2
> >
> >
> > There might be some other compatibility issues, but this should get you
> > started:
> >
> > diff --git a/bin/configure b/bin/configure
> > index 8edb8fd..ecd322a 100755
> > --- a/bin/configure
> > +++ b/bin/configure
> > @@ -261,7 +261,7 @@ if ($@) {
> >      unshift( @INC, File::Spec->catfile( @root, 'lib' ) );
> >  }
> >
> > -::_loadBasicModule('CGI qw(:any)');
> > +::_loadBasicModule('CGI');
> >
> >  $| = 1;    # no buffering on STDOUT
> >
> > diff --git a/lib/Foswiki/Configure/Type.pm
> b/lib/Foswiki/Configure/Type.pm
> > index dad2f5d..aeddd50 100644
> > --- a/lib/Foswiki/Configure/Type.pm
> > +++ b/lib/Foswiki/Configure/Type.pm
> > @@ -18,7 +18,7 @@ package Foswiki::Configure::Type;
> >  use strict;
> >  use warnings;
> >
> > -use CGI qw( :any );
> > +use CGI;
> >
> >  use Foswiki::Configure::Types::UNKNOWN;
> >
> > diff --git a/lib/Foswiki/Contrib/MailerContrib.pm
> > b/lib/Foswiki/Contrib/MailerContrib.pm
> > index 5be0bbc..7ed95f4 100644
> > --- a/lib/Foswiki/Contrib/MailerContrib.pm
> > +++ b/lib/Foswiki/Contrib/MailerContrib.pm
> > @@ -16,7 +16,7 @@ use strict;
> >  use warnings;
> >
> >  use URI ();
> > -use CGI qw(-any);
> > +use CGI;
> >
> >  use Foswiki                                    ();
> >  use Foswiki::Plugins                           ();
> > diff --git a/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
> > b/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
> > index edbd86e..e1b09f9 100644
> > --- a/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
> > +++ b/lib/Foswiki/Plugins/CommentPlugin/Comment.pm
> > @@ -9,7 +9,7 @@ use Foswiki;
> >  use Foswiki::Plugins;
> >  use Foswiki::Store;
> >  use Foswiki::Attrs;
> > -use CGI qw( -any );
> > +use CGI;
> >
> >  package Foswiki::Plugins::CommentPlugin::Comment;
> >
> > diff --git a/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
> > b/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
> > index b2b8f84..8f39274 100644
> > --- a/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
> > +++ b/lib/Foswiki/Plugins/WysiwygPlugin/Handlers.pm
> > @@ -9,7 +9,7 @@ use warnings;
> >  use Assert;
> >  use Error (':try');
> >
> > -use CGI qw( :cgi -any );
> > +use CGI;
> >
> >  use Encode ();
> >
> > diff --git a/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
> > b/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
> > index f477393..138b203 100644
> > --- a/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
> > +++ b/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
> > @@ -19,7 +19,7 @@ TML syntax is not supported.
> >
> >  package Foswiki::Plugins::WysiwygPlugin::TML2HTML;
> >
> > -use CGI qw( -any );
> > +use CGI;
> >  use Error qw( :try );
> >
> >  use Foswiki;
> >
> >
> > George Clark
> >
> > -----
> >
> > Hello all-
> >
> > Last week I upgraded Perl to version 5.20 and that seems to have stopped
> > Foswiki from working. Trying to execute
> > http://<server_FQDN>/foswiki/bin/configure resulted in an error message
> > stating "An internal server error has occurred. Please see your
> > administrator" or something to that effect. Executing
> > http://<server_FQDN> produces the default index page.
> >
> > The following note was found in the FreeBSD's ports update file:
> >
> > ...
> >
> > I am at loss as to what next steps to take in order to remedy this. Do I
> > need to install p5-CGI.pm-3.63_1,1 in place of or in addition to
> > p5-CGI-4.15? See
> > https://www.freebsd.org/cgi/ports.cgi?query=cgi&stype=all&sektion=all
> > for further information on available Perl ports for the FreeBSD
> platform.
> >
> > Also I am unsure as to what I need to do in order to comply with the
> > directive to audit my code for an use of any unsupported or incorrectly
> > spelled tags in the CGI.pm module at line 929.
> >
> > Any advice you could provide would be greatly appreciated!
> >
> > ~Doug
> >
> >
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> --
> > ----
> > _______________________________________________
> > Foswiki-discuss mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
>
> --------------------------------------------------------------------------
> ----
> _______________________________________________
> Foswiki-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/foswiki-discuss

------------------------------------------------------------------------------
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss