W dniu 05.06.2012 09:55, Jean-Pierre André pisze: > Hi, > > Bogdan wrote: >> Hello everybody. >> >> I've prepared a small patch for utils.c and ntfswipe.c: >> - in utils.c, checking for allocated blocks is fixed to pre-fetch >> data on the first run, >> - in ntfswipe.c, wiping file tails in enhanced and wiping undelete >> data is introduced. >> > > Please include your patch to ntfswipe.h (adding the field undel)
Right, I forgot that. Sorry. > I had difficulties compiling your patch, What compiler are you using? > because it is not portable : > > static unsigned const int patterns[NPAT] = > > This is not portable, change to "static const unsigned int" Done. > const int NTFS_BUF_SIZE2 = 8192; > char buf[NTFS_BUF_SIZE2]; > > This is not portable, change to a good old "#define" > > const int NTFS_BUF_SIZE2 = 4096; > > same, and as this is a different value, an explanation to what both > values mean may be useful. Yes, it would be. You may ask the author, because these declarations aren't a part of my patch and I don't know why there are 2 separate variables with different values. > a_offset = ((u32) ctx->attr + le16_to_cpu (ctx->attr->value_offset) ); > > ctx->attr is a pointer, which cannot fit into a u32 on a 64-bit computer, > change the u32 to an unsigned char*, and change a_offset accordingly. > Also, is this an offset or a pointer ? Pointer. Changed now. > fill_buffer ( pass, (unsigned char *) a_offset, ctx->attr->value_length, > > value_length is a le32, it cannot be cast to a size_t, it has to be > le32_to_cpu'ed, also the cast to unsigned char* is not needed if > a_offset is properly defined. Done. > fill_buffer ( pass, (unsigned char *) ctx->attr->value_length, > sizeof(u32), > > What does this mean ? you cannot ever cast an le32 to a pointer. It was done properly in another place and forgotten here. Fixed. > ret = ntfs_rl_pread(vol, na->rl, offset, 2, &block_size); > block_size = le16_to_cpu(block_size); > > This creates confusion, as block_size has a couple of representations. > Please use another variable such as : > > le16 block_size_le; > ret = ntfs_rl_pread(vol, na->rl, offset, 2, &block_size_le); > block_size = le16_to_cpu(block_size_le); > > indx_record_size = le32_to_cpu(indx_record_size); > > Same issue as above. Also not my changes. I don't know what should these variables contain. The second version of the patch is attached. Please check it. -- Pozdrawiam/Regards - Bogdan (GNU/Linux & FreeDOS) Kurs asemblera x86 (DOS, GNU/Linux):http://rudy.mif.pg.gda.pl/~bogdro Grupy dyskusyjne o asm: pl.comp.lang.asm alt.pl.asm alt.pl.asm.win32 www.Xiph.org www.TorProject.org Soft (EN): miniurl.pl/bogdro-soft
ntfs-utils-fix-ntfswipe-v2.diff.gz
Description: GNU Zip compressed data
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ ntfs-3g-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel
