X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/d7d7b7b91dd75cec636fc144da7e27eed860f971..0a49a7a4f1090b6f1ce1d0f9d969804c9226b53e:/src/src/lookups/dsearch.c diff --git a/src/src/lookups/dsearch.c b/src/src/lookups/dsearch.c index 2e98b360e..ab468caf4 100644 --- a/src/src/lookups/dsearch.c +++ b/src/src/lookups/dsearch.c @@ -1,15 +1,15 @@ -/* $Cambridge: exim/src/src/lookups/dsearch.c,v 1.3 2006/02/07 11:19:01 ph10 Exp $ */ +/* $Cambridge: exim/src/src/lookups/dsearch.c,v 1.6 2009/11/16 19:50:38 nm4 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2006 */ +/* Copyright (c) University of Cambridge 1995 - 2009 */ /* See the file NOTICE for conditions of use and distribution. */ /* The idea for this code came from Matthew Byng-Maddick, but his original has -been heavily reworked a lot for Exim 4 (and it now uses stat() rather than a -directory scan). */ +been heavily reworked a lot for Exim 4 (and it now uses stat() (more precisely: +lstat()) rather than a directory scan). */ #include "../exim.h" @@ -24,7 +24,7 @@ directory scan). */ /* See local README for interface description. We open the directory to test whether it exists and whether it is searchable. However, we don't need to keep -it open, because the "search" can be done by a call to stat() rather than +it open, because the "search" can be done by a call to lstat() rather than actually scanning through the list of files. */ void * @@ -64,7 +64,7 @@ return lf_check_file(-1, filename, S_IFDIR, modemask, owners, owngroups, * Find entry point * *************************************************/ -/* See local README for interface description. We use stat() instead of +/* See local README for interface description. We use lstat() instead of scanning the directory, as it is hopefully faster to let the OS do the scanning for us. */ @@ -93,7 +93,7 @@ if (!string_format(filename, sizeof(filename), "%s/%s", dirname, keystring)) return DEFER; } -if (Ustat(filename, &statbuf) >= 0) +if (Ulstat(filename, &statbuf) >= 0) { *result = string_copy(keystring); return OK; @@ -102,7 +102,7 @@ if (Ustat(filename, &statbuf) >= 0) if (errno == ENOENT) return FAIL; save_errno = errno; -*errmsg = string_sprintf("%s: stat failed", filename); +*errmsg = string_sprintf("%s: lstat failed", filename); errno = save_errno; return DEFER; }