aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/makefs/mtree.c
diff options
context:
space:
mode:
authorStéphane Rochoy <stephane.rochoy@stormshield.eu>2023-09-21 07:14:20 +0000
committerEd Maste <emaste@FreeBSD.org>2023-09-21 16:49:11 +0000
commitd26c1a0f8bceb6748436fe3fc57bac3ef8179dd3 (patch)
treea8eb9a455e879c4b8fc87c44846c11b27f8aea9b /usr.sbin/makefs/mtree.c
parent2303980cfcb1e709c17b108ce66a25a8e7eea337 (diff)
Diffstat (limited to 'usr.sbin/makefs/mtree.c')
-rw-r--r--usr.sbin/makefs/mtree.c5
1 files changed, 4 insertions, 1 deletions
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);
}