The branch stable/13 has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d8d0ecd9739d5201c6d56d1a898b95f7ce35bdf5

commit d8d0ecd9739d5201c6d56d1a898b95f7ce35bdf5
Author:     Stéphane Rochoy <[email protected]>
AuthorDate: 2023-09-21 07:14:20 +0000
Commit:     Ed Maste <[email protected]>
CommitDate: 2024-01-22 14:28:57 +0000

    makefs: Handle missing link keyword in mtree spec
    
    PR:             241178
    Reviewed by:    emaste
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/850
    
    (cherry picked from commit d26c1a0f8bceb6748436fe3fc57bac3ef8179dd3)
    (cherry picked from commit be31bd59895e57fb7359de870ea3ecc19e3d1ae1)
---
 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 688ce81e733d..1fe2eb4097b2 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);
                }

Reply via email to