From nobody Fri Jun 21 16:44:06 2024 X-Original-To: bugs@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 4W5NVG0TWsz5NxGc for ; Fri, 21 Jun 2024 16:44:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W5NVF6WPzz456t for ; Fri, 21 Jun 2024 16:44:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718988245; a=rsa-sha256; cv=none; b=ObVrNKKeE59x5UjnqhKPI4gpXjNjLGDig4rgr96NohI2h8+zZ2KBmdAX70y4dqVll6/13c XX3bQa/dKMJQM6q0uhCTIyJjxC04iIotRxNlRmqcbwK73o3DH7xSfQldEYVUPIUxZmVyHR q24lfCl5KVEUz9WfrnGYJ80ELGJgbZpj7TTx2bqMjqLMK7s+FdWLwYzIg/9e3gm/fdCkBk llI8iZLgU8dBzolEbgWEd5t0hd1c/+XSlvQTJYQQlHiUCwPOxzWh6GC7zmN7MYP/MMI+PH e+6r3S3qkSbMpVu2Kppp8ksW3lOtLE4Np/pu/nqhBjx/eFxgtE6UfreQp6VJhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718988245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q0QQXKEe77JhDJWs4tdsYBBDb3nEqQ1P1JBV0gxl6tk=; b=GHh4fDWK7x93qQ65n3z6VO+ZKMUNwNm/Dab7k3tcZUsspuDBgzhyENn9NG3jqphmWYf+5G ywQhApUFDaj1z7gpaUHi4ziRrUqGbjxP4k24of5DDYAhYmnemapAADnB8hTsDoxoFaFsEt vvFMixhmQYVRGSR6Z7NYaNCH8Bzi8kNiA77GAQFcbWIf4P8q7FMhV4pBEo83g8C4jnJ3ra R/2lPJXEfZ6+l4htDigv3Jl1pDuj4K+FYmfclnTlY/sa2IaQWdecE+2PteT3sayMrRn/P4 KULFrWPS2hXmeXoUsiASsvqo4FvNrtpPbo0zgO/LrW4MyZKgJNxbiVxtnEiGuw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W5NVF64QpzGC3 for ; Fri, 21 Jun 2024 16:44:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 45LGi5PK041414 for ; Fri, 21 Jun 2024 16:44:05 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 45LGi5tX041413 for bugs@FreeBSD.org; Fri, 21 Jun 2024 16:44:05 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 277060] pax(1) hangs when copying directories with a trailing slash Date: Fri, 21 Jun 2024 16:44:06 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch-ready X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277060 --- Comment #5 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D681fd2bed8eaba88693867ba928a1c03a= 5b152cc commit 681fd2bed8eaba88693867ba928a1c03a5b152cc Author: Ganael Laplanche AuthorDate: 2024-06-21 16:39:09 +0000 Commit: Warner Losh CommitDate: 2024-06-21 16:39:09 +0000 pax: Terminate loop for empty directory names Pax can sometimes loop forever. For example: $ mkdir -p /tmp/src/foo/bar $ rm -rf /tmp/dst ; mkdir -p /tmp/dst $ cd /tmp/src $ echo 'foo/bar/' | /bin/pax -r -w -d -pe "/tmp/dst" Here, pax(1) infinitely deletes and re-creates /tmp/dst/foo/bar/. The problem is that chk_path() (bin/pax/file_subs.c), called from node_creat() also creates the leaf directory when a trailing '/' appears in the directory name to create. When the execution goes back from chk_path() to node_creat(), the function still cannot create the leaf directory (it has been created by chk_path()), so it unlinks it and calls node_creat() again. The function re-creates it, and so on... In node_creat() detect trailing slashes and not create a leaf directory, but only intermediate ones. PR: 277060 Reviewed by: imp bin/pax/file_subs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --=20 You are receiving this mail because: You are the assignee for the bug.=