-/* $Cambridge: exim/src/src/search.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/search.c,v 1.6 2007/08/29 14:02:22 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2005 */
+/* Copyright (c) University of Cambridge 1995 - 2007 */
/* See the file NOTICE for conditions of use and distribution. */
/* A set of functions to search databases in various formats. An open
}
/* 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;
}
/* If opening is successful, call the file-checking function if there is one,
and if all is still well, enter the open database into the tree. */
-handle = lk->open(filename, &search_error_message);
+handle = (lk->open)(filename, &search_error_message);
if (handle == NULL)
{
store_pool = old_pool;