Re: [Afpfs-ng-devel] length of volumename is wrong
Status: Alpha
Brought to you by:
alexthepuffin
From: Alex d. <ale...@gm...> - 2008-07-16 19:00:46
|
HAT, Thanks for going through this. I'll make the appropriate changes in CVS soon. Most of them are pretty obvious. Some comments on some of the broken items: On 16-Jul-08, at 1:16 PM, HAT wrote: > > Your sources are not clear which bare string or Pascal string. > Pascal string include leading one byte. All these string lengths are for non-pascal strings. > ------------------------------------------------------- > #define AFP_LOGINMESG_LEN > > Apple Filing Protocol Reference > Page 100 > >> The usual size of any of these messages is 200 bytes including >> the length byte (a Str199). >> AFP 3.x clients can request that the server send longer attention >> messages by setting the attention quantum size in the Option field >> of the DSOpenSession command (described in the document Apple Filing >> Protocol Client). > > #define AFP_LOGINMESG_LEN 199 or 200 ??? > > If UTF8 string is 200 over, this should be disregarded. > > or > > #define AFP_LOGINMESG_UTF8_LEN 65535 Is there such a thing as a UTF8 login message? In reality, I've never seen a DSIAttention message that had anything in it (except for the login message). I think I'll leave this at 199. > ------------------------------------------------------- > #define AFP_VOLPASS_LEN 8 > > maybe, ok. > > If DHX, 255. Well, with DHX the volume password isn't really a volume password; it is done by authenticating with any username and a password. So I think this definition is correct . > ------------------------------------------------------- > #define AFP_MAX_PASSWORD_LEN > > maybe, 255 > > If cleartext or random number exchange, it is 8. Okay, that's a UAM-specific change. I'll delve into that code to see if that's respected. > > ------------------------------------------------------- > >> There is a larger problem with filenames, I have a maximum filename >> length of 255 bytes, but in reality the length is up to 16 bits. In >> many places I preallocate the space for the filename, which is fine >> for a small number, but there are many places I don't want to >> allocate >> 64k. Changing this requires a lot of rework of anything that >> allocates space that references a filename. This is left for a >> later >> release. I expect you'll hit this too. > > I will explain it after tomorrow. Yeah, this is a lot of work to redo this, and not the highest item on my list. It also needs to be done in an AFP version specific way. - Alex |