From nobody Wed Apr 03 09:59:33 2024 X-Original-To: dev-commits-src-all@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 4V8gFy1z0sz5GSsg; Wed, 3 Apr 2024 09:59:34 +0000 (UTC) (envelope-from git@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 4V8gFx5d59z45Ys; Wed, 3 Apr 2024 09:59:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712138373; 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; bh=grkLCKtSiawLGUkJqqjSukpSR1aLH0CD62ClqUQS6Lg=; b=vOCHZydw6TmP7V2EtHHY0YETfb3W3zMjZ0c2b44IpRQeWv69W90+MVw9UKN/xHU8vMWYEc Bmlzh6BEg6GBJnBSHKEuIaxvxys8mRWivEp2aEpou5gocy7343CQY+q07xA4qXY+G1XC3X oHPHWGJtsN4GBK3IRTmRFNy3mm3bhBeCHM3uP2EZGS/2eOlpt8BfBA3NoSZNZgK2eU6sy7 buLf0K84x12x75nO+1nNJd9fkf8Smf+yNTb1TDUdpkRvJcE2R5YHG5oTmKfK7BX78rHHdp 7dZrttJkoBr7e7PrXRSraAo05lsFMZhu6bjjwUJivJD1WhjmqGmDszI/cQVpAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712138373; a=rsa-sha256; cv=none; b=hCE4u+s+eKOTG2zJ1nc4soAlMY+jeR+tA4wGg2zDj0qG8jF9wg0bsBEF8c0vIUxwo/zWjQ dvTz/Xy0xu+Z4/RyBwcEtBcQk1IIRpC+2dGSLJR9vgVQwDNczybM44HUypGTuc2jF8+eaD LpJ6b9Da5mCJXXLHAHYO7eBGrwd5qe8n+2zAJWWVgDi1cbiEBaHuKatMugUrQsDhPwUQ9L ehcr5/MrolSGgoXPJwJVpToyH5dMA9n6Aunyfz5UbWBnFSxK1EQzuLxbC4w/wl6+ZvIm1W 45/vZH3ua/a7gG/ySFq4xQJO7+L6Wm9zkXdjUcPKuDcAE2UikRY6SZrskI+A7Q== 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=1712138373; 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; bh=grkLCKtSiawLGUkJqqjSukpSR1aLH0CD62ClqUQS6Lg=; b=Qrn/RrxuhGS2d0uxhWiHvM7kJYl0OZmBfH/CeamNW9OMvLys1nLogyKDT3NEm2MXIw+4Ir KcD+KMUwjVYnTgRxGzV7lrVu9ownd8aYmNkgTubSUPlS9mcw44LZ/EocyPoJL9x6U0UrIX ZYPY9XbYjBf734EBZoLyY25ebiBZJD1YmFAzm4VzamAx3R5V1x8NcHIxGh6CGnp9TzXWpz oBrY3HmtNcve8gRMnqNpUxhhw3l86o0Hh38qyqfnKif9F/HzyfFwha9x4ZpZF2x+LFnJZn 22uTj5V/hjsF+do9sHQxBKPWFPkJQYtBXfBp7DXoOD3VacbyX9G5uldPavSqkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4V8gFx56xyzS5f; Wed, 3 Apr 2024 09:59:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4339xXHu052942; Wed, 3 Apr 2024 09:59:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4339xXOw052940; Wed, 3 Apr 2024 09:59:33 GMT (envelope-from git) Date: Wed, 3 Apr 2024 09:59:33 GMT Message-Id: <202404030959.4339xXOw052940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b1fd95c9e247 - main - tarfs: Support paths that spill into exthdrs. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1fd95c9e24791d44593e611406b41e57826a5b8 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b1fd95c9e24791d44593e611406b41e57826a5b8 commit b1fd95c9e24791d44593e611406b41e57826a5b8 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-03 09:55:01 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-03 09:55:01 +0000 tarfs: Support paths that spill into exthdrs. MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44599 --- sys/fs/tarfs/tarfs_vfsops.c | 7 +++++- tests/sys/fs/tarfs/tarfs_test.sh | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index d1af7070e706..df657fb13414 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -614,7 +614,10 @@ again: value = sep + 1; TARFS_DPF(ALLOC, "%s: exthdr %s=%s\n", __func__, key, value); - if (strcmp(key, "linkpath") == 0) { + if (strcmp(key, "path") == 0) { + name = value; + namelen = eol - value; + } else if (strcmp(key, "linkpath") == 0) { link = value; linklen = eol - value; } else if (strcmp(key, "GNU.sparse.major") == 0) { @@ -905,6 +908,8 @@ tarfs_alloc_mount(struct mount *mp, struct vnode *vp, blknum = 0; do { if ((error = tarfs_alloc_one(tmp, &blknum)) != 0) { + printf("unsupported or corrupt tar file at %zu\n", + TARFS_BLOCKSIZE * blknum); goto bad; } } while (blknum != TAR_EOF); diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index 2a5dfc434201..5d3fbca2f4ee 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -309,6 +309,54 @@ tarfs_checksum_cleanup() { tarfs_cleanup } +atf_test_case tarfs_long_names cleanup +tarfs_long_names_head() { + atf_set "descr" "Verify that tarfs supports long file names" + atf_set "require.user" "root" +} +tarfs_long_names_body() { + tarfs_setup + local a b c d e + a="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + b="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + c="cccccccccccccccccccccccccccccccccccccccc" + d="dddddddddddddddddddddddddddddddddddddddd" + e="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + mkdir -p "${a}" + touch "${a}/${b}_${c}_${d}_${e}_foo" + ln "${a}/${b}_${c}_${d}_${e}_foo" "${a}/${b}_${c}_${d}_${e}_bar" + ln -s "${b}_${c}_${d}_${e}_bar" "${a}/${b}_${c}_${d}_${e}_baz" + tar -cf tarfs_long_names.tar "${a}" + atf_check mount -rt tarfs tarfs_long_names.tar "${mnt}" +} +tarfs_long_names_cleanup() { + tarfs_cleanup +} + +atf_test_case tarfs_long_paths cleanup +tarfs_long_paths_head() { + atf_set "descr" "Verify that tarfs supports long paths" + atf_set "require.user" "root" +} +tarfs_long_paths_body() { + tarfs_setup + local a b c d e + a="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + b="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + c="cccccccccccccccccccccccccccccccccccccccc" + d="dddddddddddddddddddddddddddddddddddddddd" + e="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + mkdir -p "${a}/${b}/${c}/${d}/${e}" + touch "${a}/${b}/${c}/${d}/${e}/foo" + ln "${a}/${b}/${c}/${d}/${e}/foo" "${a}/${b}/${c}/${d}/${e}/bar" + ln -s "${b}/${c}/${d}/${e}/bar" "${a}/baz" + tar -cf tarfs_long_paths.tar "${a}" + atf_check mount -rt tarfs tarfs_long_paths.tar "${mnt}" +} +tarfs_long_paths_cleanup() { + tarfs_cleanup +} + atf_init_test_cases() { atf_add_test_case tarfs_basic atf_add_test_case tarfs_basic_gnu @@ -324,4 +372,6 @@ atf_init_test_cases() { atf_add_test_case tarfs_linktodir atf_add_test_case tarfs_linktononexistent atf_add_test_case tarfs_checksum + atf_add_test_case tarfs_long_names + atf_add_test_case tarfs_long_paths }