Re: [Bug#324755: mc: tar archives greater than 2GB not supported] (fwd)



Hello,

Forwarding the message to mc-devel at gnome dot org where it belongs.
Please, keep the discussion public.

---------- Forwarded message ----------
Date: Thu, 25 Aug 2005 14:54:55 +0200
From: Michael Mueller
To: Pavel Tsekov
Subject: Re: [Bug#324755: mc: tar archives greater than 2GB not supported]

Hi Pavel,

you wrote to Stefano Melchior:
>This seems to be a much needed patch indeed. I haven't applied it nor
>tested it - just took a look at it. I noticed something that might need
>to be fixed in the 3rd  hunk of tar.c patch:
>
>@@ -642,8 +642,9 @@
>     int fd = FH_SUPER->u.arch.fd;
>     struct vfs_class *me = FH_SUPER->me;
>
>-    if (mc_lseek (fd, begin + FH->pos, SEEK_SET) !=
>-        begin + FH->pos) ERRNOR (EIO, -1);
>+
>+    off_t o = mc_lseek(fd, begin + FH->pos, SEEK_SET);
>+    if ( o != begin + FH->pos) ERRNOR (EIO, -1);
>
>     count = MIN(count, FH->ino->st.st_size - FH->pos);
>
>The type of FH->pos is not off_t but long. See struct vfs_s_fh in
>vfs/xdirentry.h .

Yes, I did notice this before. This should make it impossible to read
files bigger than 2GB from inside the archive. I simply stopped there
because now it is working for me, which is sufficient for a local patch ;)
However, from the findings in the code it seems to be sufficient to
change the definition of 'ofs' in the structs definition.

Btw, the chunk you quoted is not really needed, just used the temporary
variable ('o') for debugging purpose. The result of mc_lseek is off_t
with this patch and (begin + FH->pos) should give an integer the size of
off_t too. So comparing them directly - as was before - should give the
same code in result.


With best regards
Michael Müller



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]