Re: [EMAIL PROTECTED]: Bug#324755: mc: tar archives greater than 2GB not supported]

2005-08-25 Thread Leonard den Ottolander
Hi,

On Wed, 2005-08-24 at 06:36 +0200, Stefano Melchior wrote:
 +off_t result;

 +if (result == (off_t)-1)

Is this cast of -1 necessary as result already is an off_t?

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [EMAIL PROTECTED]: Bug#324755: mc: tar archives greater than 2GB not supported]

2005-08-24 Thread Pavel Tsekov
Hello,

On Wed, 24 Aug 2005, Stefano Melchior wrote:

 Hi Pavel,
 Michael, a Debian GNU/Linux user, reported this bug and suggested the
 following patch for the same.
 I soon would like to infor you and the `mc-devel` list about this.
 Thank you in advance

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 .
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


[EMAIL PROTECTED]: Bug#324755: mc: tar archives greater than 2GB not supported]

2005-08-23 Thread Stefano Melchior
Hi Pavel,
Michael, a Debian GNU/Linux user, reported this bug and suggested the
following patch for the same.
I soon would like to infor you and the `mc-devel` list about this.
Thank you in advance

Cheers

SteX

- Forwarded message from Michael Mueller [EMAIL PROTECTED] -

Date: Tue, 23 Aug 2005 21:50:35 +0200
From: Michael Mueller [EMAIL PROTECTED]
To: Stefano Melchior [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Bug#324755: mc: tar archives greater than 2GB not supported
Reply-To: Michael Mueller [EMAIL PROTECTED], [EMAIL PROTECTED]
Resent-From: Michael Mueller [EMAIL PROTECTED]
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: Stefano Melchior [EMAIL PROTECTED]
Resent-Date: Tue, 23 Aug 2005 20:03:10 UTC
Resent-Message-ID: [EMAIL PROTECTED]
X-Debian-PR-Message: report 324755
X-Debian-PR-Package: mc
X-Debian-PR-Keywords: 
X-ID: TEOJF2ZOreDY-47VoI3b39kQg+akK-GT4Fbt0Cbg0aubvSIGkeH3rO
X-TOI-MSGID: dc04d4ea-64e3-4bab-bace-072c7e66b82e
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
autolearn=no version=2.60-bugs.debian.org_2005_01_02
Resent-Sender: Debian BTS [EMAIL PROTECTED]

Package: mc
Version: 4.6.0-4.6.1-pre4-2

Midnight Commander does handle tar archives bigger than the magic 2GB 
size incorrectly.

I appended a patch fixing the problem. Since it includes changes in the 
VFS of the Midnight Commander, changes made to other virtual filesystems 
are included too. Those however are not tested and mostly will not make 
them bypassing the limit.


With best regards
Michael M?ller

diff -N -r -u -x config.log mc-4.6.1-pre4.debian/vfs/cpio.c 
mc-4.6.1-pre4/vfs/cpio.c
--- mc-4.6.1-pre4.debian/vfs/cpio.c 2005-05-27 16:19:19.0 +0200
+++ mc-4.6.1-pre4/vfs/cpio.c2005-08-23 21:32:39.306219927 +0200
@@ -83,7 +83,7 @@
 struct vfs_s_inode *inode;
 };
 
-static int cpio_position;
+static off_t cpio_position;
 
 static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super);
 static int cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super);
@@ -107,7 +107,7 @@
 return l;
 }
 
-static int cpio_skip_padding(struct vfs_s_super *super)
+static off_t cpio_skip_padding(struct vfs_s_super *super)
 {
 switch(super-u.arch.type) {
 case CPIO_BIN:
diff -N -r -u -x config.log mc-4.6.1-pre4.debian/vfs/direntry.c 
mc-4.6.1-pre4/vfs/direntry.c
--- mc-4.6.1-pre4.debian/vfs/direntry.c 2004-11-29 19:44:49.0 +0100
+++ mc-4.6.1-pre4/vfs/direntry.c2005-08-23 21:32:39.307219773 +0200
@@ -836,13 +836,13 @@
 return 0;
 }
 
-static int
+static off_t
 vfs_s_lseek (void *fh, off_t offset, int whence)
 {
 off_t size = FH-ino-st.st_size;
 
 if (FH-handle != -1){ /* If we have local file opened, we want to 
work with it */
-   int retval = lseek (FH-handle, offset, whence);
+   off_t retval = lseek (FH-handle, offset, whence);
if (retval == -1)
FH-ino-super-me-verrno = errno;
return retval;
diff -N -r -u -x config.log mc-4.6.1-pre4.debian/vfs/extfs.c 
mc-4.6.1-pre4/vfs/extfs.c
--- mc-4.6.1-pre4.debian/vfs/extfs.c2005-05-27 16:19:19.0 +0200
+++ mc-4.6.1-pre4/vfs/extfs.c   2005-08-23 21:32:39.309219464 +0200
@@ -1125,7 +1125,7 @@
 return 0;
 }
 
-static int extfs_lseek (void *data, off_t offset, int whence)
+static off_t extfs_lseek (void *data, off_t offset, int whence)
 {
 struct pseudofile *file = (struct pseudofile *) data;
 
diff -N -r -u -x config.log mc-4.6.1-pre4.debian/vfs/local.c 
mc-4.6.1-pre4/vfs/local.c
--- mc-4.6.1-pre4.debian/vfs/local.c2004-09-25 01:00:18.0 +0200
+++ mc-4.6.1-pre4/vfs/local.c   2005-08-23 21:32:39.310219310 +0200
@@ -197,7 +197,7 @@
 return chdir (path);
 }
 
-int
+off_t
 local_lseek (void *data, off_t offset, int whence)
 {
 int fd = * (int *) data;
diff -N -r -u -x config.log mc-4.6.1-pre4.debian/vfs/local.h 
mc-4.6.1-pre4/vfs/local.h
--- mc-4.6.1-pre4.debian/vfs/local.h2004-08-17 11:17:43.0 +0200
+++ mc-4.6.1-pre4/vfs/local.h   2005-08-23 21:32:39.318218076 +0200
@@ -11,7 +11,7 @@
 extern int local_read (void *data, char *buffer, int count);
 extern int local_fstat (void *data, struct stat *buf);
 extern int local_errno (struct vfs_class *me);
-extern int local_lseek (void *data, off_t offset, int whence);
+extern off_t local_lseek (void *data, off_t offset, int whence);
 #ifdef HAVE_MMAP
 extern caddr_t local_mmap (struct vfs_class *me, caddr_t addr, size_t len,
int prot, int flags, void *data, off_t offset);
diff -N -r -u -x config.log mc-4.6.1-pre4.debian/vfs/mcfs.c 
mc-4.6.1-pre4/vfs/mcfs.c
--- mc-4.6.1-pre4.debian/vfs/mcfs.c 2005-05-27 16:19:19.0 +0200
+++ mc-4.6.1-pre4/vfs/mcfs.c2005-08-23 21:32:39.315218539 +0200
@@ -1037,7 +1037,7 @@
 return 0;
 }
 
-static int
+static off_t
 mcfs_lseek (void *data, off_t