From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 16 04:09:24 2022 Received: (at 53928-done) by debbugs.gnu.org; 16 Jun 2022 08:09:24 +0000 Received: from localhost ([127.0.0.1]:40690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1kZ9-0006fc-Tf for submit@debbugs.gnu.org; Thu, 16 Jun 2022 04:09:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1kZ8-0006fL-0n for 53928-done@debbugs.gnu.org; Thu, 16 Jun 2022 04:09:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1kZ2-0006GJ-PN; Thu, 16 Jun 2022 04:09:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=g82pTAC1HGLj0wWRuAEBLC0gCp/BpzOdgE+Uzh28A7A=; b=cWFLl/9cB0a4BolWGPc5 jgM3vPYTy5WEUAaNUBALB47m6EN3Fe5Edy8F/YrYswxJEY61bJoDso4t0ftnk9cPkV1wUXzhvLcq4 UsHzSBHmNb8aq+O0/9g+EytlmqXUWk2yyyf4ZeOjgJVMHejsvHKhIEPt9QeClIbdYL7NEMil/N2lf WXSQhYhK7/hQEhhlIthN3iYy2HU/ISFFnuMM1kAfZANGGv5cMiF3GKrX65RKT1o/Fifoe9Akw+8zy +ylLWgWcZfgyj/t7/OyGVXjc2oRJyrbhN7yUAYugJjMSyotl+IMIfrAAsghDJsnLdjihXpwNeN0CX JInePvXnOJw8vQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:49667 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1kZ0-0000UY-Uf; Thu, 16 Jun 2022 04:09:16 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Liliana Marie Prikler Subject: Re: bug#53928: [PATCH] Allow null bytes in UNIX sockets. References: Date: Thu, 16 Jun 2022 10:09:13 +0200 In-Reply-To: (Liliana Marie Prikler's message of "Thu, 10 Feb 2022 21:42:31 +0100") Message-ID: <87r13pni6u.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53928-done Cc: 53928-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Liliana Marie Prikler skribis: > The current socket address constructors all assume, that there are no > null bytes in the socket path. This assumption does not hold in Linux, > which uses an initial null byte to demarcate abstract sockets and > ignores all further null bytes [1]. > > [1] https://www.man7.org/linux/man-pages/man7/unix.7.html > > * libguile/sockets.c (scm_fill_sockaddr)[HAVE_UNIX_DOMAIN_SOCKETS]: > Use scm_to_locale_stringn to construct c_address. > Use memcpy instead of strcpy and calculate size directly instead of > using SUN_LEN. > (_scm_from_sockaddr): Copy the entire path up to the limits imposed by > addr_size. > * test-suite/tests/00-socket.test: ("make-socket-address"): Add case for > abstract unix sockets. > ("AF_UNIX/SOCK_STREAM"): Add abstract socket versions of bind, listen, > connect and accept. Finally applied, thanks! Ludo=E2=80=99.