IPsec: Do not interpret $? as error code of move()

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>
This commit is contained in:
Michael Tremer
2021-08-24 15:50:47 +00:00
committed by Arne Fitzenreiter
parent 6688e0bc7a
commit aec1c53cf1

View 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;
}