From nobody Thu Dec 09 00:08:19 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 3CA5818DD7A9 for ; Thu, 9 Dec 2021 00:08:49 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from midget.dons.net.au (2403-5800-5200-4700-225-90ff-fe47-39b4.ip6.aussiebb.net [IPv6:2403:5800:5200:4700:225:90ff:fe47:39b4]) (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 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "dons.net.au", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J8ZBm4tpbz4mLq for ; Thu, 9 Dec 2021 00:08:48 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from midget.dons.net.au (localhost [127.0.0.1]) by midget.dons.net.au (8.16.1/8.16.1) with ESMTPS id 1B908PsX019621 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Thu, 9 Dec 2021 10:38:25 +1030 (ACDT) (envelope-from darius@dons.net.au) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dons.net.au; s=default; t=1639008513; bh=grhfshK6apj99dBWNLtEUn05NXK13TyZeovO+HQRbP8=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=CWSEhEvqplvOXxpz8Cu4SC93GoXVmhFqURcpKeCI6+cwA4aFizLTVz9PshEOdtCWt FnC63U3Cma47BjXy9pEnD0JuSFhoN76gwtnBZqyGZu+wkyLr0RmzPNJ/ftzhXXtOML 3JncU8/EZdMJalukpLNobciqErHM7VGcYuaqbcUQ= Received: (from mailnull@localhost) by midget.dons.net.au (8.16.1/8.16.1/Submit) id 1B908KO2019615 for ; Thu, 9 Dec 2021 10:38:20 +1030 (ACDT) (envelope-from darius@dons.net.au) X-MIMEDefang-Relay-f0f0b4ff001831caa5b8ac39868c4c7e9b4d12fc: 2001:44b8:1d2:8900:ecbb:36a4:68ae:4a5f Received: from smtpclient.apple ([IPv6:2001:44b8:1d2:8900:ecbb:36a4:68ae:4a5f] [2001:44b8:1d2:8900:ecbb:36a4:68ae:4a5f]) by 2403-5800-5200-4700-225-90ff-fe47-39b4.ip6.aussiebb.net (envelope-sender ) (MIMEDefang) with ESMTP id 1B908JH9019610; Thu, 09 Dec 2021 10:38:20 +1030 Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: What to use in place of abstract unix sockets? In-Reply-To: Date: Thu, 9 Dec 2021 10:38:19 +1030 Cc: freebsd-hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Gleb Popov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Score: 1.3 (*) No, score=1.3 required=5.0 tests=RDNS_NONE,SPF_HELO_NONE, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.4 X-Scanned-By: MIMEDefang 2.83 on 10.0.2.1 X-Rspamd-Queue-Id: 4J8ZBm4tpbz4mLq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Reply-To: darius@dons.net.au From: Daniel O'Connor via freebsd-hackers X-Original-From: Daniel O'Connor X-ThisMailContainsUnwantedMimeParts: N > On 8 Dec 2021, at 17:13, Gleb Popov wrote: > I'm porting a software that does the following things on Linux: >=20 > 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. >=20 > =46rom 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. >=20 > 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. If the parent knows where the child will chroot it could create a unix = domain socket under that directory somewhere. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum