From unknown Sat Jun 14 19:27:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61722: (guix cpio) produces corrupted archives when there are non-ASCII filenames Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 23 Feb 2023 03:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61722 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 61722@debbugs.gnu.org X-Debbugs-Original-To: bug-guix Received: via spool by submit@debbugs.gnu.org id=B.167712207932224 (code B ref -1); Thu, 23 Feb 2023 03:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Feb 2023 03:14:39 +0000 Received: from localhost ([127.0.0.1]:60834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pV246-0008Nf-L5 for submit@debbugs.gnu.org; Wed, 22 Feb 2023 22:14:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:54554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pV241-0008NQ-UA for submit@debbugs.gnu.org; Wed, 22 Feb 2023 22:14:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pV241-0005YV-MP for bug-guix@gnu.org; Wed, 22 Feb 2023 22:14:33 -0500 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pV240-0006bL-3w for bug-guix@gnu.org; Wed, 22 Feb 2023 22:14:33 -0500 Received: by mail-qv1-xf30.google.com with SMTP id y12so10157692qvt.8 for ; Wed, 22 Feb 2023 19:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=QRcVvVA17iiQKw5pgdMGL+zoW7/tlfO/p9aCj1Cvu6M=; b=QpstBq4lhi+HHLH3XQ16xeNgs6mIVOJC3f/dcmxWW4OEppnHOqhtEyKkxaEMcs66E2 DwTteyaGyAs4Buyn7DelYz3fFmx3IhtMYcXQsjaP561XxhJyyBsX7cV495qpb6izKrsA nis9ZCGlo6bhh2Q33ylRyJlj/lJwZtrZGW/FYYCGg0yMkArCdgwSR0NMOdohl6+r4vZm RItHvThu0meFepY0IRpg8h8uNo4W6/I/8zIwu7PQycfqVWt8QGo/6upgYzyFEVZ4iq0N BqBviK1sJdRn1kx8KtDQi0UOyQT8hoJwv1KBm1NR1CRbBHF+ifivqkNjZixwoPmbBbf8 Re4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QRcVvVA17iiQKw5pgdMGL+zoW7/tlfO/p9aCj1Cvu6M=; b=sRNUoTmsTZf5xBOwzsRRnq5ZnicD4kKPgt54lhkdakW0/yAeUNf1KJwMLU6Gn5LUj5 ocUi93Z/bV5/FWaSu87j+CReUyVpLgqfei7Aih9a3IrJbbsCbyo27SRSxagkHJGrY7SP dcRXX/gZ4M9uCNX/pjNirNfnOR9uRdK9SDIzHgGkp0OTRdWWHR+1Zpb3ineI1AHEmIqO qYowWq8m2ilB9K1jinHM5cTx/AK+k4LQmlENzBwR+Vwc1UARadKy/Mu6OrvJubZpLqa7 LE3SaEI0PTsFwJNpSiAQ0zCNYFNX90LWtsx3yrQP/r/VtN+6Wq6lOv6eqz2pV0im9C2z zZPA== X-Gm-Message-State: AO0yUKWxg8yYOCS3Njyj5qForlUfqQGi08ZDNuePyWW81WKLl/wjjK33 eVNgMJDqGJm07R4vxpICvnLq2CHsnoiSHQ== X-Google-Smtp-Source: AK7set/atJAtPiuMPdeZv9n0EHSioXyzyNCKz1d8cBkejNJADtEwN8C7qxu9LEukVD84v1h41qohOA== X-Received: by 2002:ad4:5e8a:0:b0:56e:ad32:2d58 with SMTP id jl10-20020ad45e8a000000b0056ead322d58mr21223815qvb.6.1677122070241; Wed, 22 Feb 2023 19:14:30 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1002]) by smtp.gmail.com with ESMTPSA id a24-20020ac87218000000b003bfa66b7484sm3242491qtp.35.2023.02.22.19.14.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 19:14:29 -0800 (PST) From: Maxim Cournoyer Date: Wed, 22 Feb 2023 22:14:26 -0500 Message-ID: <87mt55hy3x.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::f30; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) Hi, It appears that the code we have to generate CPIO archives doesn't handle the presence of non-ASCII characters in the file names of files to be archived well: First, to make rpm usable on a Guix System: --8<---------------cut here---------------start------------->8--- # mkdir /var/lib/rpm # chown root:users /var/lib/rpm # chmod g+rw /var/lib/rpm --8<---------------cut here---------------end--------------->8--- Then, produce a problematic CPIO via 'guix pack -f rpm', which uses (guix cpio): --8<---------------cut here---------------start------------->8--- $ rpm_archive=3D$(guix pack -R -C none -f rpm nss-certs) --8<---------------cut here---------------end--------------->8--- Notice that it cannot be installed: --8<---------------cut here---------------start------------->8--- $ mkdir /tmp/nss-certs # rpm --prefix=3D/tmp/nss-certs -i $rpm_archive error: unpacking of archive failed: cpio: Bad magic error: nss-certs-3.81-0.x86_64: install failed --8<---------------cut here---------------end--------------->8--- Let's now inspect the cpio itself. --8<---------------cut here---------------start------------->8--- $ guix shell rpm cpio [env]$ rpm2cpio $rpm_archive > nss-certs.cpio [env]$ cpio -t < nss-certs.cpio |& grep -B3 junk ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/9= 482e63a.0 ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/9= 846683b.0 ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/9= 88a38cb.0 cpio: warning: skipped 248 bytes of junk -- ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/M= icrosoft_RSA_Root_Certificate_Authority_2017.pem ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/N= AVER_Global_Root_Certification_Authority.pem ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/N= etLock_Arany_=3DClass_Gold=3D_F=C5=91tan=C3=BAs=C3=ADtv=C3=A1ny. cpio: warning: skipped 4 bytes of junk --8<---------------cut here---------------end--------------->8--- I haven't yet pin-pointed what the problem is. I could do with extra eyes :-). --=20 Thanks, Maxim From unknown Sat Jun 14 19:27:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61722: [PATCH] cpio: Properly handle Unicode characters in file names. References: <87mt55hy3x.fsf@gmail.com> In-Reply-To: <87mt55hy3x.fsf@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 24 Feb 2023 04:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61722 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 61722@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Ricardo Wurmus Received: via spool by 61722-submit@debbugs.gnu.org id=B61722.167721446128942 (code B ref 61722); Fri, 24 Feb 2023 04:55:02 +0000 Received: (at 61722) by debbugs.gnu.org; 24 Feb 2023 04:54:21 +0000 Received: from localhost ([127.0.0.1]:35809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVQ68-0007Wi-PV for submit@debbugs.gnu.org; Thu, 23 Feb 2023 23:54:21 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:34619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVQ64-0007WS-Sr for 61722@debbugs.gnu.org; Thu, 23 Feb 2023 23:54:19 -0500 Received: by mail-qt1-f180.google.com with SMTP id b6so7348515qtb.1 for <61722@debbugs.gnu.org>; Thu, 23 Feb 2023 20:54:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qxIAuzDUk9NOc7lSmjXWSF6qvuSQy9bMDeAJnbAWXP0=; b=p8beQd77lbN5U6MNYRHeZ+iLDhgi85JMFv400RpQ2rcotXiPMXOX2EgGSVunaHgNuV REJxUNetw73ICcxZJRM/GRh0gzQ3h3oHGrA770YYVGn6Ip3xSBCbrepmf7ubsILIdFkk Eamqnn0n5E9QWvApwtgdRIQopRhqM6wcLY7U7lPOHE3l9Ubi41xsTFkEP8Sk3TGTd4l6 UpghNOCHnmNefyX9++eAlQKOGTo3eijg8Ippe1lwOKrxcMD8S8SW2PKhmbF7zQK0jeZ0 T+tieuuVpUlAosHtXxA1o2yiUJRVFR4eKneUeRWS90dvSjaUG4+HQY5WJWIToT0f8cDb hhrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qxIAuzDUk9NOc7lSmjXWSF6qvuSQy9bMDeAJnbAWXP0=; b=64dyfoJXzdvmGv2VdQV/3AnzRHzXTq4fLYEp09sfu0kW+rQszqDs1VL71Xeh6bpR3w k1vTjkavTK30ACY6ffOadUkeooK7uWzE8Vupl/YnB//DPZh57I8av+GC65Ky4g9FvfJ5 GcP7m+57XYarOpnhcox1iZkjnr3eWbXfycgkZrv3grapQQlm2K8CWYIum7VX4c4MaDmr 8apsk3GxGhmcpl4gVSizYygHdhBR3nXBV7rAFqIW3fEjmR1HP1wmNPdZKrdHdVooi843 1HCxyBkDzoc4Kol6bhm+LskmlGxIBXyMp8w++hCto3brGtnfJT3nnbhvjtPVnkTkptvJ 1K9g== X-Gm-Message-State: AO0yUKUgeGGfgaOTCNWmCyBfJhb+sXazuPt+WFcAQed9kYSRi0ySE1Lm 65DbfnFwc5jwx2qMAsEypBxqrDxTnpxjDtgv X-Google-Smtp-Source: AK7set8CDsV0r7LRJx2+yLMhW0f62DFQVoDfRxU7YIl/5xNOkM1oC4LDKPawe3xb6Tn9Ze79GML9EQ== X-Received: by 2002:ac8:5c08:0:b0:3b8:63fa:11be with SMTP id i8-20020ac85c08000000b003b863fa11bemr23126946qti.66.1677214451008; Thu, 23 Feb 2023 20:54:11 -0800 (PST) Received: from localhost.localdomain (dsl-10-129-1.b2b2c.ca. [72.10.129.1]) by smtp.gmail.com with ESMTPSA id i3-20020a37b803000000b0073bacce6ad7sm4115824qkf.82.2023.02.23.20.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 20:54:10 -0800 (PST) From: Maxim Cournoyer Date: Thu, 23 Feb 2023 23:54:01 -0500 Message-Id: <20230224045402.26444-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) 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: -1.0 (-) Fixes . * guix/cpio.scm (file->cpio-header): Compute the file name length in bytes rather than in characters. (file->cpio-header*, special-file->cpio-header*): Likewise. (write-cpio-archive): Likewise, and write the file name as UTF-8 bytes, not textually, to avoid encoding it as ISO-8859-1. --- guix/cpio.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/guix/cpio.scm b/guix/cpio.scm index d4a7d5f1e0..8fd7552450 100644 --- a/guix/cpio.scm +++ b/guix/cpio.scm @@ -170,7 +170,8 @@ (define* (file->cpio-header file #:optional (file-name file) #:size (stat:size st) #:dev (stat:dev st) #:rdev (stat:rdev st) - #:name-size (string-length file-name)))) + #:name-size (bytevector-length + (string->utf8 file-name))))) (define* (file->cpio-header* file #:optional (file-name file) @@ -182,7 +183,8 @@ (define* (file->cpio-header* file (make-cpio-header #:mode (stat:mode st) #:nlink (stat:nlink st) #:size (stat:size st) - #:name-size (string-length file-name)))) + #:name-size (bytevector-length + (string->utf8 file-name))))) (define* (special-file->cpio-header* file device-type @@ -201,7 +203,8 @@ (define* (special-file->cpio-header* file permission-bits) #:nlink 1 #:rdev (device-number device-major device-minor) - #:name-size (string-length file-name))) + #:name-size (bytevector-length + (string->utf8 file-name)))) (define %trailer "TRAILER!!!") @@ -237,7 +240,7 @@ (define (dump-file file) ;; We're padding the header + following file name + trailing zero, and ;; the header is 110 byte long. - (write-padding (+ 110 1 (string-length file)) port) + (write-padding (+ 110 (bytevector-length (string->utf8 file)) 1) port) (case (mode->type (cpio-header-mode header)) ((regular) @@ -246,7 +249,7 @@ (define (dump-file file) (dump-port input port)))) ((symlink) (let ((target (readlink file))) - (put-string port target))) + (put-bytevector port (string->utf8 target)))) ((directory) #t) ((block-special) base-commit: c756c62cfdba8d4079be1ba9e370779b850f16b6 -- 2.39.1 From unknown Sat Jun 14 19:27:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61722: [PATCH] cpio: Properly handle Unicode characters in file names. Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 24 Feb 2023 11:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61722 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxim Cournoyer , 61722@debbugs.gnu.org Cc: Josselin Poiret , Christopher Baines , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tobias Geerinckx-Rice , Ricardo Wurmus Received: via spool by 61722-submit@debbugs.gnu.org id=B61722.167723926025795 (code B ref 61722); Fri, 24 Feb 2023 11:48:01 +0000 Received: (at 61722) by debbugs.gnu.org; 24 Feb 2023 11:47:40 +0000 Received: from localhost ([127.0.0.1]:36143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVWY7-0006hz-UN for submit@debbugs.gnu.org; Fri, 24 Feb 2023 06:47:40 -0500 Received: from world.peace.net ([64.112.178.59]:44478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVWY1-0006ha-Ba for 61722@debbugs.gnu.org; Fri, 24 Feb 2023 06:47:38 -0500 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVWXl-0003xm-QB; Fri, 24 Feb 2023 06:47:17 -0500 From: Mark H Weaver In-Reply-To: <20230224045402.26444-1-maxim.cournoyer@gmail.com> References: <87mt55hy3x.fsf@gmail.com> <20230224045402.26444-1-maxim.cournoyer@gmail.com> Date: Fri, 24 Feb 2023 06:46:21 -0500 Message-ID: <87bklj70bb.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) 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: -1.0 (-) Hi Maxim, Maxim Cournoyer writes: > Fixes . > > * guix/cpio.scm (file->cpio-header): Compute the file name length in bytes rather than in > characters. > (file->cpio-header*, special-file->cpio-header*): Likewise. > (write-cpio-archive): Likewise, and write the file name as UTF-8 bytes, not > textually, to avoid encoding it as ISO-8859-1. > > --- > > guix/cpio.scm | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/guix/cpio.scm b/guix/cpio.scm > index d4a7d5f1e0..8fd7552450 100644 > --- a/guix/cpio.scm > +++ b/guix/cpio.scm > @@ -170,7 +170,8 @@ (define* (file->cpio-header file #:optional (file-name file) > #:size (stat:size st) > #:dev (stat:dev st) > #:rdev (stat:rdev st) > - #:name-size (string-length file-name)))) > + #:name-size (bytevector-length > + (string->utf8 file-name))))) (string-utf8-length file-name) would produce the same result more efficiently. Regards, Mark From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 07:10:04 2023 Received: (at control) by debbugs.gnu.org; 24 Feb 2023 12:10:04 +0000 Received: from localhost ([127.0.0.1]:36189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVWtm-0007Rg-5Q for submit@debbugs.gnu.org; Fri, 24 Feb 2023 07:10:04 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:42695) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVWtk-0007RG-Uz for control@debbugs.gnu.org; Fri, 24 Feb 2023 07:10:01 -0500 Received: by mail-wr1-f42.google.com with SMTP id j2so13510316wrh.9 for ; Fri, 24 Feb 2023 04:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677240595; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=JEXB6cXdfNxRLvgdZ9k4QluQUnQntWP9YwS7s5Wi/OQ=; b=QikP7EBe/kwNt8zXwc5sC27xf9BBppzz8L3xIloe8glF8dDHx6bdbooXT1AUwuVsxr E5aEDBpgiXJblQvvSY+Z5o0CONnYleqImfqapJTYFKRCLZaA3T/e1QLuf3gXTz9ru8IS VntRkgRtel8wtvArHJCQ9QetkBHyiZHhwSz9MvFQ5wTxFTZOXM/x80mXlH69Fv2RAuSH zUBJu04+x4kKPFvcd15kEH5YpZFeKg+NvKxm9VGQsymEDDmfxASP6HuiXfWQGGw1F5dA 2k7qBZsC2xsmwOw+ouMhluBR92yQb4DW2a6JZcOoE+ypEDNinJIqcg37ntk38t32BBhC x/qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677240595; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JEXB6cXdfNxRLvgdZ9k4QluQUnQntWP9YwS7s5Wi/OQ=; b=5oJyx5bWV6MtBre9p5iTD2Uj00eIqLL7yYJ81HVJcJL9+UQK47jo3+ttCJdP6L0w+b 6uwziAR9dN6fI4GjJfUM5qFu+6WuifhjrNsdUncZtsGs69GjyjGX8NjErKQSqtaasj6P iH4VNzzN7Dp7x0x+RcTLD1biAHxz03eD87I0m8Xxd7K43VQdd/CV8NF7F3yTNWmeojqi kxtcsWLPlah5axpptEFQ0/MOzzwkNunur2S3JojThstYGCmxPTQJAie0UNcBrnMckPWq ANiH9dxUogGsk3DcIzW/YO9sLLT2uUfESn8VRvO0EhxgdnHfMgVHD8xiCkSXyjaRIfuo yCxQ== X-Gm-Message-State: AO0yUKXDq3LIdakrLegrU6bf1PE8+8ZhkC8FKlE3ka8c46Z96EvJHIl+ JTttpNNZh+M7zpv4g4xmyzpo+U6Klcw= X-Google-Smtp-Source: AK7set8+g3xD72l87YGDHw0FY5lqJ1O4oclJ7c5i3cXvln+4b9ebI+WkEdx1i2ny6rwV9YJDLUSe8Q== X-Received: by 2002:adf:fb0f:0:b0:2c7:b5ef:9695 with SMTP id c15-20020adffb0f000000b002c7b5ef9695mr541265wrr.3.1677240594991; Fri, 24 Feb 2023 04:09:54 -0800 (PST) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id u11-20020adfdb8b000000b002c54fb024b2sm16855278wri.61.2023.02.24.04.09.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 04:09:54 -0800 (PST) Date: Fri, 24 Feb 2023 11:18:43 +0100 Message-Id: <87a613mkn0.fsf@gmail.com> To: control@debbugs.gnu.org From: Simon Tournier Subject: control message for bug #61722 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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: -1.0 (-) tags 61722 + patch quit From unknown Sat Jun 14 19:27:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61722: [PATCH v2] cpio: Properly handle Unicode characters in file names. References: <87mt55hy3x.fsf@gmail.com> In-Reply-To: <87mt55hy3x.fsf@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 24 Feb 2023 13:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61722 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 61722@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , mhw@netris.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Ricardo Wurmus , Mathieu Othacehe Received: via spool by 61722-submit@debbugs.gnu.org id=B61722.167724522922495 (code B ref 61722); Fri, 24 Feb 2023 13:28:02 +0000 Received: (at 61722) by debbugs.gnu.org; 24 Feb 2023 13:27:09 +0000 Received: from localhost ([127.0.0.1]:36294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVY6O-0005ql-Ny for submit@debbugs.gnu.org; Fri, 24 Feb 2023 08:27:09 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:38788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVY6L-0005qE-QY for 61722@debbugs.gnu.org; Fri, 24 Feb 2023 08:27:07 -0500 Received: by mail-qt1-f171.google.com with SMTP id c18so845139qte.5 for <61722@debbugs.gnu.org>; Fri, 24 Feb 2023 05:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZKmtD7gym9fRnRLy59I2bPiAlj5zNGbmKfPYhQ474g8=; b=ME+fUCEzwqKp0LxhGsxWw3owrOnpQP1QDQCnGCYm8e6xez60m/xGK1z+osrSUQOD5G 8W8nVX02lnNqqZRSDQIuSz3rYY+Vr+lQ7lUPvAOeq/3MUTbzdAwxdLFwk6vClGBakkax /LiDpIdHlSBFAHV/kZJ/z7TVaNCldhOIyawEOAi3WmtsBzqgBLqqWxctlS4rJt9p9Qje YVeuCMCGn1HIZx0oHNIWDBz2sal/bscRXPnD8UB50AcCM7f5XV979HpLPy1jwAZpt1vg bqPi8Pl2xLy0wWbCbHWT64uTB9ZR9flkHs4As7kQh8YQnjb3GAU0LyW9W+iTjvVc43+X sKQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZKmtD7gym9fRnRLy59I2bPiAlj5zNGbmKfPYhQ474g8=; b=kZCL41PIbFxnyOLdxKGS8UCWv88hYrlr1vvPNPHiuT8UG21Y6RCC0NxE3o5oTF9FO2 0Y7gJsIdJDMbJBLbN8/aPvTFYYw3uU1YJWC2wTla6t5K/U6pb2rbNWl1GvIdlmfQ9NuK wrdqRIpowY2t8QRXXubK2yDpXuK6SfxcxNMayRiZKP0WZf3/XD9PkJSw9lndsfhHRp+c 21JByWj1p3l9sSg6QsXEKdEcwstO0SkUoY0fTi3BVPcbn3F+v04bHvdwKBZIX6cNPGJP +fQkPXI/XklcpPyCLdPlJwTgu+bfKycdhM4ZP9+sTF0ChaJItL/l1cHBduUJDf+iznem /W+A== X-Gm-Message-State: AO0yUKXudeklIeUE6+K+Xq+h9OhVeyMPuV7hwNi5rVsCL9yxn9GjYCL+ RfRku7zOHEI7wXa8ZN6p+Z0r21JMEem23ftS X-Google-Smtp-Source: AK7set/537hGr+ai80Ai5YJaM5YeXYj8ZCHqM0RFPpvD5iqJZDkt3Xlj8MZfSOU0zr4mVd8vMORP8Q== X-Received: by 2002:ac8:5c55:0:b0:3b6:694f:d710 with SMTP id j21-20020ac85c55000000b003b6694fd710mr14794098qtj.50.1677245219971; Fri, 24 Feb 2023 05:26:59 -0800 (PST) Received: from localhost.localdomain (dsl-141-27.b2b2c.ca. [66.158.141.27]) by smtp.gmail.com with ESMTPSA id 66-20020a370345000000b0073ba92629e1sm5239412qkd.23.2023.02.24.05.26.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 05:26:59 -0800 (PST) From: Maxim Cournoyer Date: Fri, 24 Feb 2023 08:26:51 -0500 Message-Id: <20230224132652.4617-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) 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: -1.0 (-) Fixes . * guix/cpio.scm (file->cpio-header): Compute the file name length in bytes rather than in characters. (file->cpio-header*, special-file->cpio-header*): Likewise. (write-cpio-archive): Likewise, and write the file name as UTF-8 bytes, not textually, to avoid encoding it as ISO-8859-1. --- Changes in v2: - Use string-utf8-length guix/cpio.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/cpio.scm b/guix/cpio.scm index d4a7d5f1e0..876f61ea3c 100644 --- a/guix/cpio.scm +++ b/guix/cpio.scm @@ -170,7 +170,7 @@ (define* (file->cpio-header file #:optional (file-name file) #:size (stat:size st) #:dev (stat:dev st) #:rdev (stat:rdev st) - #:name-size (string-length file-name)))) + #:name-size (string-utf8-length file-name)))) (define* (file->cpio-header* file #:optional (file-name file) @@ -182,7 +182,7 @@ (define* (file->cpio-header* file (make-cpio-header #:mode (stat:mode st) #:nlink (stat:nlink st) #:size (stat:size st) - #:name-size (string-length file-name)))) + #:name-size (string-utf8-length file-name)))) (define* (special-file->cpio-header* file device-type @@ -201,7 +201,7 @@ (define* (special-file->cpio-header* file permission-bits) #:nlink 1 #:rdev (device-number device-major device-minor) - #:name-size (string-length file-name))) + #:name-size (string-utf8-length file-name))) (define %trailer "TRAILER!!!") @@ -237,7 +237,7 @@ (define (dump-file file) ;; We're padding the header + following file name + trailing zero, and ;; the header is 110 byte long. - (write-padding (+ 110 1 (string-length file)) port) + (write-padding (+ 110 (string-utf8-length file) 1) port) (case (mode->type (cpio-header-mode header)) ((regular) @@ -246,7 +246,7 @@ (define (dump-file file) (dump-port input port)))) ((symlink) (let ((target (readlink file))) - (put-string port target))) + (put-bytevector port (string->utf8 target)))) ((directory) #t) ((block-special) base-commit: c756c62cfdba8d4079be1ba9e370779b850f16b6 -- 2.39.1 From unknown Sat Jun 14 19:27:56 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Maxim Cournoyer Subject: bug#61722: closed (Re: bug#61722: (guix cpio) produces corrupted archives when there are non-ASCII filenames) Message-ID: References: <875ybpfrps.fsf_-_@gmail.com> <87mt55hy3x.fsf@gmail.com> X-Gnu-PR-Message: they-closed 61722 X-Gnu-PR-Package: guix X-Gnu-PR-Keywords: patch Reply-To: 61722@debbugs.gnu.org Date: Sat, 25 Feb 2023 19:53:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1677354782-12992-1" This is a multi-part message in MIME format... ------------=_1677354782-12992-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61722: (guix cpio) produces corrupted archives when there are non-ASCII fi= lenames which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 61722@debbugs.gnu.org. --=20 61722: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61722 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1677354782-12992-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61722-done) by debbugs.gnu.org; 25 Feb 2023 19:52:24 +0000 Received: from localhost ([127.0.0.1]:41578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pW0al-0003Mi-W3 for submit@debbugs.gnu.org; Sat, 25 Feb 2023 14:52:24 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]:43819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pW0ak-0003MW-3n for 61722-done@debbugs.gnu.org; Sat, 25 Feb 2023 14:52:22 -0500 Received: by mail-qt1-f174.google.com with SMTP id cf14so2867280qtb.10 for <61722-done@debbugs.gnu.org>; Sat, 25 Feb 2023 11:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=GrMjEJE/WWMJKs62T6mYdk7NWtqMBQwwUygudVXmCrM=; b=Fwj1RCS6y29JESKoxs1xFyH2MNWYRjJUcQ3uvXhD3YWp6HhAQmb7IT+7aV7p13hks8 GA+dPtWV7Qbjx9g4/Nb9HxJwxrANayMrTWPKK2QNNv0rhYGkjhfwzwIY2uW8elfRQFhf EK8ZUUnOtktvI/DIkSPkuMyG8QNAnO8Toh7TV1X5tsGvpOtlfoNWq3LqRU4BlNKgBG+v 2VHoKxOebTZCNHN+2r7guvs7B4MSQeKKLEBp3pYbSrOq6f2c4xl8VlOvQuPz9cMkbegu 982NPrjpbDadvkQwDTWiUb4BHAZg3A//x2TIrEcgVE/m75nxT566hVGCjB5QC2uUY3Ju 1F4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GrMjEJE/WWMJKs62T6mYdk7NWtqMBQwwUygudVXmCrM=; b=8SBmQ27DFT6cWSxosKr+40wfGg4CXrF3kJV6X1WXBblCVAqiK6MnFrLpqXdL4EsYDW vrANuLYHjbrWjO5JZxWkYQyHI44OZasQqpDBfVneZJRtHxq4toS89TC12sdqHePCe/V2 Vy/rxJZ/ZdvbB1VjzD5F4+lYObX0pSKXS5/ell9l6AAvhDABUgFR0G8sUo14V1UQ1Tdo 7sOi1mJtabMASWKm52xt8XJl2cWKlrG9YBKkAxXbpng3do2u3e8IjJpDlPZFGv7nvwPS em4Y5bvQUX+jzGciQ1fxQoX9rTkcwsVBDg+UmI3bYY1g9mBiPb9cUsnxl2y0tTMo/8oX uurA== X-Gm-Message-State: AO0yUKXatnERJlqOV4A6KrWmXZO61Hp1KU1NvJMFLTAdpu3lJ1rtBXX3 pwhEwJU61b37rqjQpYfHELA= X-Google-Smtp-Source: AK7set9hIDgd65t7C+GCgCeIig2APN5AJjdOWXr4M0mXXhvy+gCq3dXRMNiMrfBoJwoweW/XfVfQGw== X-Received: by 2002:a05:622a:120d:b0:3b8:67cb:7928 with SMTP id y13-20020a05622a120d00b003b867cb7928mr35362131qtx.31.1677354736664; Sat, 25 Feb 2023 11:52:16 -0800 (PST) Received: from hurd (dsl-141-27.b2b2c.ca. [66.158.141.27]) by smtp.gmail.com with ESMTPSA id r141-20020a37a893000000b00742301f1bfbsm1715422qke.45.2023.02.25.11.52.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 11:52:16 -0800 (PST) From: Maxim Cournoyer To: 61722-done@debbugs.gnu.org Subject: Re: bug#61722: (guix cpio) produces corrupted archives when there are non-ASCII filenames References: <87mt55hy3x.fsf@gmail.com> <20230224132652.4617-1-maxim.cournoyer@gmail.com> Date: Sat, 25 Feb 2023 14:52:15 -0500 In-Reply-To: <20230224132652.4617-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Fri, 24 Feb 2023 08:26:51 -0500") Message-ID: <875ybpfrps.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61722-done Cc: Josselin Poiret , Christopher Baines , Simon Tournier , mhw@netris.org, Ludovic =?utf-8?Q?Court=C3=A8s?= , Tobias Geerinckx-Rice , Ricardo Wurmus , Mathieu Othacehe 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: -1.0 (-) Hi, Maxim Cournoyer writes: > Fixes . > > * guix/cpio.scm (file->cpio-header): Compute the file name length in bytes rather than in > characters. > (file->cpio-header*, special-file->cpio-header*): Likewise. > (write-cpio-archive): Likewise, and write the file name as UTF-8 bytes, not > textually, to avoid encoding it as ISO-8859-1. Pushed to master. Closing. -- Thanks, Maxim ------------=_1677354782-12992-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Feb 2023 03:14:39 +0000 Received: from localhost ([127.0.0.1]:60834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pV246-0008Nf-L5 for submit@debbugs.gnu.org; Wed, 22 Feb 2023 22:14:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:54554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pV241-0008NQ-UA for submit@debbugs.gnu.org; Wed, 22 Feb 2023 22:14:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pV241-0005YV-MP for bug-guix@gnu.org; Wed, 22 Feb 2023 22:14:33 -0500 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pV240-0006bL-3w for bug-guix@gnu.org; Wed, 22 Feb 2023 22:14:33 -0500 Received: by mail-qv1-xf30.google.com with SMTP id y12so10157692qvt.8 for ; Wed, 22 Feb 2023 19:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=QRcVvVA17iiQKw5pgdMGL+zoW7/tlfO/p9aCj1Cvu6M=; b=QpstBq4lhi+HHLH3XQ16xeNgs6mIVOJC3f/dcmxWW4OEppnHOqhtEyKkxaEMcs66E2 DwTteyaGyAs4Buyn7DelYz3fFmx3IhtMYcXQsjaP561XxhJyyBsX7cV495qpb6izKrsA nis9ZCGlo6bhh2Q33ylRyJlj/lJwZtrZGW/FYYCGg0yMkArCdgwSR0NMOdohl6+r4vZm RItHvThu0meFepY0IRpg8h8uNo4W6/I/8zIwu7PQycfqVWt8QGo/6upgYzyFEVZ4iq0N BqBviK1sJdRn1kx8KtDQi0UOyQT8hoJwv1KBm1NR1CRbBHF+ifivqkNjZixwoPmbBbf8 Re4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QRcVvVA17iiQKw5pgdMGL+zoW7/tlfO/p9aCj1Cvu6M=; b=sRNUoTmsTZf5xBOwzsRRnq5ZnicD4kKPgt54lhkdakW0/yAeUNf1KJwMLU6Gn5LUj5 ocUi93Z/bV5/FWaSu87j+CReUyVpLgqfei7Aih9a3IrJbbsCbyo27SRSxagkHJGrY7SP dcRXX/gZ4M9uCNX/pjNirNfnOR9uRdK9SDIzHgGkp0OTRdWWHR+1Zpb3ineI1AHEmIqO qYowWq8m2ilB9K1jinHM5cTx/AK+k4LQmlENzBwR+Vwc1UARadKy/Mu6OrvJubZpLqa7 LE3SaEI0PTsFwJNpSiAQ0zCNYFNX90LWtsx3yrQP/r/VtN+6Wq6lOv6eqz2pV0im9C2z zZPA== X-Gm-Message-State: AO0yUKWxg8yYOCS3Njyj5qForlUfqQGi08ZDNuePyWW81WKLl/wjjK33 eVNgMJDqGJm07R4vxpICvnLq2CHsnoiSHQ== X-Google-Smtp-Source: AK7set/atJAtPiuMPdeZv9n0EHSioXyzyNCKz1d8cBkejNJADtEwN8C7qxu9LEukVD84v1h41qohOA== X-Received: by 2002:ad4:5e8a:0:b0:56e:ad32:2d58 with SMTP id jl10-20020ad45e8a000000b0056ead322d58mr21223815qvb.6.1677122070241; Wed, 22 Feb 2023 19:14:30 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1002]) by smtp.gmail.com with ESMTPSA id a24-20020ac87218000000b003bfa66b7484sm3242491qtp.35.2023.02.22.19.14.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 19:14:29 -0800 (PST) From: Maxim Cournoyer To: bug-guix Subject: (guix cpio) produces corrupted archives when there are non-ASCII filenames Date: Wed, 22 Feb 2023 22:14:26 -0500 Message-ID: <87mt55hy3x.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::f30; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit 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: -2.3 (--) Hi, It appears that the code we have to generate CPIO archives doesn't handle the presence of non-ASCII characters in the file names of files to be archived well: First, to make rpm usable on a Guix System: --8<---------------cut here---------------start------------->8--- # mkdir /var/lib/rpm # chown root:users /var/lib/rpm # chmod g+rw /var/lib/rpm --8<---------------cut here---------------end--------------->8--- Then, produce a problematic CPIO via 'guix pack -f rpm', which uses (guix cpio): --8<---------------cut here---------------start------------->8--- $ rpm_archive=3D$(guix pack -R -C none -f rpm nss-certs) --8<---------------cut here---------------end--------------->8--- Notice that it cannot be installed: --8<---------------cut here---------------start------------->8--- $ mkdir /tmp/nss-certs # rpm --prefix=3D/tmp/nss-certs -i $rpm_archive error: unpacking of archive failed: cpio: Bad magic error: nss-certs-3.81-0.x86_64: install failed --8<---------------cut here---------------end--------------->8--- Let's now inspect the cpio itself. --8<---------------cut here---------------start------------->8--- $ guix shell rpm cpio [env]$ rpm2cpio $rpm_archive > nss-certs.cpio [env]$ cpio -t < nss-certs.cpio |& grep -B3 junk ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/9= 482e63a.0 ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/9= 846683b.0 ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/9= 88a38cb.0 cpio: warning: skipped 248 bytes of junk -- ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/M= icrosoft_RSA_Root_Certificate_Authority_2017.pem ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/N= AVER_Global_Root_Certification_Authority.pem ./gnu/store/1klwvqm3njp070h982ydcix1gzf2zmdl-nss-certs-3.81/etc/ssl/certs/N= etLock_Arany_=3DClass_Gold=3D_F=C5=91tan=C3=BAs=C3=ADtv=C3=A1ny. cpio: warning: skipped 4 bytes of junk --8<---------------cut here---------------end--------------->8--- I haven't yet pin-pointed what the problem is. I could do with extra eyes :-). --=20 Thanks, Maxim ------------=_1677354782-12992-1--