[Toybox] blkid fixed for strict-alias

Conroy, Bradley Quentin bconroy at uis.edu
Wed Oct 9 01:25:27 PDT 2013


>Sort of moot at this point, I did a largeish rewrite. (Attached, I
>should be able to rsync it up to the site tonight.)

I'll wait on recoding it with the union of structs pointing to toybuf then.
That would take care of the strict aliasing, reduced the memory foot-
print and simplified a bunch of code, but I'm interested to see how
you did it.

>There are currently three obvious problems with it, all to do with vfat:
>
>1) it always prints a LABEL even if it's all spaces or the magic "NO
>LABEL" value.

I think it is safe to check *offset==' ', but "NO LABEL"? really?  Who
does that?  I think I would consider that disk to be labeled.

>2) The funky 32 bit uuid is printed big endian, when the other prints
>it little endian.

Yeah, fun stuff.  There isn't a lot of conformity there either.

>3) It prints the uuid hex all lower case, where vfat is uppercase and
>ext2 is lowercase. (Sigh.)

That is why I had %X in one and %x in the other.  At least with a union
of structs you can just use sizeof(fs->something.uuid) to get the size
and data, but still have to track these nuances by masking some flags.
  labelisUCS = 1
  backwarduuid = 2
  capsuuid=4
  halfbackwarduuid=8 (i think there is some other wierd nuance)
  spaceisblanklabel=16
  ...

>(And of course I haven't implemented the suid zero argument behavior
>yet.)

It didn't even occur to me, I have only used blkid and fstype on Puppy
(which defaults as root)

R,
Brad
 1381307127.0


More information about the Toybox mailing list