From nobody Wed Dec 08 07:50:08 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1851D18D3277 for ; Wed, 8 Dec 2021 07:50:28 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J88Tv62Zwz4TXB; Wed, 8 Dec 2021 07:50:27 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 1B87oIER025603 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 8 Dec 2021 07:50:19 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: arrowd@freebsd.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 1B87oGRO002344 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 8 Dec 2021 14:50:16 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: What to use in place of abstract unix sockets? To: Gleb Popov , freebsd-hackers References: From: Eugene Grosbein Message-ID: <9ca80eac-e24a-802d-fae0-6a2146c4a825@grosbein.net> Date: Wed, 8 Dec 2021 14:50:08 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT autolearn=disabled version=3.4.2 X-Spam-Report: * -0.0 SHORTCIRCUIT No description available. * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4J88Tv62Zwz4TXB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N 08.12.2021 13:43, Gleb Popov wrote: > Hello hackers. > > I'm porting a software that does the following things on Linux: > > 1. Binds an abstract UDS (the socket name starts with '\0') > 2. Launches a "client" process. > 3. "Client" uses chroot() to constrain itself in a sort of jail. > 4. "Client" connects to the abstract UDS. > >>From what I can tell, this works because abstract UDS's do not use the > filesystem namespace, which is why "client" can connect out of the > chroot'ed environment. > > What can I do to make this software work for FreeBSD? Simply using regular > UDS instead of abstract ones doesn't work for obvious reasons - the > "client" can't find the socket file. > > Thanks in advance. If they are parent/child, you could try using socketpair().