From patchwork Tue Aug 24 15:50:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 4645 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4GvD9F6nchz3xJS for ; Tue, 24 Aug 2021 15:50:57 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4GvD9C15q4z6cb; Tue, 24 Aug 2021 15:50:55 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4GvD9B4WHmz2yxF; Tue, 24 Aug 2021 15:50:54 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4GvD9950jbz2y0B for ; Tue, 24 Aug 2021 15:50:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4GvD993Ps6z35q; Tue, 24 Aug 2021 15:50:53 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1629820253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mc2NIvrlNa/I3eYtdNpZ8NZWpXxS8w0TXF/08F9dkuo=; b=4/3Ul/vfjBrIjyjhLPHfBIutt+j29JeLNP4e1DAj1Pf+jhE6+4PKvhnsOxGxC+luWhQZID 65rodhEnt8lBr9AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1629820253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mc2NIvrlNa/I3eYtdNpZ8NZWpXxS8w0TXF/08F9dkuo=; b=K+QZ+OhLRfTIePurBDSHF6cmFX2E+limHF6gp+RU1uCzOzE0lrDyqox+dlfB3n7wVlvILN 4jNFvYKiZfrR3SUW46Eksl4d2f/kWwAoApqRZt6sXlFxMJMfyZDCsZFtQi+46c/a8pUx5f jQ4l8P1V+3sFx10ETA4/yMyjUXypxR5ZqwfZmM4MhJb3bH65z+Kf/HxULP3zD0zM/A989g WBjkFe0+LGq/RYp/PAdZ0dX6qrHW9W/Fp641S5WYpr1HiAwzkAHO6KSz0JEV0CtJFVcUMR wA1GTuh0+mrOMzPFBN5pa9aLqkuiTWitvDdMk6qHh6cBRUkOuD0wM8zeasQRlw== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 2/3] IPsec: Do not interpret $? as error code of move() Date: Tue, 24 Aug 2021 15:50:47 +0000 Message-Id: <20210824155048.13859-2-michael.tremer@ipfire.org> In-Reply-To: <20210824155048.13859-1-michael.tremer@ipfire.org> References: <20210824155048.13859-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer Signed-off-by: Stefan Schantl Tested-by: Stefan Schantl --- html/cgi-bin/vpnmain.cgi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi index 980601ba0..e9064e19c 100644 --- a/html/cgi-bin/vpnmain.cgi +++ b/html/cgi-bin/vpnmain.cgi @@ -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; }