From patchwork Thu Nov 18 12:00:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jo-Philipp Wich X-Patchwork-Id: 1556596 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=NOSamEjn; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hvz5H4kbqz9sXM for ; Thu, 18 Nov 2021 23:05:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=re7gZZgUmlYBBeuk+L5hyqoxC6Mq++/k3UdZHQuwY0Y=; b=NOSamEjnnLQkSh zht9TqS6/ZM1BtR32M6ofmI/lrj9liey87VIflAy13iybNCuKZcTj9jUzaFwIaGgKXuiQjC+Y4jDN N32/rUXsusprBHGeJ9qlX5Ml1QXWsWumTLfodNo6ygGdeucAnK9YwLvLD3Kv+/EtHEP6ZMxwcfpo8 JbtWDOlkEsJvPPQIEkUAbV0LJDMJzeb3alHD/b+l/KVuVIsgktCavUL2bfVOaafLwHYgnGLf7IoIS wbQNPW7Hs7ir1lMuJGkEfuv8OwbH+jt3EfPiNh7XkFw/iiXIbxiKAenYeogxpEi6apv405ag0gZ8T IwtEDECIAeyjQpIsyvqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mng5P-007feR-Od; Thu, 18 Nov 2021 12:00:15 +0000 Received: from mxout01.bytecamp.net ([212.204.60.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mng5L-007fcq-UK for openwrt-devel@lists.openwrt.org; Thu, 18 Nov 2021 12:00:13 +0000 Received: by mxout01.bytecamp.net (Postfix, from userid 1001) id B33B8494DC; Thu, 18 Nov 2021 13:00:10 +0100 (CET) Received: from mail.bytecamp.net (mail.bytecamp.net [212.204.60.9]) by mxout01.bytecamp.net (Postfix) with ESMTP id 77757494DA for ; Thu, 18 Nov 2021 13:00:10 +0100 (CET) Received: (qmail 67857 invoked from network); 18 Nov 2021 13:00:10 +0100 Received: from unknown (HELO j7.lan) (jo%wwsnet.net@95.89.149.129) by mail.bytecamp.net with ESMTPS (DHE-RSA-AES128-GCM-SHA256 encrypted); 18 Nov 2021 13:00:10 +0100 From: Jo-Philipp Wich To: openwrt-devel@lists.openwrt.org Cc: Jo-Philipp Wich Subject: [PATCH] procd: setup /dev/stdin, /dev/stdout and /dev/stderr symlinks Date: Thu, 18 Nov 2021 13:00:09 +0100 Message-Id: <20211118120009.3624763-1-jo@mein.io> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211118_040012_162697_C6F81BC8 X-CRM114-Status: UNSURE ( 6.63 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Extend the hotplug.json ruleset to setup the common /dev/std{in, out, err} symbolic links which are needed by some applications, e.g. nftables when applying rulesets from stdin. Signed-off-by: Jo-Philipp Wich --- package/system/procd/files/hotplug.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) Content analysis details: (-0.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.204.60.217 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Extend the hotplug.json ruleset to setup the common /dev/std{in,out,err} symbolic links which are needed by some applications, e.g. nftables when applying rulesets from stdin. Signed-off-by: Jo-Philipp Wich --- package/system/procd/files/hotplug.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/package/system/procd/files/hotplug.json b/package/system/procd/files/hotplug.json index 7e0f129d35..b930b307a4 100644 --- a/package/system/procd/files/hotplug.json +++ b/package/system/procd/files/hotplug.json @@ -7,9 +7,19 @@ [ "has", "MINOR" ] ], [ + [ "if", + [ "eq", "DEVNAME", "null" ], + [ + [ "makedev", "/dev/%DEVNAME%", "0666" ], + [ "exec", "/bin/ln", "-s", "/proc/self/fd/0", "/dev/stdin" ], + [ "exec", "/bin/ln", "-s", "/proc/self/fd/1", "/dev/stdout" ], + [ "exec", "/bin/ln", "-s", "/proc/self/fd/2", "/dev/stderr" ], + [ "return" ] + ] + ], [ "if", [ "eq", "DEVNAME", - [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ] + [ "full", "ptmx", "zero", "tty", "net", "random", "urandom" ] ], [ [ "makedev", "/dev/%DEVNAME%", "0666" ],