Re: Bug in date converting functions DOS<=>UNIX in FAT, NCPFS and SMBFS drivers

From: Urban Widmark (urban@teststation.com)
Date: Tue Nov 28 2000 - 13:26:12 EST


On Fri, 24 Nov 2000, Igor Yu. Zhbanov wrote:

> Hello!

Hello, sorry for the slow response.

> I have found a bug in drivers of file systems which use a DOS-like format
> of date (16 bit: years since 1980 - 7 bits, month - 4 bits, day - 5 bits).

[snip]

> 2) VFAT for example have three kinds of dates: creation date, modification date
> and access date. Sometimes one of these dates is set to zero (which indicates
> that this date is not set). Zero is not a valid date (e.g. months are
> numbered from one, not from zero) and can't be properly converted to
> UNIX-like format of date (it was converted to date before 1980).

Days are also numbered from one (at least smbfs) and this change doesn't
do anything about that. An all zero date gives 315446400 (or else my
testprogram is broken) and you wanted it to give 315532800 (?). So that
should be fixed too, I think.

It would be nice if someone would rewrite these shift-and-mask orgies into
something with a bit more structure (bitfields? hmm, endianess problems?
undefined compiler behaviour? I don't know ... macros?).

I'm having trouble following these, but maybe that's just me.

/Urban

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Nov 30 2000 - 21:00:20 EST