From nobody Thu Sep 21 16:49:19 2023 X-Original-To: dev-commits-src-main@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 4Rs1Zl4z5nz4thDb; Thu, 21 Sep 2023 16:49:19 +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 4Rs1Zl4Tsjz4Ytq; Thu, 21 Sep 2023 16:49:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695314959; 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=8Js7D+cklZJpRZZsiln5M7/Y+nF5iNNChCaT4McqBts=; b=D00lGoYsNjbjx6LQzbE49lKjz2spZYaM+8VvSPilbHNnjQNfgDBeS1e3FJm/k4TZ/F4Cwc zXEhdGaVjkANTvTXbXr6WccrVTq92R2IOc5oLpcQr9CJhnHPvfCKoU5rCcmhqIE3BcixfU pPOXW5lvgve6o089SOePZJKjC7taG0J5AewsnsB7Mli3y+is6W7LwXfX3GlFMXnv3Zkt9p yRAsn2O1kO6TfYvrINKToW/dCVgvLwR41lqa9nnJ7yyii2MY9tHROE2GFMx+l4+HKUCMy4 nGm+8PSYNWV8xehj9VGHuPTdwDCSmveS2u0D1aVb1PwWj8uyv8UIE1YiCzOqWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695314959; a=rsa-sha256; cv=none; b=LlsMxvq5u+tWX6p7kROOF4PPYFiSaKRHTf8UIYVrFLcv7FEv7kqYj6HEI1IdJ5jQzYMalp W3ussOkwqtfOh20afaUg3ItlhHfmS0Px1y9JOIu+xbGxwnNYvLvrZdHSf//kPKGeD8uQSX 2qL2XZB7ER78Gsb5ftUxs41KARVW8gtr+gExxrPgnABQtPSfXZwUzS12OKTiQ7od11NASm dyi0ebJRGQj0d2aCsNChGx2SAS50RTx/14DdnK10s+F2du9R00Bewtg3JlZghAITTf2VDH vcmkF8fyGTZOUi05iaAhHjEnt9owFIgbHF6RQIVCMSnXbXjp9NkvTgkK7TUItQ== 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=1695314959; 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=8Js7D+cklZJpRZZsiln5M7/Y+nF5iNNChCaT4McqBts=; b=MyCSmEdq+5JIp15TpEyMsDb0LtwmnTRuZkCRiN8lwBRzS2QsXQQCm4efBb5yLc9DfWGPIJ RvXv8hKPoGGiaqGstt3OpLbT/NVv6JuyvJTkp7E06I9PyR29H4fM1Bt6j8oJyWRshf9/C3 f+z+TryV1Bb2WLmaXxjhtAlGSbMppFZ3bZY95r50RX7S3jqoYhzIPMvfqj+81ynMVETozE ZMaS7fJcp+Xi7LZ6UUjg/EL0/+dGVo8Z7lW2lmOBuZoZOFKasQ+6qdrYkg6qQey00jXAYm I01yTMqOojsYbkDuzWripk4Mu8WhnsZUufGDvgjDoRoF8Ff/EThr9e1iwfukZw== 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 4Rs1Zl3Wn3zmdg; Thu, 21 Sep 2023 16:49:19 +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 38LGnJKK024516; Thu, 21 Sep 2023 16:49:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38LGnJ6Q024513; Thu, 21 Sep 2023 16:49:19 GMT (envelope-from git) Date: Thu, 21 Sep 2023 16:49:19 GMT Message-Id: <202309211649.38LGnJ6Q024513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d26c1a0f8bce - main - makefs: Handle missing link keyword in mtree spec List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d26c1a0f8bceb6748436fe3fc57bac3ef8179dd3 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d26c1a0f8bceb6748436fe3fc57bac3ef8179dd3 commit d26c1a0f8bceb6748436fe3fc57bac3ef8179dd3 Author: Stéphane Rochoy AuthorDate: 2023-09-21 07:14:20 +0000 Commit: Ed Maste CommitDate: 2023-09-21 16:49:11 +0000 makefs: Handle missing link keyword in mtree spec PR: 241178 Reviewed by: emaste MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/850 --- usr.sbin/makefs/mtree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c index 45588e202542..3e62afbc1137 100644 --- a/usr.sbin/makefs/mtree.c +++ b/usr.sbin/makefs/mtree.c @@ -740,7 +740,10 @@ read_mtree_keywords(FILE *fp, fsnode *node) type = S_IFREG; } else if (node->type != 0) { type = node->type; - if (type == S_IFREG) { + if (type == S_IFLNK && node->symlink == NULL) { + mtree_error("%s: link type requires link keyword", node->name); + return (0); + } else if (type == S_IFREG) { /* the named path is the default contents */ node->contents = mtree_file_path(node); }