From patchwork Thu Jun 21 19:12:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kapfer X-Patchwork-Id: 1834 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.i.ipfire.org (Postfix) with ESMTP id 9A0E36095C for ; Thu, 21 Jun 2018 11:12:59 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [127.0.0.1]) by mail01.ipfire.org (Postfix) with ESMTP id 17AEB1136E40; Thu, 21 Jun 2018 10:12:59 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1529572379; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:list-id: list-unsubscribe:list-subscribe:list-post; bh=l+Nf9uQwG4qjYvMi8u5JrEYhyASkoN534PaCJfcCgBk=; b=SlEnPKO32yKYAted20n43o20Z/KagaPZXTup3iTJB685NVGS4CrRVmWbtvVDk0zOQxjg1C f50un9Jq3l0OKKI66Jcb7xUDS2uJ2txxi0Q8DNxL3GNvuZ4lR58eJ/J4bcXIp8oQBYFFKq Glg4YyaEFcUW9IffSfapmsQ5WxlW5KpLMGPNRnxanZxjQB7ZTi52evxvjYPh1LM5ZuJc0F LNYo4xOcAEzp3uV83erD8Wd34brg6bLxQs84ehe1PBJP415bDoACEmiQD794rpJ3clzv2I jKzvPT+gXBa3DkVokapfbVGWDXadkkbgJYLG5t9TwFdAaQRYPr12ICHcQHJr4A== Received: from localhost.localdomain (i59F4D897.versanet.de [89.244.216.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id D28061136E31; Thu, 21 Jun 2018 10:12:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1529572374; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=l+Nf9uQwG4qjYvMi8u5JrEYhyASkoN534PaCJfcCgBk=; b=On+MAulNYlBObLIv5ftZgx8AmvGf6X4PsGi7PcdOyUO/Bc8hHyEjBD7BJuv0tJXo1fxUyD xeLj07l0Ayib6wblcL93F8QuqPpQYRgH5bH8iKPp7KkerF/GLp42q1RR3bEVfBssZHXxEE C8MdYRU4ithI7+3iBd4It63etukjsmebskcfaLE2lJsYdCDnoh91QrY2arjg1Or83qcT/3 RYM9T4F27Hj7lw4w0+eddBMMaFRIXJLDA1Nz8TQvnRhfC2t+iH7zMuSRoHQtmKz8ftfj3G CL/ZuPs9BETSmnmztdVkdh1jQO61WwEoaF7+xNcwemY1UgSIDxANwXjd7QnQPA== From: Erik Kapfer To: development@lists.ipfire.org Subject: [PATCH] OpenVPN: Prevent internal server error cause of bad header wrapper Date: Thu, 21 Jun 2018 11:12:53 +0200 Message-Id: <1529572373-16580-1-git-send-email-erik.kapfer@ipfire.org> X-Mailer: git-send-email 2.7.4 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=ummeegge smtp.mailfrom=erik.kapfer@ipfire.org X-Spamd-Result: default: False [-2.10 / 11.00]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:8881, ipnet:89.244.208.0/20, country:DE]; FROM_HAS_DN(0.00)[] X-Spam-Status: No, score=-2.10 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This fixes #11772 . If the X509 are deleted, the openvpnctrl output generates a bad header wrapper error from the CGI which causes an internal server error. The redirection of the openvpnctrl output fixes this. Signed-off-by: Erik Kapfer --- html/cgi-bin/ovpnmain.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 4bc3473..5cd19a0 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -1181,7 +1181,7 @@ SETTINGS_ERROR: delete $confighash{$cgiparams{'$key'}}; } - system ("/usr/local/bin/openvpnctrl -drrd $name"); + system ("/usr/local/bin/openvpnctrl -drrd $name &>/dev/null"); } while ($file = glob("${General::swroot}/ovpn/ca/*")) { unlink $file;