From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29665 invoked from network); 23 Nov 2021 20:26:43 -0000 Received: from tb-ob0.topicbox.com (64.147.108.117) by inbox.vuxu.org with ESMTPUTF8; 23 Nov 2021 20:26:43 -0000 Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob0.topicbox.com (Postfix) with ESMTP id 8B7692882F for ; Tue, 23 Nov 2021 15:26:42 -0500 (EST) (envelope-from bounce.mM5d4e6bea6c6908b388e51f0c.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id 3ECFB857A66; Tue, 23 Nov 2021 15:26:43 -0500 (EST) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:message-id:mime-version :content-type:list-help:list-id:list-post:list-subscribe :reply-to:subject:content-transfer-encoding:list-unsubscribe; s= sysmsg-1; t=1637699203; bh=Ij14LEJtmtCizsAlY5UYHM2Q+edNDPcJrL8DM berMAM=; b=IjnB9penztk/pOd/F82xVHUd/AqFMwb/YHlZ/BAu7MnwVzp04YCSK NGNfgUM1IHb+oNkmVqvoZrndyeDyB1x/vRSUyo15H1aveWElBwMbd60aNVOFol8m r+ZJi4VulXtAUK+sgiRTV7PiS5bzMYv+Asj80w4MAqioYpjWZ6/w6g= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1637699203; b=em0JnIIX3J14sHA5s3BfX0fUcnRolGfx7sSd5277bDEkmmzbCu nAl/ZG2e4rFJvmMsYfJOBtEuXS6KA/nTYCUhkJi9Byfai+AicIEEkdSE+Bv/Xbsr 4VMOmpW663+DIdi2MWDEzRgfcO0TOyg5iaXd2tVgyiGHR6+1UEIkSC7WQ= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=date:from :to:message-id:mime-version:content-type:list-help:list-id :list-post:list-subscribe:reply-to:subject :content-transfer-encoding:list-unsubscribe; s=dkim-1; bh=1SQmHI mgzedNmwa5LG6beHRv35OlPRRshKWjxsBgXPw=; b=CLf3Uf3O4eUvEywU5hVvVE 4PF0c9IBpJxaDTUvHX5cVIeCaFw9rTdp7jrotBhLYcBXVltz0Nk/cEaA4thY2fgY qd2RG/uxsMi5W2MD7ZiOeBEMO6qi0jdlBMqm22jMEdPqq4m+nacqu5V2Po9N32HY 2UAXv0voQ/cu443V+T9Ig= Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id E664685765C for <9fans@9fans.net>; Tue, 23 Nov 2021 15:26:31 -0500 (EST) (envelope-from adr@SDF.ORG) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id A3F5A416430; Tue, 23 Nov 2021 15:26:31 -0500 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1637699191; b=wGPRd6rF6u58BD/qenAAMa+2t2kex7Sfk64Dde+pUk/5x9Xwon 2rVq8Zzsx6qSC9ItUi2zl5f8U6Z955ZwlZkBmCeqn4PDUtXj1pVAfmFrpnNCo2rT ivA3yJ/WVOXMf5zFPc/VZ+ZrbfLPRKBtd8EkDhlCrwIWUd5JxFJ7px6DKAxNLyfg Fjwqga9zZEkC6qnqTYCvChjDOocQsuDV5tZ/aq9zguSdk7+RbgVoaPTjwB55lueE QdLdAWYl1Qzup6LdahwkBP4Ctephcx0LNJi/Wdeskj9PSi98aFKr/KAbvWskIVGD sN9npWcPp9x2oWGI4QYCZP1heRWlxuN+Ox5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:message-id:mime-version :content-type; s=arcseal; t=1637699191; bh=ShECqELN4C6nSCPhZJ4N7 cfj62U1MQfUKFtGCBDYwcw=; b=sSOJZKQVF5xk4xkVZSrs0imoKf+re3dtcJX/m i06ejzR1MqxWqYEUheAbNvs+ateYPwxWDKVQPdos05cyaK8KdnG2ObPLLROtaZwx uJbQ5wJfbLMMMFEOXIaC29g3NG2Mex3GAm/1MCU3qIh5iQkJhoYOOPQBqVR2Tsgj yxngZpMHsLzjBiFRGFn/56kaaFrZWPFeq63UgCgGpu4kSc8dgZoo5q1Ux3gitDDZ UDhiwYZSXtFZ6aNY/2CFoJ5Ybek7k9ISKPf45vJNIqVX2FPxaHC97nh7KspnJ5zs XDk0cIX8YR/KpyC+CdveGbvAXCrsdMX7GlA/anuYVT23V/vzQ== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeekgddugeefucdltddurdegudehrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgf nhhsuhgsshgtrhhisggvpdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttd enucenucfjughrpeffhffvuffkgggtsehttdertddttddvnecuhfhrohhmpegrughruceo rggurhesufffhfdrqfftifeqnecuggftrfgrthhtvghrnhepkedvkeehveffhfegveeihf ekudellefhkeduffeluefhvdejhfekkeejvdetuddunecuffhomhgrihhnpehfrhgvvghs hhgvlhhlrdhorhhgnecukfhppedvtdehrdduieeirdelgedrvdegpddvtdehrdduieeird elgedrudeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddt hedrudeiiedrleegrddvgedphhgvlhhopehmgidrshgufhdrohhrghdpmhgrihhlfhhroh hmpeeorggurhesufffhfdrqfftifeq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (sdf.org: 205.166.94.24 is authorized to use 'adr@SDF.ORG' in 'mfrom' identity (mechanism 'ip4:205.166.94.0/24' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="adr@SDF.ORG"; helo=mx.sdf.org; client-ip=205.166.94.24 Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Tue, 23 Nov 2021 15:26:30 -0500 (EST) (envelope-from adr@SDF.ORG) Received: from sdf.org (IDENT:adr@sdf.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 1ANKQSx0025878 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for <9fans@9fans.net>; Tue, 23 Nov 2021 20:26:28 GMT Received: from localhost (adr@localhost) by sdf.org (8.15.2/8.12.8/Submit) with ESMTP id 1ANKQUDW029816 for <9fans@9fans.net>; Tue, 23 Nov 2021 20:26:31 GMT Date: Tue, 23 Nov 2021 20:26:30 +0000 (UTC) From: adr To: 9fans@9fans.net Message-ID: <171b6946-5a63-f723-b2c9-713ffcfea9e@SDF.ORG> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format="flowed" Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: a858bdb6-4c9b-11ec-8d4e-dfd946ec46ae Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UY2NiZGIyMGI2NzAwMDNhMS1NNWQ0ZTZiZWE2YzY5MDhiMzg4ZTUx?= =?UTF-8?B?ZjBjPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Subject: [9fans] Fix sam regexp bug with metacharacters in classes Content-Transfer-Encoding: quoted-printable List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M5d4e6bea6c6908b388e51f0c:1:kPAPyq5PZdT4LOF8ufrZgmPwS9Ua6xanf4fYkxMf9Nc The code assumes runes are 16 bits long, not 21, creating faulting code parsing classes. I.e. '/[\-]' will not match '-'. This is the same fix already in 9front. http://adr.freeshell.org/plan9/patches/sam_fix_metachars_on_classes.diff --- /sys/src/cmd/sam/regexp.c Tue Apr 23 19:06:01 2013 +++ regexp.c Tue Nov 23 15:01:18 2021 @@ -53,8 +53,8 @@ /* * Actions and Tokens * - * 0x100xx are operators, value =3D=3D precedence - * 0x200xx are tokens, i.e. operands for operators + * 0x2000xx are operators, value =3D=3D precedence + * 0x3000xx are tokens, i.e. operands for operators */ enum { OPERATOR =3D Runemask+1, /* Bitmask of all operators */ @@ -462,7 +462,8 @@ exprp++; return '\n'; } - return *exprp++|(Runemax+1); + /* add a flag so metacharacters aren't interpreted */ + return *exprp++|(Runemask+1); } return *exprp++; } @@ -498,11 +499,12 @@ if((c2 =3D nextrec()) =3D=3D ']') goto Error; classp[n+0] =3D Runemax; - classp[n+1] =3D c1; - classp[n+2] =3D c2; + /* remove possible flag from nextrec() */ + classp[n+1] =3D c1 & Runemask; + classp[n+2] =3D c2 & Runemask; n +=3D 3; }else - classp[n++] =3D c1; + classp[n++] =3D c1 & Runemask; } classp[n] =3D 0; if(nclass =3D=3D Nclass){ ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tccbdb20b670003a1-M5d4e6= bea6c6908b388e51f0c Delivery options: https://9fans.topicbox.com/groups/9fans/subscription