- provide yum-repo.syntax (#549014)
- avoid occasional crash while reading panels (#548987) - remove duplicates from filelist - enable mcvfs, disable rpath
This commit is contained in:
parent
dbcd49aae3
commit
2b131be421
@ -1 +1 @@
|
||||
mc-4.7.0-pre4.tar.bz2
|
||||
mc-4.7.0-pre4-20091221git.tar.bz2
|
||||
|
@ -1,15 +0,0 @@
|
||||
diff -up mc-4.6.99/src/command.c.exit mc-4.6.99/src/command.c
|
||||
--- mc-4.6.99/src/command.c.exit 2009-07-31 19:27:10.000000000 +0200
|
||||
+++ mc-4.6.99/src/command.c 2009-07-31 20:08:01.000000000 +0200
|
||||
@@ -224,6 +224,11 @@ enter (WInput *cmdline)
|
||||
size_t i, j, cmd_len;
|
||||
|
||||
if (!vfs_current_is_local ()) {
|
||||
+ if (strcmp (cmd, "exit") == 0) {
|
||||
+ quiet_quit_cmd ();
|
||||
+ return MSG_HANDLED;
|
||||
+ }
|
||||
+
|
||||
message (D_ERROR, MSG_ERROR,
|
||||
_
|
||||
(" Cannot execute commands on non-local filesystems"));
|
455
mc-rpmvfs.patch
455
mc-rpmvfs.patch
@ -1,455 +0,0 @@
|
||||
commit 698385bdd0bfb485bcc42a634f86a8cd0ffae564
|
||||
Author: Andrew Borodin <aborodin@vmail.ru>
|
||||
Date: Wed Nov 18 16:26:24 2009 +0300
|
||||
|
||||
Ticket #1732: cpio VFS skips empty directories in the root of archive
|
||||
|
||||
Initial step: some optimization and type accuracy.
|
||||
|
||||
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
|
||||
|
||||
diff --git a/vfs/cpio.c b/vfs/cpio.c
|
||||
index 5eeef95..8c24573 100644
|
||||
--- a/vfs/cpio.c
|
||||
+++ b/vfs/cpio.c
|
||||
@@ -103,7 +103,6 @@ struct defer_inode {
|
||||
static int cpio_position;
|
||||
|
||||
static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super);
|
||||
-static int cpio_create_entry(struct vfs_class *me, struct vfs_s_super *super, struct stat *, char *name);
|
||||
static ssize_t cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super);
|
||||
static ssize_t cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *super);
|
||||
static ssize_t cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super);
|
||||
@@ -234,8 +233,8 @@ static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super)
|
||||
{
|
||||
char buf[256];
|
||||
int ptr = 0;
|
||||
- int top;
|
||||
- int tmp;
|
||||
+ ssize_t top;
|
||||
+ ssize_t tmp;
|
||||
|
||||
top = mc_read (super->u.arch.fd, buf, 256);
|
||||
if (top > 0)
|
||||
@@ -271,6 +270,140 @@ static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super)
|
||||
#undef RETURN
|
||||
#undef SEEKBACK
|
||||
|
||||
+static int
|
||||
+cpio_create_entry (struct vfs_class *me, struct vfs_s_super *super,
|
||||
+ struct stat *st, char *name)
|
||||
+{
|
||||
+ struct vfs_s_inode *inode = NULL;
|
||||
+ struct vfs_s_inode *root = super->root;
|
||||
+ struct vfs_s_entry *entry = NULL;
|
||||
+ char *tn;
|
||||
+
|
||||
+ switch (st->st_mode & S_IFMT) { /* For case of HP/UX archives */
|
||||
+ case S_IFCHR:
|
||||
+ case S_IFBLK:
|
||||
+#ifdef S_IFSOCK
|
||||
+ case S_IFSOCK:
|
||||
+#endif
|
||||
+#ifdef S_IFIFO
|
||||
+ case S_IFIFO:
|
||||
+#endif
|
||||
+#ifdef S_IFNAM
|
||||
+ case S_IFNAM:
|
||||
+#endif
|
||||
+ if ((st->st_size != 0) && (st->st_rdev == 0x0001)) {
|
||||
+ /* FIXME: representation of major/minor differs between */
|
||||
+ /* different operating systems. */
|
||||
+ st->st_rdev = (unsigned) st->st_size;
|
||||
+ st->st_size = 0;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if ((st->st_nlink > 1)
|
||||
+ && ((super->u.arch.type == CPIO_NEWC)
|
||||
+ || (super->u.arch.type == CPIO_CRC))) { /* For case of hardlinked files */
|
||||
+ struct defer_inode i, *l;
|
||||
+ i.inumber = st->st_ino;
|
||||
+ i.device = st->st_dev;
|
||||
+ i.inode = NULL;
|
||||
+
|
||||
+ l = cpio_defer_find (super->u.arch.deferred, &i);
|
||||
+ if (l != NULL) {
|
||||
+ inode = l->inode;
|
||||
+ if (inode->st.st_size != 0 && st->st_size != 0
|
||||
+ && (inode->st.st_size != st->st_size)) {
|
||||
+ message (D_ERROR, MSG_ERROR,
|
||||
+ _("Inconsistent hardlinks of\n%s\nin cpio archive\n%s"),
|
||||
+ name, super->name);
|
||||
+ inode = NULL;
|
||||
+ } else if (inode->st.st_size == 0)
|
||||
+ inode->st.st_size = st->st_size;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* remove trailing slashes */
|
||||
+ for (tn = name + strlen (name) - 1; tn >= name && *tn == PATH_SEP; tn--)
|
||||
+ *tn = '\0';
|
||||
+
|
||||
+ tn = strrchr (name, PATH_SEP);
|
||||
+ if (tn == NULL)
|
||||
+ tn = name;
|
||||
+ else {
|
||||
+ *tn = '\0';
|
||||
+ root = vfs_s_find_inode (me, super, name, LINK_FOLLOW, FL_MKDIR);
|
||||
+ *tn = PATH_SEP;
|
||||
+ tn++;
|
||||
+ }
|
||||
+
|
||||
+ entry = MEDATA->find_entry (me, root, tn, LINK_FOLLOW, FL_NONE); /* In case entry is already there */
|
||||
+
|
||||
+ if (entry != NULL) {
|
||||
+ /* This shouldn't happen! (well, it can happen if there is a record for a
|
||||
+ file and than a record for a directory it is in; cpio would die with
|
||||
+ 'No such file or directory' is such case) */
|
||||
+
|
||||
+ if (!S_ISDIR (entry->ino->st.st_mode)) {
|
||||
+ /* This can be considered archive inconsistency */
|
||||
+ message (D_ERROR, MSG_ERROR,
|
||||
+ _("%s contains duplicate entries! Skipping!"),
|
||||
+ super->name);
|
||||
+ } else {
|
||||
+ entry->ino->st.st_mode = st->st_mode;
|
||||
+ entry->ino->st.st_uid = st->st_uid;
|
||||
+ entry->ino->st.st_gid = st->st_gid;
|
||||
+ entry->ino->st.st_atime = st->st_atime;
|
||||
+ entry->ino->st.st_mtime = st->st_mtime;
|
||||
+ entry->ino->st.st_ctime = st->st_ctime;
|
||||
+ }
|
||||
+
|
||||
+ g_free (name);
|
||||
+ } else { /* !entry */
|
||||
+ if (inode == NULL) {
|
||||
+ inode = vfs_s_new_inode (me, super, st);
|
||||
+ if ((st->st_nlink > 0)
|
||||
+ && ((super->u.arch.type == CPIO_NEWC)
|
||||
+ || (super->u.arch.type == CPIO_CRC))) {
|
||||
+ /* For case of hardlinked files */
|
||||
+ struct defer_inode *i;
|
||||
+ i = g_new (struct defer_inode, 1);
|
||||
+ i->inumber = st->st_ino;
|
||||
+ i->device = st->st_dev;
|
||||
+ i->inode = inode;
|
||||
+ i->next = super->u.arch.deferred;
|
||||
+ super->u.arch.deferred = i;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (st->st_size != 0)
|
||||
+ inode->data_offset = CPIO_POS (super);
|
||||
+
|
||||
+ entry = vfs_s_new_entry (me, tn, inode);
|
||||
+ vfs_s_insert_entry (me, root, entry);
|
||||
+
|
||||
+ g_free (name);
|
||||
+
|
||||
+ if (!S_ISLNK (st->st_mode))
|
||||
+ CPIO_SEEK_CUR (super, st->st_size);
|
||||
+ else {
|
||||
+ inode->linkname = g_malloc (st->st_size + 1);
|
||||
+
|
||||
+ if (mc_read (super->u.arch.fd, inode->linkname, st->st_size) < st->st_size) {
|
||||
+ inode->linkname[0] = '\0';
|
||||
+ return STATUS_EOF;
|
||||
+ }
|
||||
+
|
||||
+ inode->linkname[st->st_size] = '\0'; /* Linkname stored without terminating \0 !!! */
|
||||
+ CPIO_POS (super) += st->st_size;
|
||||
+ cpio_skip_padding (super);
|
||||
+ }
|
||||
+ } /* !entry */
|
||||
+
|
||||
+ return STATUS_OK;
|
||||
+}
|
||||
+
|
||||
#define HEAD_LENGTH (26)
|
||||
static ssize_t cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super)
|
||||
{
|
||||
@@ -278,7 +411,7 @@ static ssize_t cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *supe
|
||||
struct old_cpio_header buf;
|
||||
short shorts[HEAD_LENGTH >> 1];
|
||||
} u;
|
||||
- int len;
|
||||
+ ssize_t len;
|
||||
char *name;
|
||||
struct stat st;
|
||||
|
||||
@@ -333,7 +466,7 @@ static ssize_t cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *sup
|
||||
struct stat st;
|
||||
char buf[HEAD_LENGTH + 1];
|
||||
} u;
|
||||
- int len;
|
||||
+ ssize_t len;
|
||||
char *name;
|
||||
|
||||
if (mc_read (super->u.arch.fd, u.buf, HEAD_LENGTH) != HEAD_LENGTH)
|
||||
@@ -385,25 +518,28 @@ static ssize_t cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *sup
|
||||
#undef HEAD_LENGTH
|
||||
|
||||
#define HEAD_LENGTH (110)
|
||||
-static ssize_t cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super)
|
||||
+static ssize_t
|
||||
+cpio_read_crc_head (struct vfs_class *me, struct vfs_s_super *super)
|
||||
{
|
||||
struct new_cpio_header hd;
|
||||
union {
|
||||
struct stat st;
|
||||
char buf[HEAD_LENGTH + 1];
|
||||
} u;
|
||||
- int len;
|
||||
+ ssize_t len;
|
||||
char *name;
|
||||
|
||||
if (mc_read (super->u.arch.fd, u.buf, HEAD_LENGTH) != HEAD_LENGTH)
|
||||
return STATUS_EOF;
|
||||
+
|
||||
CPIO_POS (super) += HEAD_LENGTH;
|
||||
- u.buf[HEAD_LENGTH] = 0;
|
||||
+ u.buf[HEAD_LENGTH] = '\0';
|
||||
|
||||
if (sscanf (u.buf, "%6ho%8lx%8lx%8lx%8lx%8lx%8lx%8lx%8lx%8lx%8lx%8lx%8lx%8lx",
|
||||
&hd.c_magic, &hd.c_ino, &hd.c_mode, &hd.c_uid, &hd.c_gid,
|
||||
&hd.c_nlink, &hd.c_mtime, &hd.c_filesize,
|
||||
- (unsigned long *)&hd.c_dev, (unsigned long *)&hd.c_devmin, (unsigned long *)&hd.c_rdev, (unsigned long *)&hd.c_rdevmin,
|
||||
+ (unsigned long *)&hd.c_dev, (unsigned long *)&hd.c_devmin,
|
||||
+ (unsigned long *)&hd.c_rdev, (unsigned long *)&hd.c_rdevmin,
|
||||
&hd.c_namesize, &hd.c_chksum) < 14) {
|
||||
message (D_ERROR, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"),
|
||||
super->name);
|
||||
@@ -421,8 +557,9 @@ static ssize_t cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *supe
|
||||
}
|
||||
|
||||
name = g_malloc(hd.c_namesize);
|
||||
- if((len = mc_read (super->u.arch.fd, name, hd.c_namesize)) == -1 ||
|
||||
- (unsigned long) len < hd.c_namesize) {
|
||||
+ len = mc_read (super->u.arch.fd, name, hd.c_namesize);
|
||||
+
|
||||
+ if ((len == -1) || ((unsigned long) len < hd.c_namesize)) {
|
||||
g_free (name);
|
||||
return STATUS_EOF;
|
||||
}
|
||||
@@ -430,7 +567,7 @@ static ssize_t cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *supe
|
||||
CPIO_POS(super) += len;
|
||||
cpio_skip_padding(super);
|
||||
|
||||
- if(!strcmp("TRAILER!!!", name)) { /* We got to the last record */
|
||||
+ if (strcmp ("TRAILER!!!", name) == 0) { /* We got to the last record */
|
||||
g_free(name);
|
||||
return STATUS_TRAIL;
|
||||
}
|
||||
@@ -448,128 +585,6 @@ static ssize_t cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *supe
|
||||
return cpio_create_entry (me, super, &u.st, name);
|
||||
}
|
||||
|
||||
-static int
|
||||
-cpio_create_entry (struct vfs_class *me, struct vfs_s_super *super,
|
||||
- struct stat *st, char *name)
|
||||
-{
|
||||
- struct vfs_s_inode *inode = NULL;
|
||||
- struct vfs_s_inode *root = super->root;
|
||||
- struct vfs_s_entry *entry = NULL;
|
||||
- char *tn;
|
||||
-
|
||||
- switch (st->st_mode & S_IFMT) { /* For case of HP/UX archives */
|
||||
- case S_IFCHR:
|
||||
- case S_IFBLK:
|
||||
-#ifdef S_IFSOCK
|
||||
- case S_IFSOCK:
|
||||
-#endif
|
||||
-#ifdef S_IFIFO
|
||||
- case S_IFIFO:
|
||||
-#endif
|
||||
-#ifdef S_IFNAM
|
||||
- case S_IFNAM:
|
||||
-#endif
|
||||
- if ((st->st_size != 0) && (st->st_rdev == 0x0001)) {
|
||||
- /* FIXME: representation of major/minor differs between */
|
||||
- /* different operating systems. */
|
||||
- st->st_rdev = (unsigned) st->st_size;
|
||||
- st->st_size = 0;
|
||||
- }
|
||||
- break;
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if ((st->st_nlink > 1) && (super->u.arch.type == CPIO_NEWC || super->u.arch.type == CPIO_CRC)) { /* For case of hardlinked files */
|
||||
- struct defer_inode i, *l;
|
||||
- i.inumber = st->st_ino;
|
||||
- i.device = st->st_dev;
|
||||
- i.inode = NULL;
|
||||
- if ((l = cpio_defer_find (super->u.arch.deferred, &i)) != NULL) {
|
||||
- inode = l->inode;
|
||||
- if (inode->st.st_size && st->st_size
|
||||
- && (inode->st.st_size != st->st_size)) {
|
||||
- message (D_ERROR, MSG_ERROR,
|
||||
- _
|
||||
- ("Inconsistent hardlinks of\n%s\nin cpio archive\n%s"),
|
||||
- name, super->name);
|
||||
- inode = NULL;
|
||||
- } else if (!inode->st.st_size)
|
||||
- inode->st.st_size = st->st_size;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- for (tn = name + strlen (name) - 1; tn >= name && *tn == PATH_SEP; tn--)
|
||||
- *tn = 0;
|
||||
- if ((tn = strrchr (name, PATH_SEP))) {
|
||||
- *tn = 0;
|
||||
- root = vfs_s_find_inode (me, super, name, LINK_FOLLOW, FL_MKDIR);
|
||||
- *tn = PATH_SEP;
|
||||
- tn++;
|
||||
- } else
|
||||
- tn = name;
|
||||
-
|
||||
- entry = MEDATA->find_entry (me, root, tn, LINK_FOLLOW, FL_NONE); /* In case entry is already there */
|
||||
-
|
||||
- if (entry) { /* This shouldn't happen! (well, it can happen if there is a record for a
|
||||
- file and than a record for a directory it is in; cpio would die with
|
||||
- 'No such file or directory' is such case) */
|
||||
-
|
||||
- if (!S_ISDIR (entry->ino->st.st_mode)) { /* This can be considered archive inconsistency */
|
||||
- message (D_ERROR, MSG_ERROR,
|
||||
- _("%s contains duplicate entries! Skipping!"),
|
||||
- super->name);
|
||||
- } else {
|
||||
- entry->ino->st.st_mode = st->st_mode;
|
||||
- entry->ino->st.st_uid = st->st_uid;
|
||||
- entry->ino->st.st_gid = st->st_gid;
|
||||
- entry->ino->st.st_atime = st->st_atime;
|
||||
- entry->ino->st.st_mtime = st->st_mtime;
|
||||
- entry->ino->st.st_ctime = st->st_ctime;
|
||||
- }
|
||||
-
|
||||
- } else { /* !entry */
|
||||
-
|
||||
- if (!inode) {
|
||||
- inode = vfs_s_new_inode (me, super, st);
|
||||
- if ((st->st_nlink > 0) && (super->u.arch.type == CPIO_NEWC || super->u.arch.type == CPIO_CRC)) { /* For case of hardlinked files */
|
||||
- struct defer_inode *i;
|
||||
- i = g_new (struct defer_inode, 1);
|
||||
- i->inumber = st->st_ino;
|
||||
- i->device = st->st_dev;
|
||||
- i->inode = inode;
|
||||
- i->next = super->u.arch.deferred;
|
||||
- super->u.arch.deferred = i;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (st->st_size)
|
||||
- inode->data_offset = CPIO_POS (super);
|
||||
-
|
||||
- entry = vfs_s_new_entry (me, tn, inode);
|
||||
- vfs_s_insert_entry (me, root, entry);
|
||||
-
|
||||
- if (S_ISLNK (st->st_mode)) {
|
||||
- inode->linkname = g_malloc (st->st_size + 1);
|
||||
- if (mc_read (super->u.arch.fd, inode->linkname, st->st_size)
|
||||
- < st->st_size) {
|
||||
- inode->linkname[0] = 0;
|
||||
- g_free (name);
|
||||
- return STATUS_EOF;
|
||||
- }
|
||||
- inode->linkname[st->st_size] = 0; /* Linkname stored without terminating \0 !!! */
|
||||
- CPIO_POS (super) += st->st_size;
|
||||
- cpio_skip_padding (super);
|
||||
- } else {
|
||||
- CPIO_SEEK_CUR (super, st->st_size);
|
||||
- }
|
||||
-
|
||||
- } /* !entry */
|
||||
-
|
||||
- g_free (name);
|
||||
- return STATUS_OK;
|
||||
-}
|
||||
-
|
||||
/* Need to CPIO_SEEK_CUR to skip the file at the end of add entry!!!! */
|
||||
|
||||
static int
|
||||
diff --git a/vfs/direntry.c b/vfs/direntry.c
|
||||
index f7a8bfb..80b0b12 100644
|
||||
--- a/vfs/direntry.c
|
||||
+++ b/vfs/direntry.c
|
||||
@@ -400,12 +400,12 @@ vfs_s_find_inode (struct vfs_class *me, const struct vfs_s_super *super,
|
||||
const char *path, int follow, int flags)
|
||||
{
|
||||
struct vfs_s_entry *ent;
|
||||
- if (!(MEDATA->flags & VFS_S_REMOTE) && (!*path))
|
||||
+
|
||||
+ if (((MEDATA->flags & VFS_S_REMOTE) == 0) && (*path == '\0'))
|
||||
return super->root;
|
||||
+
|
||||
ent = (MEDATA->find_entry) (me, super->root, path, follow, flags);
|
||||
- if (!ent)
|
||||
- return NULL;
|
||||
- return ent->ino;
|
||||
+ return (ent != NULL) ? ent->ino : NULL;
|
||||
}
|
||||
|
||||
/* Ook, these were functions around directory entries / inodes */
|
||||
@@ -488,9 +488,8 @@ vfs_s_get_path_mangle (struct vfs_class *me, char *inname,
|
||||
|
||||
for (super = MEDATA->supers; super != NULL; super = super->next) {
|
||||
/* 0 == other, 1 == same, return it, 2 == other but stop scanning */
|
||||
- int i;
|
||||
- if ((i =
|
||||
- MEDATA->archive_same (me, super, archive_name, op, cookie))) {
|
||||
+ int i = MEDATA->archive_same (me, super, archive_name, op, cookie);
|
||||
+ if (i != 0) {
|
||||
if (i == 1)
|
||||
goto return_success;
|
||||
else
|
||||
diff --git a/vfs/vfs.c b/vfs/vfs.c
|
||||
index 7c1de54..f8eb7a1 100644
|
||||
--- a/vfs/vfs.c
|
||||
+++ b/vfs/vfs.c
|
||||
@@ -1124,7 +1124,8 @@ static char *
|
||||
mc_def_getlocalcopy (const char *filename)
|
||||
{
|
||||
char *tmp;
|
||||
- int fdin, fdout, i;
|
||||
+ int fdin, fdout;
|
||||
+ ssize_t i;
|
||||
char buffer[8192];
|
||||
struct stat mystat;
|
||||
|
||||
commit f84917a188f6f88cdc0d0d0067beefc13d42f40a
|
||||
Author: Andrew Borodin <aborodin@vmail.ru>
|
||||
Date: Thu Nov 19 10:51:21 2009 +0300
|
||||
|
||||
Fixed skip of empty directories in the root of cpio archive.
|
||||
|
||||
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
|
||||
|
||||
diff --git a/vfs/cpio.c b/vfs/cpio.c
|
||||
index 8c24573..0af9cda 100644
|
||||
--- a/vfs/cpio.c
|
||||
+++ b/vfs/cpio.c
|
||||
@@ -331,7 +331,10 @@ cpio_create_entry (struct vfs_class *me, struct vfs_s_super *super,
|
||||
tn = strrchr (name, PATH_SEP);
|
||||
if (tn == NULL)
|
||||
tn = name;
|
||||
- else {
|
||||
+ else if (tn == name + 1) {
|
||||
+ /* started with "./" -- directory in the root of archive */
|
||||
+ tn++;
|
||||
+ } else {
|
||||
*tn = '\0';
|
||||
root = vfs_s_find_inode (me, super, name, LINK_FOLLOW, FL_MKDIR);
|
||||
*tn = PATH_SEP;
|
||||
@@ -341,7 +344,7 @@ cpio_create_entry (struct vfs_class *me, struct vfs_s_super *super,
|
||||
entry = MEDATA->find_entry (me, root, tn, LINK_FOLLOW, FL_NONE); /* In case entry is already there */
|
||||
|
||||
if (entry != NULL) {
|
||||
- /* This shouldn't happen! (well, it can happen if there is a record for a
|
||||
+ /* This shouldn't happen! (well, it can happen if there is a record for a
|
||||
file and than a record for a directory it is in; cpio would die with
|
||||
'No such file or directory' is such case) */
|
||||
|
@ -1,61 +0,0 @@
|
||||
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;
|
37
mc.spec
37
mc.spec
@ -1,19 +1,19 @@
|
||||
Summary: User-friendly text console file manager and visual shell
|
||||
Name: mc
|
||||
Version: 4.7.0
|
||||
Release: 0.8.pre4%{?dist}
|
||||
Release: 0.9.pre4.20091221git%{?dist}
|
||||
Epoch: 1
|
||||
License: GPLv2
|
||||
Group: System Environment/Shells
|
||||
# tarball created from git clone git://midnight-commander.org/git/mc.git
|
||||
Source0: mc-%{version}-pre4.tar.bz2
|
||||
Source0: mc-%{version}-pre4-20091221git.tar.bz2
|
||||
URL: http://www.midnight-commander.org/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: gettext cvs automake autoconf libtool
|
||||
BuildRequires: glib2-devel e2fsprogs-devel slang-devel gpm-devel
|
||||
Requires: dev >= 3.3-3
|
||||
|
||||
Patch0: mc-extensions.patch
|
||||
Patch1: mc-rpmvfs.patch
|
||||
|
||||
%description
|
||||
Midnight Commander is a visual shell much like a file manager, only
|
||||
@ -23,20 +23,22 @@ ability to FTP, view tar and zip files, and to poke into RPMs for
|
||||
specific files.
|
||||
|
||||
%prep
|
||||
%setup -q -n mc-%{version}-pre4
|
||||
%setup -q
|
||||
%patch0 -p1 -b .extensions
|
||||
%patch1 -p1 -b .rpmvfs
|
||||
|
||||
%build
|
||||
export CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS"
|
||||
%configure --with-screen=slang \
|
||||
--enable-charset \
|
||||
--with-samba \
|
||||
--without-x \
|
||||
--with-gpm-mouse
|
||||
./autogen.sh
|
||||
%configure --with-screen=slang \
|
||||
--enable-charset \
|
||||
--with-samba \
|
||||
--without-x \
|
||||
--with-gpm-mouse \
|
||||
--disable-rpath \
|
||||
--enable-vfs-mcfs
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
make install DESTDIR="$RPM_BUILD_ROOT"
|
||||
@ -70,17 +72,24 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%config %{_sysconfdir}/mc/Syntax
|
||||
%config %{_sysconfdir}/mc/mc.charsets
|
||||
%config %{_sysconfdir}/mc/mc.lib
|
||||
%config(noreplace) %{_sysconfdir}/mc/mc.ext
|
||||
%config(noreplace) %{_sysconfdir}/mc/*edit*
|
||||
%config(noreplace) %{_sysconfdir}/mc/mc.*
|
||||
%config(noreplace) %{_sysconfdir}/mc/mc.keymap*
|
||||
%config(noreplace) %{_sysconfdir}/mc/mc.menu*
|
||||
%config(noreplace) %{_sysconfdir}/mc/*.ini
|
||||
%config(noreplace) %{_sysconfdir}/mc/extfs/extfs.ini
|
||||
%config(noreplace) %{_sysconfdir}/mc/extfs/sfs.ini
|
||||
%config(noreplace) %{_sysconfdir}/mc/extfs/*.ini
|
||||
%dir %{_datadir}/mc
|
||||
%dir %{_sysconfdir}/mc
|
||||
%dir %{_sysconfdir}/mc/extfs
|
||||
%dir %{_libexecdir}/mc
|
||||
|
||||
%changelog
|
||||
* Mon Dec 21 2009 Jindrich Novy <jnovy@redhat.com> 4.7.0-0.9.pre4.20091221git
|
||||
- provide yum-repo.syntax (#549014)
|
||||
- avoid occasional crash while reading panels (#548987)
|
||||
- remove duplicates from filelist
|
||||
- enable mcvfs, disable rpath
|
||||
|
||||
* Tue Dec 15 2009 Jindrich Novy <jnovy@redhat.com> 4.7.0-0.8.pre4
|
||||
- fix rpmvfs empty directory handling (#529645)
|
||||
- fix bindings (#532784)
|
||||
|
Loading…
Reference in New Issue
Block a user