On 28.08.2007 17:12, ron minnich wrote:
> On 8/28/07, Carl-Daniel Hailfinger <[EMAIL PROTECTED]> wrote:
>
>> Can we change the MAGIC to some less likely string, perhaps even with
>> version info? A lot of filesystems have mixed-case magic strings, for
>> example ReiserFS has "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs". Nobody is
>> going to include such a string by accident in his code.
>
> That's not the real problem. The real problem is that if you do this:
> char *c = MAGIC;
>
> Then that string is in the data space of linuxbois. If it ever gets to
> be 16-byte aligned, the find_file in lar will think it has found a
> header. I just realized stefan's fix might solve the problem. But we
> can add his fix later.
Can't we do that in an easier way? Idea:
struct {
char misalign[1];
char magic[8];
} lar_magic __attribute__ ((aligned(16))) = {
0, "LARCHIVE"
};
That should guarantee the string to be always misaligned.
Regards,
Carl-Daniel
--
linuxbios mailing list
[email protected]
http://www.linuxbios.org/mailman/listinfo/linuxbios