From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4cs4qv6BCjz3314 for ; Wed, 22 Oct 2025 10:18:19 +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) (Client CN "mail01.haj.ipfire.org", Issuer "R13" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4cs4qr3dkNz2xMw for ; Wed, 22 Oct 2025 10:18:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4cs4qR0Myxz2yC; Wed, 22 Oct 2025 10:17:55 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1761128275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JTwiMhAiecsUkLmN3UgXJGXxq34gqMiOL8kfp+2Kfd4=; b=tvnwnj8oy3LAIK9Nb85fzHmuj457v4vQ0EJJqIfPQDDfG2ws3vEqaQKiBNzJgYNYwMVLYi aGcfcZLRZRJH/GAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1761128275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JTwiMhAiecsUkLmN3UgXJGXxq34gqMiOL8kfp+2Kfd4=; b=TLI4PBvV+3YzZmBSzzZRJqk3XwQ7+nMAC5CCFa38XSz/aLrCboFcm7MdoKkP/IzEcwJvWj rY8yKfqTrAwfirTHj3kZsTjXgijDFgP4QFdcshmVuLhGvGrr9+NC9oXwAPh1E4YPHsqP0T jtlQegCO1Hf2Ura1QOmxWuEAA3/GJz5PNTspy7/6gFCqZRMeFiiHUGPTf8Pz495e2/KBn/ BKY4eDiIAatbUWzoE/Do8MMZnFQaRlDq8Ypci5DUR8g7FDdatBwRkrjg1meE89Q1+8NE0b Lbs8+sfaezbe8vjfYqeJlvPFuthEMaXgZ4jF1mRJQE2QRQ+gHRhzsXAdziXtrw== Content-Type: text/plain; charset=utf-8 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: Mime-Version: 1.0 Subject: Re: [PATCH] wlanap.cgi: Save IEEE80211W 'optional' value correctly From: Michael Tremer In-Reply-To: <20251017094258.632108-1-ummeegge@ipfire.org> Date: Wed, 22 Oct 2025 11:17:54 +0100 Cc: development@lists.ipfire.org Content-Transfer-Encoding: quoted-printable Message-Id: <930F4556-F971-47C7-94A5-A704D30AB220@ipfire.org> References: <20251017094258.632108-1-ummeegge@ipfire.org> To: ummeegge Hello Erik, Thank you for your patch. I cannot quite merge this because the patch changes behaviour so that = the browser could write arbitrary values into the configuration file = without further sanitisation. To fix this, we must check if = $cgiparams{'IEEE80211W=E2=80=99} contains one of three possible values. Would you like to update this patch accordingly? -Michael > On 17 Oct 2025, at 10:42, ummeegge wrote: >=20 > Original ternary ignored 'optional' and forced 'off'. > Use defined-or (//) to preserve all select values. >=20 > Signed-off-by: ummeegge > --- > html/cgi-bin/wlanap.cgi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/html/cgi-bin/wlanap.cgi b/html/cgi-bin/wlanap.cgi > index 600ddc489..afdba59b3 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'} =3D ($cgiparams{'NOSCAN'} eq 'on') ? 'on' : = 'off'; > $wlanapsettings{'ENC'} =3D $cgiparams{'ENC'}; > $wlanapsettings{'PWD'} =3D $cgiparams{'PWD'}; > - $wlanapsettings{'IEEE80211W'} =3D ($cgiparams{'IEEE80211W'} eq 'on') = ? 'on' : 'off'; > + $wlanapsettings{'IEEE80211W'} =3D $cgiparams{'IEEE80211W'} // 'off'; > $wlanapsettings{'TX_POWER'} =3D $cgiparams{'TX_POWER'}; >=20 > if ($errormessage eq '') { > --=20 > 2.47.2 >=20 >=20