[PATCH] Re: Parent directory's permissions in mini-status

Pavel Tsekov ptsekov at gmx.net
Mon Mar 28 16:42:07 UTC 2005


Hello,

On Sat, 2 Apr 2005, Leonard den Ottolander wrote:

> Hi Roland, pchel,
>
> On Sat, 2005-04-02 at 13:54, Leonard den Ottolander wrote:
> > Just discussed this with Roland Illig who came up with a patch that
> > seems to work correctly. I further fixed his patch to not need

Well, he should have done some testing too. Not just hacking.

> > add_dotdot_to_list() anymore by moving the relevant parts to
> > set_zero_dir().
>
> If either of you commits this, please *remove* the now commented out
> parts. We don't need that junk around :) .
>
> O, and please also commit to PRE.

Please, don't commit neither to HEAD nor to PRE. This patch sucks. It
actually prevents the user from going to the parent directory for at least
the following filesystems:

  FISH, cpio, tar

I guess this is related to the following hunk:

@@ -481,7 +492,7 @@ do_load_dir (const char *path, dir_list
     while ((dp = mc_readdir (dirp))) {
        status =
            handle_dirent (list, filter, dp, &st, next_free, &link_to_dir,
-                          &stale_link);
+                          &stale_link, strcmp(path, "/") != 0);
        if (status == 0)
            continue;
        if (status == -1) {

Finding that MC will misbehave was relatively easy by just reading the
source. It should have been much easier to find out by simply testing.

I am seriously starting to worry about the quality of the code.




More information about the mc-devel mailing list