On Thu, 2004-02-26 at 11:21, Szakacsits Szabolcs wrote:
> Adding NTFS 3.1 support would be also wonderful. There aren't many changes
> compared to NTFS 1.2 and this could help _a lot_ to make (automatic)
> testing and development easier. There wouldn't be need to get XP images,
> we could create whenever we need.
Huh? I never added NTFS 3.x support because any form of Windows 2k or
later will just upgrade the volume on mount so it seems silly to have
mkntfs more complicated. Also, even Windows actually creates NTFS 1
partitions which are then upgraded on mount... (At least this used to
be the case for older windows no idea about the latest incarnations.)
> > so I committed this fix instead:
> >
> > diff -Nru a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c
> > --- a/ntfsprogs/mkntfs.c Thu Feb 26 09:19:33 2004
> > +++ b/ntfsprogs/mkntfs.c Thu Feb 26 09:19:33 2004
> > @@ -567,8 +567,10 @@
> > char c;
> > int i;
> >
> > - /* Need two bytes for null terminator. */
> > - maxlen -= 2;
> > + /* Convert maxlen from bytes to unicode characters. */
> > + maxlen /= sizeof(uchar_t);
> > + /* Need space for null terminator. */
> > + maxlen--;
> > for (i = 0; i < maxlen; i++) {
>
> This is still wrong. If maxlen was <= 1 and src was bigger, then we have a
> buffer overflow (currently it never should occure as Anton also pointed
> out). Only Andras 3rd solution was correct.
Oh yes, the dest[i] at the bottom... The 3rd solution is still not
correct though. Have committed a fix to my fix:
if (maxlen < sizeof(uchar_t)) {
errno = EINVAL;
return -1;
}
and added the following to the function comment:
If @maxlen is less than the size of a single unicode character we cannot
write the terminating null unicode character and hence return -1 with
errno set to EINVAL.
Note that returning zero is wrong in that case because no terminating
NULL has been written.
> Please note, the coding style is the
>
> ntfsprogs/doc/CodingStyle
> kernel/Documentation/CodingStyle
Oh yes, I forgot to point this out! Thanks!
> Code can easily end up in the kernel in the future. The most often used
Indeed.
> > > * @param dst [out] points the buffer to receive the unicode string
> > > * @param src [in] points the char string to be converted
> > > * @param size [in] size of the @dst buffer in bytes
>
> The [in|out]'s are _very_ important. I also always missed them.
Fair enough, we can add them but we can still please use this form:
@dst: description [OUT]
@src: description2 [IN]
@size: description3 [IN]
Also is @dst really [OUT]? To me it seems like @dst is [IN] but *@dst
is [OUT]...
I hate this [IN] and [OUT] stuff but if you like them feel free to add
them but _please_ at the end of the lines so I can just ignore them when
reading...
> > In case you didn't know we keep the latest sources in BitKeeper on
> > linux-ntfs.bkbits.net.
>
> Sometimes there are source snapshots on
>
> http://linux-ntfs.sourceforge.net/snapshots/
>
> ntfsprogs-<date> is the current ntfsprogs 1.8.x serial
> ntfsprogs-devel-<date> is the current ntfsprogs 1.9.x serial
Once again, I forgot about these. Thanks! I have also uploaded the
most recent code snapshots just now.
> > A small howto. Set parent to: bk://linux-ntfs.bkbits.net/ntfsprogs
> > (or ntfsprogs-devel obviously), i.e. just "bk clone -q
> > bk://linux-ntfs.bbkits.net/ntfsprogs" which creates ntfsprogs directory
> > in your current working directory. Preferably work on ntfsprogs not
> > ntfsprogs-devel,
>
> after "bk clone ..." you must do a "bk get" and/or "bk edit" otherwise you
> can't version control, edit the files.
You just need to do "bk -r edit" anywhere inside ntfsprogs or
ntfsprogs-devel repositories and all of your files in that repository
will be checked out and can be written to. This was supposed to happen
automatically but it stopped working for some reason... )-: You also
need to do this after each "bk citool" or "bk ci" followed by "bk
commit".
> BitKeeper has short intros, guides at http://www.bitkeeper.com/
>
> Of course you're not required/forced to use BitKeeper. E.g. I use my CVS
> and BitKeeper only when needed.
Yes of course. Feel free to just use the snapshots and email normal GNU
diff -urNp patches.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ &
http://www-stu.christs.cam.ac.uk/~aia21/
|