On Wed, Feb 16, 2005 at 04:40:31PM +0100, Bob Johannessen wrote:
> Now, the script is clearly in error for not "require"-ing "fileinto",
> but I don't think that's any excuse to include parts of one of my
> (SQL) queries in the reply (additionally I'm not sure I'm using the
> :mime parameter correctly, but again I don't think that's an excuse
> for the observed behavior either).
You are right, there is a bug when using :mime. Amazing how it never
showed up in weeks of sending vacation notices here before, but things
just don't get tested better by using them longer. I append a patch,
which I also sent to Philip. string_cat() does leave room for a
terminating NUL byte, but does not terminate the string. In this place
of the code, I managed to forget terminating the string. I looked at
the rest, but appearantly I did it right there. Thanks for the bug
report!
> My thinking was that a script /test/ should never write anything to that
> directory, so it wouldn't hurt just to hard-code it when running the
> test. I could be wrong though...
If you would give it a vacation directory, it would use it. That's why
it does not have any right now. ;-)
> And one last question: In a virtual environment would it be safe to use
> one sieve_vacation_directory for all users?
No, each user must have its own vacation directory or you may run into
databases being used for more than one user.
Michael
----------------------------------------------------------------------
--- sieve.c.ph 2005-02-02 12:16:56.000000000 +0100
+++ sieve.c 2005-02-16 20:36:40.000000000 +0100
@@ -2536,6 +2535,7 @@
start=capacity;
once=string_cat(filter->vacation_directory,&capacity,&start,US"/",1);
once=string_cat(once,&capacity,&start,hexdigest,33);
+ once[start] = '\0';
/* process subject */
@@ -2591,10 +2591,13 @@
capacity = 0;
start = 0;
addr->reply->headers = string_cat(NULL,&capacity,&start,reason.character,mime_body-reason.character);
+ addr->reply->headers[start] = '\0';
capacity = 0;
start = 0;
- if (mime_body<reason_end) mime_body+=sizeof(nlnl)-1;
+ if (mime_body+(sizeof(nlnl)-1)<reason_end) mime_body+=sizeof(nlnl)-1;
+ else mime_body=reason_end-1;
addr->reply->text = string_cat(NULL,&capacity,&start,mime_body,reason_end-mime_body);
+ addr->reply->text[start] = '\0';
}
else
{