nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Patch for bug #44950


From: Rishabh Dave
Subject: Re: [Nano-devel] Patch for bug #44950
Date: Thu, 21 Jan 2016 00:25:19 +0530

On Wed, Jan 20, 2016 at 3:51 PM, Benno Schulenberg <address@hidden> wrote:
But... when I do as a normal user 'src/nano /root/something',
why don't I get "Path '/root': Permission denied"?
 
Is that fixed? I couldn't apply 'dropping-the-global.patch' to nano-2.5.1 (since I am not using a version control system). But I have figured out the code. If required urgently (because I won't be able to do that for next 17 hours) it is as follows in verify_path() in files.c -

} else if (!S_ISDIR(parentinfo.st_mode)) {
    statusbar(_("Path '%s' is not a directory"), parentdir);
    valid_path = FALSE;
    beep();
    } else if ((strcmp(filename, "") != 0) && (writable = is_file_writable(filename) == FALSE))
    statusbar(_("Path '%s': Permission denied"), filename);
    else
    valid_path = TRUE;

    free(parentdir);
}

2nd 'else if' clause handles it - both non-permitted folders and blank/new buffer (because is_file_writable() declare new buffers are un-writable). And filename cannot be replaced by parentdir, generally it makes message look more appropriate but there are two problems: first, file may be restricted permission and (more importantly) second, every folder (even '/') boils down to '.' which was ambiguous message for statusbar.

I will send patch for this as soon as I get any time.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]