diff options
author | bushman <bushman@FreeBSD.org> | 2007-12-17 16:12:57 +0000 |
---|---|---|
committer | bushman <bushman@FreeBSD.org> | 2007-12-17 16:12:57 +0000 |
commit | 9d2bf43707db1e05e2754eb9fec419c55b009c43 (patch) | |
tree | 11942976cdb26d98d4b4306ce6997a9ab8ecde27 /lib/libc/net/nsdispatch.c | |
parent | 688e538772ebe727560a943892e33c3b2896f740 (diff) | |
download | FreeBSD-src-9d2bf43707db1e05e2754eb9fec419c55b009c43.zip FreeBSD-src-9d2bf43707db1e05e2754eb9fec419c55b009c43.tar.gz |
Moved logging out of the nss_method_lookup() in order not to
flood logs with failed fallback method lookup attempts.
Diffstat (limited to 'lib/libc/net/nsdispatch.c')
-rw-r--r-- | lib/libc/net/nsdispatch.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c index 7f30e4f..eb0fa42 100644 --- a/lib/libc/net/nsdispatch.c +++ b/lib/libc/net/nsdispatch.c @@ -592,9 +592,7 @@ nss_method_lookup(const char *source, const char *database, return (match->method); } } - if (is_dynamic()) - nss_log(LOG_DEBUG, "%s, %s, %s, not found", source, database, - method); + *mdata = NULL; return (NULL); } @@ -701,12 +699,18 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, if (result & (srclist[i].flags)) break; - } else if (fb_method != NULL) { - fallback_dispatch = 1; - va_start(ap, defaults); - result = fb_method(retval, (void *)srclist[i].name, ap); - va_end(ap); - fallback_dispatch = 0; + } else { + if (fb_method != NULL) { + fallback_dispatch = 1; + va_start(ap, defaults); + result = fb_method(retval, + (void *)srclist[i].name, ap); + va_end(ap); + fallback_dispatch = 0; + } else + nss_log(LOG_DEBUG, "%s, %s, %s, not found, " + "and no fallback provided", + srclist[i].name, database, method_name); } } |