NetBSD-Bugs archive

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

bin/47577: Mail(1)/mail(1)/mailx(1) gets stuck when current folder becomes accessible



>Number:         47577
>Category:       bin
>Synopsis:       Mail(1)/mail(1)/mailx(1) gets stuck when current folder 
>becomes accessible
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 18 14:25:00 +0000 2013
>Originator:     Steffen Nurpmeso
>Release:        6.99.16
>Organization:
>Environment:
NetBSD nhead 6.99.16 NetBSD 6.99.16 (GENERIC) #0: Mon Feb 11 21:12:26 UTC 2013  
builds%b6.netbsd.org@localhost:/home/builds/ab/HEAD/amd64/201302111840Z-obj/home/builds/ab/HEAD/src/sys/arch/amd64/compile/GENERIC
 amd64

>Description:
Yes, and i forgot this one.
If you open a folder with a relative path, use the cd command to change the 
current working directory, then any action that needs to update the opened 
folder (as opposed to the temporary MBOX; e.g., switching to a different 
folder) will fail and claim that the opened folder is not accessible.
You need to cd to a path which turns the relative folder path accessible again 
to be able to continue.
This is just one facet of a basic architectural problem of Berkeley Mail, i.e., 
concurrent deletion of the current folder etc. still bails, but for this 
particular aspect the solution is easy.
>How-To-Repeat:
See desc.
>Fix:
--- cmd3.c.orig 2013-02-18 13:36:32.000000000 +0100
+++ cmd3.c      2013-02-18 13:35:36.000000000 +0100
@@ -201,7 +201,7 @@ help(void *v __unused)
 PUBLIC int
 schdir(void *v)
 {
-       char **arglist;
+       char rpath[PATHSIZE], **arglist;
        const char *cp;
 
        arglist = v;
@@ -210,6 +210,15 @@ schdir(void *v)
        else
                if ((cp = expand(*arglist)) == NULL)
                        return 1;
+
+       if (mailname[0] != '/') {
+               if (realpath(mailname, rpath) == NULL) {
+                       perror("Cannot canonicalize path of current folder");
+                       return 1;
+               }
+               (void)stpcpy(mailname, rpath);
+       }
+
        if (chdir(cp) < 0) {
                warn("%s", cp);
                return 1;



Home | Main Index | Thread Index | Old Index