Bug 241178 - makefs segfault when manifest include symlinks without the link keyword
Summary: makefs segfault when manifest include symlinks without the link keyword
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-10-10 12:41 UTC by Stéphane Rochoy
Modified: 2019-10-17 18:54 UTC (History)
1 user (show)

See Also:


Attachments
link type require the link keyword (594 bytes, patch)
2019-10-10 12:41 UTC, Stéphane Rochoy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Rochoy 2019-10-10 12:41:21 UTC
Created attachment 208226 [details]
link type require the link keyword

With a directory d/ containing the following 2 files:

    -rw-r--r--  1 root  wheel  14 Oct 10 11:55 hello.txt
    lrwxr-xr-x  1 root  wheel   9 Oct 10 11:55 world.txt -> hello.txt

using mtree to build a manifest as follow:

    mtree -ck mode -p ./d | mtree -C > no-link-kw.makefs-manifest

here is the resulting manifest:    
    
    . type=dir mode=0755
    ./hello.txt type=file mode=0644
    ./world.txt type=link mode=0755

running makefs as follow lead to segfault:

    cd d
    makefs -t ffs -o optimization=space -o version=2 ../no-link-kw.img ../no-link-kw.makefs-manifest

Attached is a small fix that ensure makefs will complain about the missing link keyword when facing a link type node.