git://git.exim.org
/
users
/
jgh
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Acl expansions: tests and documentation
[users/jgh/exim.git]
/
src
/
src
/
expand.c
diff --git
a/src/src/expand.c
b/src/src/expand.c
index 60552a85c7efd200926840b5275128f7def769fe..767e4771a2c1129751f2b358866e085a9533f973 100644
(file)
--- a/
src/src/expand.c
+++ b/
src/src/expand.c
@@
-1855,7
+1855,7
@@
uschar *dummy_log_msg;
for (i = 1; i < nsub && sub[i]; i++)
acl_arg[i-1] = sub[i];
acl_narg = i-1;
for (i = 1; i < nsub && sub[i]; i++)
acl_arg[i-1] = sub[i];
acl_narg = i-1;
-while (i <
sizeof(sub)/sizeof(*sub)
)
+while (i <
nsub
)
acl_arg[i++ - 1] = NULL;
DEBUG(D_expand)
acl_arg[i++ - 1] = NULL;
DEBUG(D_expand)
@@
-2111,11
+2111,13
@@
switch(cond_type)
*/
case ECOND_ACL:
*/
case ECOND_ACL:
- /* ${if acl {{name}{arg1}{arg2}...} {yes}{no}}
+ /* ${if acl {{name}{arg1}{arg2}...} {yes}{no}}
*/
{
uschar *nameargs;
uschar *user_msg;
BOOL cond = FALSE;
{
uschar *nameargs;
uschar *user_msg;
BOOL cond = FALSE;
+ int size = 0;
+ int ptr = 0;
while (isspace(*s)) s++;
if (*s++ != '{') goto COND_FAILED_CURLY_START;
while (isspace(*s)) s++;
if (*s++ != '{') goto COND_FAILED_CURLY_START;
@@
-2129,16
+2131,17
@@
switch(cond_type)
case 3: return NULL;
}
case 3: return NULL;
}
- if (yield != NULL)
- switch(eval_acl(sub, sizeof(sub)/sizeof(*sub), &user_msg))
+ if (yield != NULL) switch(eval_acl(sub, sizeof(sub)/sizeof(*sub), &user_msg))
{
case OK:
cond = TRUE;
case FAIL:
{
case OK:
cond = TRUE;
case FAIL:
+ lookup_value = NULL;
if (user_msg)
if (user_msg)
+ {
lookup_value = string_cat(NULL, &size, &ptr, user_msg, Ustrlen(user_msg));
lookup_value = string_cat(NULL, &size, &ptr, user_msg, Ustrlen(user_msg));
- else
- lookup_value = NULL;
+ lookup_value[ptr] = '\0';
+ }
*yield = cond;
break;
*yield = cond;
break;