]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
IPsec: Do not interpret $? as error code of move()
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Aug 2021 15:50:47 +0000 (15:50 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 10 Sep 2021 16:57:06 +0000 (16:57 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Tested-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
html/cgi-bin/vpnmain.cgi

index 980601ba0ab07c95904c3d599b0c972f40d59397..e9064e19c3d5e5fa02760bf3937f65d19d0a9547 100644 (file)
@@ -2042,9 +2042,8 @@ END
                        unlink ($filename);
                        goto VPNCONF_ERROR;
                } else {
-                       move($filename, "${General::swroot}/certs/$cgiparams{'NAME'}cert.pem");
-                       if ($? ne 0) {
-                               $errormessage = "$Lang::tr{'certificate file move failed'}: $!";
+                       unless (move($filename, "${General::swroot}/certs/$cgiparams{'NAME'}cert.pem")) {
+                               $errormessage = "$Lang::tr{'certificate file move failed'} ($filename): $!";
                                unlink ($filename);
                                goto VPNCONF_ERROR;
                        }