Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp755069imu; Sat, 15 Dec 2018 06:41:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/X/LribxDybzntcoabzYg5lxl6Sxha5eMLeHQWTIkXInZuZWk8jtY4sqYFIsbc3AI6kQvo/ X-Received: by 2002:a63:6d48:: with SMTP id i69mr4974344pgc.215.1544884919202; Sat, 15 Dec 2018 06:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544884919; cv=none; d=google.com; s=arc-20160816; b=Lzb93nNOa5RKBg0AialtJGrDXNESSlpWScZH2ePPilJch/bd5h1u8sx8C2inoFvRnH wNJ2MWfEcoyftR6gHBnhZMcVt9Rkmru9c6v1RV7sfUPN8athplgBFjZmeanC8YhyqOxF zuou7ukYZYp8BBGRZbE6lRi2QBm0nw2wPBy3hvn4OUNGxqVQNRW52SrOtpuWeSgFeNlN dP3GKTbqZnOxsK56FJWE983dC066ka7n3GgO/oAS8GDqTsaM1xxhQMqhwx1JVltMOlD/ dIOFKDbxwIyrrpjkLRSMgTfVKlWTTIB0JW1qWkV16Am5rGE6klKsv6Bv17DhuqZYDXUU lLbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=5ZyYA8c+ZXrTT6atA8K/2HSTjtrboTm4COcAMWbiMvA=; b=er5Qm9+cDLz6gwZaiQ0ZwKHce/WjFlr+zurLHaM4L5hoIvVGYOfML9KJ2mwTc+lblM 1SE30Od/1lQ8eLuhSQI55M9PtH99KrVZ0tZ9I7QmmdihT97YvH80WgGhAxuodh8UMtnP OhvNcwB7Skd99CSic+zAET48950QpaVkdQRAeDVldioRXv7xxeV8uQUjSrSruxPeRcl2 pNLw05t/Vm/T7zOQ5oq0vJsjWNlhojVSXhmuTkYp4n5Sow6POrOUjulgSYIOfB2dWBps g0Y2FtaN2cWP20dMgxJXwXpMxpd+HJ9mJHxacX+jvcAF7uS9f1uDvthdLC/5CdXcjE+7 JHjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@uchuujin.de header.s=h header.b="pnX2D/k8"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i64si6376970pge.361.2018.12.15.06.41.44; Sat, 15 Dec 2018 06:41:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@uchuujin.de header.s=h header.b="pnX2D/k8"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730530AbeLOOkx (ORCPT + 99 others); Sat, 15 Dec 2018 09:40:53 -0500 Received: from static.85-10-192-230.clients.your-server.de ([85.10.192.230]:35663 "EHLO mxout.uchuujin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730153AbeLOOkv (ORCPT ); Sat, 15 Dec 2018 09:40:51 -0500 Received: by neutronstar.dyndns.org (Postfix, from userid 1000) id E3D331430BAF2; Sat, 15 Dec 2018 15:35:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uchuujin.de; s=h; t=1544884532; bh=Sq4cgqjxpSpggNqzyKKmQaYtC1F/PX6yQBz9TkzITq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pnX2D/k8IKlAk6PNnSzYD/BHnrF/O1cphecyZbpZmQujEVsYVpIQCovMDivdjeY0m axRJCSv3kzqD55Pm9HFweutOzkp9WdI96BnA3g8vf62MrOIH4p5sc30tJ6pVPr0/Pw FxKioDH6EP5MEUgvkbv84lpL0rtGP0mFq/dsFN+b1l1k+k9hjee7cGYvOFZP6qQjNS xVKKajUj/TvnUOqLpL43/t2g5eM+BkyvHuNWKqSfzLE0gq0/Noy/dcalHX5FdeW+WX wXjrQeSPaktql2NnK4B3P1ZDIXILYYPHIseFJS281kSBAkIbr1zwh5Z+Cl0ppG+O9B tmfHda9y9LuPA== From: Martin Hostettler To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Nicolas Pitre , Adam Borowski , Egmont Koblinger , Martin Hostettler Subject: [PATCH 2/4] vt: Implement parsing for >, =, < private sequences. Date: Sat, 15 Dec 2018 15:34:21 +0100 Message-Id: <20181215143423.4556-3-textshell@uchuujin.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181215143423.4556-1-textshell@uchuujin.de> References: <20181215143423.4556-1-textshell@uchuujin.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Private sequences can start with '>', '=' and (in theory) '<'. Implement correct parsing for these. The newly parsable sequences are cleanly ignored as it is customary with terminal emulators. This allows the vt to ignore various sequences used by more capable terminal implementations such as "Secondary Device Attributes", "Tertiary Device Attributes" and various advanced configuration commands that don't have dedicated terminfo entries. Signed-off-by: Martin Hostettler --- drivers/tty/vt/vt.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 75826a97b0c3..448b4f6be7d1 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -2235,9 +2235,21 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) vc->vc_state=ESfunckey; return; } - vc->vc_priv = (c == '?') ? EPdec : EPecma; - if (vc->vc_priv != EPecma) + switch (c) { + case '?': + vc->vc_priv = EPdec; + return; + case '>': + vc->vc_priv = EPgt; + return; + case '=': + vc->vc_priv = EPeq; return; + case '<': + vc->vc_priv = EPlt; + return; + } + vc->vc_priv = EPecma; case ESgetpars: if (c == ';' && vc->vc_npar < NPAR - 1) { vc->vc_npar++; @@ -2250,10 +2262,12 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) vc->vc_state = ESnormal; switch(c) { case 'h': - set_mode(vc, 1); + if (vc->vc_priv <= EPdec) + set_mode(vc, 1); return; case 'l': - set_mode(vc, 0); + if (vc->vc_priv <= EPdec) + set_mode(vc, 0); return; case 'c': if (vc->vc_priv == EPdec) { -- 2.11.0