[syslinux] isohybrid has 2 variants

Thomas Schmitt scdbackup at gmx.net
Sun Jun 22 05:37:07 PDT 2014


Hi,

Ady:
> > >  http://www.syslinux.org/archives/2014-June/022259.html 

me:
> > Already reported in may and diagnosed by hpa:
> > http://www.syslinux.org/archives/2014-May/022041.html:
> > > The right thing to do is compile it with #define _FILE_OFFSET_BITS 64
> > > and change fseek to fseeko with the appropriate type being off_t.

Ady: 
> This has been already applied in the Syslinux git (zytor repo).

The replacement of fseek(3) by fseeko(3) has not happened.
Only the sizeof(off_t) has been forced to 64 bit on 32 bit systems
in Makefile by
  CFLAGS   = ... -D_FILE_OFFSET_BITS=64 ...

Thus above message and patch of Kai Kang should be considered.
(The patch looks ok to me.)


Other occurences of fseek() might cause problems too.
Each change to fseeko() has to be checked, whether the type of
the offset argument is indeed off_t.

Example: 
  uint32_t catoffset = 0;
  ...
      if (fseek(fp, catoffset * 2048, SEEK_SET))

The call has to become something like

      if (fseeko(fp, ((off_t) catoffset) * 2048, SEEK_SET))

Adresses which are surely smaller than 31 bit could be left
unchanged.
E.g.:
      if (fseek(fp, 17 * 2048, SEEK_SET))

Kai Kang's change is already (off_t), because of isostat.st_size
as of man 2 stat.


Have a nice day :)

Thomas



More information about the Syslinux mailing list