From 39c933ce2e5b4a4bd760b470538c85a3e78b35c3 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Oct 12 2009 12:50:24 +0000 Subject: - fix segfault while browsing various archives via VFS (#528268) --- diff --git a/mc-vfsfail.patch b/mc-vfsfail.patch new file mode 100644 index 0000000..e57af35 --- /dev/null +++ b/mc-vfsfail.patch @@ -0,0 +1,61 @@ +diff -up mc-4.7.0/vfs/vfs.c.jn mc-4.7.0/vfs/vfs.c +--- mc-4.7.0/vfs/vfs.c.jn 2009-10-12 13:57:18.000000000 +0200 ++++ mc-4.7.0/vfs/vfs.c 2009-10-12 14:34:04.000000000 +0200 +@@ -675,6 +675,9 @@ int + mc_ctl (int handle, int ctlop, void *arg) + { + struct vfs_class *vfs = vfs_op (handle); ++ ++ if (vfs == NULL) ++ return 0; + + return vfs->ctl ? (*vfs->ctl)(vfs_info (handle), ctlop, arg) : 0; + } +@@ -708,6 +711,10 @@ mc_close (int handle) + return -1; + + vfs = vfs_op (handle); ++ ++ if (vfs == NULL) ++ return -1; ++ + if (handle < 3) + return close (handle); + +@@ -798,6 +805,8 @@ mc_readdir (DIR *dirp) + } + handle = *(int *) dirp; + vfs = vfs_op (handle); ++ if (vfs == NULL) ++ return NULL; + dirinfo = vfs_info (handle); + if (vfs->readdir) { + entry = (*vfs->readdir) (dirinfo->info); +@@ -820,6 +829,9 @@ mc_closedir (DIR *dirp) + int result; + struct vfs_dirinfo *dirinfo; + ++ if (vfs == NULL) ++ return -1; ++ + dirinfo = vfs_info (handle); + if (dirinfo->converter != str_cnv_from_term) str_close_conv (dirinfo->converter); + +@@ -874,6 +886,8 @@ int mc_fstat (int handle, struct stat *b + if (handle == -1) + return -1; + vfs = vfs_op (handle); ++ if (vfs == NULL) ++ return -1; + result = vfs->fstat ? (*vfs->fstat) (vfs_info (handle), buf) : -1; + if (result == -1) + errno = vfs->name ? ferrno (vfs) : E_NOTSUPP; +@@ -967,6 +981,8 @@ off_t mc_lseek (int fd, off_t offset, in + return -1; + + vfs = vfs_op (fd); ++ if (vfs == NULL) ++ return -1; + result = vfs->lseek ? (*vfs->lseek)(vfs_info (fd), offset, whence) : -1; + if (result == -1) + errno = vfs->lseek ? ferrno (vfs) : E_NOTSUPP; diff --git a/mc.spec b/mc.spec index ee5e9f1..defa4f4 100644 --- a/mc.spec +++ b/mc.spec @@ -1,7 +1,7 @@ Summary: User-friendly text console file manager and visual shell Name: mc Version: 4.7.0 -Release: 0.5.pre3%{?dist} +Release: 0.6.pre3%{?dist} Epoch: 1 License: GPLv2 Group: System Environment/Shells @@ -14,6 +14,7 @@ Requires: dev >= 3.3-3 Patch1: mc-exit.patch Patch2: mc-extensions.patch +Patch3: mc-vfsfail.patch %description Midnight Commander is a visual shell much like a file manager, only @@ -26,6 +27,7 @@ specific files. %setup -q -n mc-%{version}-pre3 %patch1 -p1 -b .exit %patch2 -p1 -b .extensions +%patch3 -p1 -b .vfsfail %build export CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS" @@ -81,6 +83,9 @@ rm -rf $RPM_BUILD_ROOT %dir %{_libexecdir}/mc %changelog +* Mon Oct 12 2009 Jindrich Novy 4.7.0-0.6.pre3 +- fix segfault while browsing various archives via VFS (#528268) + * Mon Oct 5 2009 Jindrich Novy 4.7.0-0.5.pre3 - update to 4.7.0-pre3 - add BR: gpm-devel