From patchwork Wed Oct 22 15:34:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ummeegge X-Patchwork-Id: 9216 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 (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R13" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4csCtT3BCvz3wbt for ; Wed, 22 Oct 2025 15:36:01 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "E8" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4csCt25B6Cz3xQ for ; Wed, 22 Oct 2025 15:35:38 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4csCrr44dkz32yF for ; Wed, 22 Oct 2025 15:34:36 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R13" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4csCrp0HyTz2xQc for ; Wed, 22 Oct 2025 15:34:34 +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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4csCrM25T0zfs; Wed, 22 Oct 2025 15:34:11 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1761147251; 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=F9/JSvHQ2NPLeVeO24bFqb3uI6EzoVZWfKGYvrj2v4s=; b=zXOHVWnI5loIAztRraN+8zNmRVRJgWJHHLacKw+ho0J5M5dSwAXvM4nLmu0sQtee09/EHW Xu91dbELwt9NzAAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1761147251; 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=F9/JSvHQ2NPLeVeO24bFqb3uI6EzoVZWfKGYvrj2v4s=; b=kakUjM9E50j2bEbm8UmFkw1j+QcklSRsL+AniHN09X9OLfGlf5lIKRSguez4gZqifiznCq mTHVczVRlNednWl55NVSb8vZ4IdfKVFWeZp3S2hJ+EccMnYEN2gJafv540zsQLthS97GdJ YbA3K1fBkLRo1j3I/lWANC2UEiyjyjpDIQC0mDRaR3i4tbxYPUJp9ALRifkoB1kBSC4Ksq QiGcL/mEP2gVsexrlWMTPQ5pHPFDe9PoGnDAKPcu+xHwulQQzD34LjcKiaxzpjHcU6RcAi LEe601bl7XAjpOQGd88DPV6bBAo/wqWoi0JmTqdtk3WL0sHD2tc1an3+GgwMxg== From: ummeegge To: development@lists.ipfire.org Cc: ummeegge Subject: [PATCH v2] wlanap.cgi: Save IEEE80211W 'optional' value correctly Date: Wed, 22 Oct 2025 17:34:23 +0200 Message-ID: <20251022153425.2288772-1-ummeegge@ipfire.org> In-Reply-To: <20251017094258.632108-1-ummeegge@ipfire.org> References: <20251017094258.632108-1-ummeegge@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 The v1 patch used defined-or (//), which allowed arbitrary values to be written. This v2 patch validates that IEEE80211W is one of 'off', 'optional', or 'on', defaulting to 'off' if invalid. Signed-off-by: ummeegge --- html/cgi-bin/wlanap.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/wlanap.cgi b/html/cgi-bin/wlanap.cgi index 600ddc489..0d1c5a90b 100644 --- a/html/cgi-bin/wlanap.cgi +++ b/html/cgi-bin/wlanap.cgi @@ -118,7 +118,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") { $wlanapsettings{'NOSCAN'} = ($cgiparams{'NOSCAN'} eq 'on') ? 'on' : 'off'; $wlanapsettings{'ENC'} = $cgiparams{'ENC'}; $wlanapsettings{'PWD'} = $cgiparams{'PWD'}; - $wlanapsettings{'IEEE80211W'} = ($cgiparams{'IEEE80211W'} eq 'on') ? 'on' : 'off'; + $wlanapsettings{'IEEE80211W'} = ($cgiparams{'IEEE80211W'} eq 'on' || $cgiparams{'IEEE80211W'} eq 'optional') ? $cgiparams{'IEEE80211W'} : 'off'; $wlanapsettings{'TX_POWER'} = $cgiparams{'TX_POWER'}; if ($errormessage eq '') {