<div dir="ltr">yeah, there are fairly-common fs types that toybox blkid currently doesn't know too. ("LVM2_member" and "crypto_LUKS" for example.)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 25, 2021 at 9:41 AM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 9/24/21 7:55 PM, enh via Toybox wrote:<br>
> The unbounded %[] here made me look at the kernel, where the size of a<br>
> block device name is limited to 32 bytes (including the NUL), so<br>
> although the 1024 bytes of toybuf was plenty, that meant that the<br>
> 32-byte buffer for "/dev/%s" was too small because the "%s" alone could<br>
> require the entire buffer. Fix that, and simplify the code a bit by only<br>
> using toybuf for the fgets(). I didn't switch to fscanf() because the<br>
> file has two lines of headers, and calling fgets() twice to skip the<br>
> header seemed more awkward than keeping the continue in the loop.<br>
<br>
I have a todo item to make "file" check the blkid types somehow. Haven't worked<br>
out a clean way to do it yet (plumbing logically moves to lib/getmountlist.c<br>
except that vanished), but I ran toybox "file" against a vfat image and it<br>
unknowned it, which disappointed me.<br>
<br>
Rob<br>
</blockquote></div>