Re: [patch?] recent ftpfs ERRNOR fix broke uploading



On Thu, 2 Feb 2006, Jindrich Makovicka wrote:

> >>>after a fix of wrong ERRNOR usage in ftpfs.c (2006-01-24 ftpfs.c
> >>>(ftpfs_dir_load): Fix a bad ERRNOR call), mc segfaults when I try
> >>>uploading directories recursively. Changing the return value from -1 to
> >>>0 seems to fix the problem.
> >>
> >>I've just uploaded a small tree successfully on a remote ftp server. Right
> >>now I am pushing the whole MC tree onto the same server - I'll let you
> >>know when I am done (so far no crash).
> >
> >
> > I couldn't make it crash :( Can you give some more details ?
>
> Sorry... It actually happens only when uploading to a directory without
> read permissions. In my case, the server was vsftpd with
> anon_world_readable_only=yes so the newly uploaded directories are
> unreadable.

Ok. I was able to reproduce it... Initial analisys shows that the patch
you refer to just exposes a bug in MC.

The crash happens here:

struct vfs_s_entry *
vfs_s_generate_entry (struct vfs_class *me, const char *name, struct
vfs_s_inode *parent, mode_t mode)
{
    struct vfs_s_inode *inode;
    struct stat *st;

    st = vfs_s_default_stat (me, mode);
    inode = vfs_s_new_inode (me, parent->super, st);
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In this particular setup parent is NULL. Consider directory
structure:

  mc/CVS

and file Root inside it

Since no information can be retrieved for mc/CVS parent is NULL .
Unfortunately neither vfs_s_open() nor vfs_s_generate_entry()
cares to check that.

I am looking for a solution now. There are other unchecked calls btw
which lead to that crash - for example a mc_stat() call on the destination
in copy_dir_dir().



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