]> git.ipfire.org Git - people/ms/ipfire-2.x.git/blobdiff - html/cgi-bin/vpnmain.cgi
IPsec: Do not interpret $? as error code of move()
[people/ms/ipfire-2.x.git] / 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;
                        }