Revision: 8074
          http://sourceforge.net/p/ipcop/svn/8074
Author:   owes
Date:     2016-01-18 21:01:51 +0000 (Mon, 18 Jan 2016)
Log Message:
-----------
Fix further occurences of file upload.

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/backup.cgi
    ipcop/trunk/html/cgi-bin/openvpn.cgi
    ipcop/trunk/html/cgi-bin/vpnca.cgi
    ipcop/trunk/updates/2.2.0/ROOTFILES.i486-2.2.0

Modified: ipcop/trunk/html/cgi-bin/backup.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/backup.cgi 2016-01-16 07:56:33 UTC (rev 8073)
+++ ipcop/trunk/html/cgi-bin/backup.cgi 2016-01-18 21:01:51 UTC (rev 8074)
@@ -1,11 +1,23 @@
 #!/usr/bin/perl
 #
+# This file is part of the IPCop Firewall.
 # IPCop CGI's - backup.cgi: manage import/export of configuration files
 #
-# This code is distributed under the terms of the GPL
+# IPCop is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
 #
-# (c) The IPCop Team
+# IPCop is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with IPCop.  If not, see <http://www.gnu.org/licenses/>.
+#
 # 2005  Franck Bourdonnec, major rewrite
+# (c) 200x-2016 The IPCop Team
 #
 # $Id$
 #
@@ -27,7 +39,8 @@
 #local $SIG{__WARN__} = \&Carp::cluck;
 use File::Copy;
 use Sys::Hostname;
-use File::Temp qw/ tempfile /;
+use File::Temp qw(tempfile tempdir);
+use Scalar::Util qw(blessed reftype);
 
 require '/usr/lib/ipcop/general-functions.pl';
 require '/usr/lib/ipcop/lang.pl';
@@ -235,7 +248,7 @@
 
 # Import an archive set
 if ($settings{'ACTION'} eq $Lang::tr{'import'}) {
-    if (ref($settings{'FH'}) ne 'Fh') {
+    if (blessed($settings{'FH'}) ne 'CGI::File::Temp') {
         $errormessage = $Lang::tr{'no cfg upload'};
     }
     elsif (!copy($settings{'FH'}, "$setdir/$datafile")) {

Modified: ipcop/trunk/html/cgi-bin/openvpn.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/openvpn.cgi        2016-01-16 07:56:33 UTC (rev 
8073)
+++ ipcop/trunk/html/cgi-bin/openvpn.cgi        2016-01-18 21:01:51 UTC (rev 
8074)
@@ -21,7 +21,7 @@
 #
 # Ipcop and OpenVPN eas as one two three..
 #
-# (c) 2007-2015 The IPCop Team
+# (c) 2007-2016 The IPCop Team
 #
 # $Id$
 #
@@ -1120,7 +1120,7 @@
                 $errormessage = $Lang::tr{'cant change certificates'};
                 goto VPNCONF_ERROR;
             }
-            if (ref ($cgiparams{'FH'}) ne 'Fh') {
+            if (blessed($cgiparams{'FH'}) ne 'CGI::File::Temp') {
                 $errormessage = $Lang::tr{'there was no file upload'};
                 goto VPNCONF_ERROR;
             }
@@ -1161,7 +1161,7 @@
                 $errormessage = $Lang::tr{'cant change certificates'};
                 goto VPNCONF_ERROR;
             }
-            if (ref ($cgiparams{'FH'}) ne 'Fh') {
+            if (blessed($cgiparams{'FH'}) ne 'CGI::File::Temp') {
                 $errormessage = $Lang::tr{'there was no file upload'};
                 goto VPNCONF_ERROR;
             }

Modified: ipcop/trunk/html/cgi-bin/vpnca.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/vpnca.cgi  2016-01-16 07:56:33 UTC (rev 8073)
+++ ipcop/trunk/html/cgi-bin/vpnca.cgi  2016-01-18 21:01:51 UTC (rev 8074)
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with IPCop.  If not, see <http://www.gnu.org/licenses/>.
 #
-# (c) 2001-2015 The IPCop Team
+# (c) 2001-2016 The IPCop Team
 #
 # $Id$
 #
@@ -26,8 +26,9 @@
 # Make sure translation exists $Lang::tr{'virtual private networking'}
 
 use File::Copy;
-use File::Temp qw/ tempfile tempdir /;
+use File::Temp qw(tempfile tempdir);
 use POSIX();
+use Scalar::Util qw(blessed reftype);
 use strict;
 # enable only the following on debugging purpose
 #use warnings;
@@ -176,7 +177,7 @@
         }
     }
 
-    if (ref ($cgiparams{'FH'}) ne 'Fh') {
+    if (blessed($cgiparams{'FH'}) ne 'CGI::File::Temp') {
         $errormessage = $Lang::tr{'there was no file upload'};
         goto UPLOADCA_ERROR;
     }
@@ -671,7 +672,7 @@
     elsif ($cgiparams{'ACTION'} eq $Lang::tr{'upload p12 file'}) {
         &General::log("vpn", "Importing from p12...");
 
-        if (ref ($cgiparams{'FH'}) ne 'Fh') {
+        if (blessed($cgiparams{'FH'}) ne 'CGI::File::Temp') {
             $errormessage = $Lang::tr{'there was no file upload'};
             goto ROOTCERT_ERROR;
         }

Modified: ipcop/trunk/updates/2.2.0/ROOTFILES.i486-2.2.0
===================================================================
--- ipcop/trunk/updates/2.2.0/ROOTFILES.i486-2.2.0      2016-01-16 07:56:33 UTC 
(rev 8073)
+++ ipcop/trunk/updates/2.2.0/ROOTFILES.i486-2.2.0      2016-01-18 21:01:51 UTC 
(rev 8074)
@@ -2,6 +2,7 @@
 ##
 /etc/rc.d/rc.red
 /etc/rc.d/rc.sysinit
+/home/httpd/cgi-bin/backup.cgi
 /home/httpd/cgi-bin/ipsec.cgi
 /home/httpd/cgi-bin/logfirewall.cgi
 /home/httpd/cgi-bin/logproxy.cgi

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to