Re: [PATCH 2/3] fdisk: avoid segfault validating a sgi label (boot/swap not set)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/11/14 Karel Zak <kzak@xxxxxxxxxx>:
>> swap_part or boot_part can be set to -1 when they don't exist.
>
>  Applied, thanks... but, how do you know that the number could be
>  smaller than zero? Do you have any example/code?

I would like to read a documentation by SGI before of editing this
code or getting access to a real machine, but I couldn't. This patch
was due to SGI labels generated by libparted, and not to be forced to
point to a partition (set to 0 -> partition 1) looks reasonable to me.
It's possible this is wrong though.

>  It would be nice to cleanup whole fdisksgilabel.c and use
>  be32_to_cpu() and be16_to_cpu() there. (See include/bitops.h).

Yes, I spotted that. SSWAP.() are redefinied in fdisksunlabel.c too.
This looks easy, even without regression tests.

>  I prefer stdint.h types (e.g. int16_t) for things like on-disk
>  labels/superblocks. But it's nothing urgent... whole fdisk should be
>  refactored one day ;-)
>
>  See for example libblkid/src/partitions/sgi.c. (Well, my long-term
>  goal is to use libblkid for partition tables parsing in fdisk.)

It would be nice. My fdisk goal nowadays is to improve a bit the user
interface. Don't count on me about rewriting whole fdisk. :-)

Francesco
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux