X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/059ec3d9952740285fb1ebf47961b8aca2eb1b4a..0a49a7a4f1090b6f1ce1d0f9d969804c9226b53e:/src/src/search.c diff --git a/src/src/search.c b/src/src/search.c index 3dfd80e32..6e52cf284 100644 --- a/src/src/search.c +++ b/src/src/search.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/search.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */ +/* $Cambridge: exim/src/src/search.c,v 1.7 2009/11/16 19:50:37 nm4 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2004 */ +/* Copyright (c) University of Cambridge 1995 - 2009 */ /* See the file NOTICE for conditions of use and distribution. */ /* A set of functions to search databases in various formats. An open @@ -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; } @@ -389,7 +397,7 @@ if (lk->type == lookup_absfile && open_filecount >= lookup_open_max) /* 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;