Gourgen Hakobian writes:

> Hello, 
> 
>   Recently there was a discussion concerning people getting their
>   address books deleted (including myself:-). Now it seems to me that I
>   found out when it happens. 
> 
>   When I log in to either account and press "Delete folder" button *WITHOUT*
>   selecting any folder in Folders list, this error message appears: 
> 
>   "Unable to delete or rename this folder - folder contains messages or
>   is used by a mail filter" 
> 
>   Then, after I click on either of folders, Sqwebmail throws me
>   back to "request cannot be authenticated" page. After I log back in,
>   I get my address book deleted.

That's the bug.  This specific information narrowed down the problem spot to 
less than a dozen lines of code, down from over 18,000, at which point the 
problem was clearly identified. 

Excellent timing, since I'm preparing to cut a release within the next week, 
or so.  The following patch will apply to 2.0.0 

 

-- 
Sam 

diff -U3 -r1.91 folder.c
--- sqwebmail/folder.c  2001/04/13 01:12:33     1.91
+++ sqwebmail/folder.c  2001/05/01 22:27:54
@@ -2685,14 +2685,15 @@
        const char *p=cgi("DELETE");
        char    *pp=strdup(p);
 
-               if (pp && strchr(pp, ':') == 0)
+               if (pp && *pp && strchr(pp, ':') == 0)
                {
                        if (mailfilter_folderused(pp))
                                folder_err_msg=err_cantdelete;
                        else if (maildir_delete(pp, *cgi("deletecontent")))
                                folder_err_msg=err_cantdelete;
-                       free(pp);
                }
+               if (pp)
+                       free(pp);
        }
 
        if (*cgi("do.subunsub"))

Reply via email to