From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#53928: [PATCH] Allow null bytes in UNIX sockets. Date: Thu, 16 Jun 2022 10:09:13 +0200 Message-ID: <87r13pni6u.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25731"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) Cc: 53928-done@debbugs.gnu.org To: Liliana Marie Prikler Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Thu Jun 16 10:11:56 2022 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o1kbb-0006V2-TT for guile-bugs@m.gmane-mx.org; Thu, 16 Jun 2022 10:11:56 +0200 Original-Received: from localhost ([::1]:36342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1kbb-00083n-0w for guile-bugs@m.gmane-mx.org; Thu, 16 Jun 2022 04:11:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1kZn-0007Oi-4z for bug-guile@gnu.org; Thu, 16 Jun 2022 04:10:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1kZm-0006OB-SH for bug-guile@gnu.org; Thu, 16 Jun 2022 04:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o1kZm-0006gl-MG for bug-guile@gnu.org; Thu, 16 Jun 2022 04:10:02 -0400 Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Thu, 16 Jun 2022 08:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 53928 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Mail-Followup-To: 53928@debbugs.gnu.org, ludo@gnu.org, liliana.prikler@gmail.com Original-Received: via spool by 53928-done@debbugs.gnu.org id=D53928.165536696425648 (code D ref 53928); Thu, 16 Jun 2022 08:10:02 +0000 Original-Received: (at 53928-done) by debbugs.gnu.org; 16 Jun 2022 08:09:24 +0000 Original-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 Original-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 Original-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==; Original-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 In-Reply-To: (Liliana Marie Prikler's message of "Thu, 10 Feb 2022 21:42:31 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10295 Archived-At: 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.