summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2006-12-04 15:00:19 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2006-12-04 15:00:19 +0000
commitd78371933afdcbdb420e40a2855b548a4673dc3d (patch)
treea46b383464d7223fcc407a94293f03bbbc1aa00d /src
parent55728a4f2bbb52eb648380b40ebb4e44db590039 (diff)
Give an error for the use of * and *@ with a query-style lookup.
Diffstat (limited to 'src')
-rw-r--r--src/src/search.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/src/search.c b/src/src/search.c
index 364cb3cb7..3dac52eaf 100644
--- a/src/src/search.c
+++ b/src/src/search.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/search.c,v 1.3 2006/02/07 11:19:00 ph10 Exp $ */
+/* $Cambridge: exim/src/src/search.c,v 1.4 2006/12/04 15:00:20 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -184,18 +184,26 @@ else if (len >= 1 && ss[len-1] == '*')
}
/* Check for the individual search type. Only those that are actually in the
-binary are valid. For query-style types, "partial" is an error. */
+binary are valid. For query-style types, "partial" and default types are
+erroneous. */
stype = search_findtype(ss, len);
-if (pv >= 0 && mac_islookup(stype, lookup_querystyle))
+if (stype >= 0 && mac_islookup(stype, lookup_querystyle))
{
- search_error_message = string_sprintf("\"partial\" is not permitted "
- "for lookup type \"%s\"", ss);
- return -1;
+ if (pv >= 0)
+ {
+ search_error_message = string_sprintf("\"partial\" is not permitted "
+ "for lookup type \"%s\"", ss);
+ return -1;
+ }
+ if ((*starflags & (SEARCH_STAR|SEARCH_STARAT)) != 0)
+ {
+ search_error_message = string_sprintf("defaults using \"*\" or \"*@\" are "
+ "not permitted for lookup type \"%s\"", ss);
+ return -1;
+ }
}
-/* All is well; pass back the partial type and return the lookup type. */
-
*ptypeptr = pv;
return stype;
}