source: patches/util-linux-2.12r-gcc41_sun_disklabel_fixes-1.patch@ 976b40a

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 976b40a was 5c5752c, checked in by Jim Gifford <clfs@…>, 19 years ago

Added: sun disklabel patches. Tar Security Patch.

  • Property mode set to 100644
File size: 1.0 KB
  • fdisk/fdisksunlabel.c

    Submitted By: Joe Ciccone <joeciccone at crazyeyesoft dot com>
    Date: 2006-04-14
    Initial Package Version: 2.12r
    Upstream Status: Sent
    Origin: Joe Ciccone
    Description: This patch fixes fdisk so that it can properly calculate the
                 checksum of a sun disklabel.
    
    old new  
    118118int
    119119check_sun_label(void) {
    120120        unsigned short *ush;
    121         int csum;
     121        int csum = 0;
    122122
    123123        if (sunlabel->magic != SUN_LABEL_MAGIC &&
    124124            sunlabel->magic != SUN_LABEL_MAGIC_SWAPPED) {
     
    128128        }
    129129        other_endian = (sunlabel->magic == SUN_LABEL_MAGIC_SWAPPED);
    130130        ush = ((unsigned short *) (sunlabel + 1)) - 1;
    131         for (csum = 0; ush >= (unsigned short *)sunlabel;) csum ^= *ush--;
     131        while (ush < (unsigned short *)sunlabel) csum ^= *ush--;
    132132        if (csum) {
    133133                fprintf(stderr,_("Detected sun disklabel with wrong checksum.\n"
    134134                                "Probably you'll have to set all the values,\n"
Note: See TracBrowser for help on using the repository browser.