diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/lookup_hesiod.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/lookup_hesiod.c b/modules/lookup_hesiod.c index 231377e..757cec2 100644 --- a/modules/lookup_hesiod.c +++ b/modules/lookup_hesiod.c @@ -64,6 +64,7 @@ int lookup_mount(char *root, char *name, int name_len, void *context) { char **hes_result, mapent[HESIOD_LEN + 1]; struct lookup_context *ctxt = (struct lookup_context *) context; + int rv; syslog(LOG_DEBUG, MODPREFIX "looking up root=\"%s\", name=\"%s\"", root, name); @@ -73,14 +74,16 @@ int lookup_mount(char *root, char *name, int name_len, void *context) hes_result = hes_resolve(name, "filsys"); - if(hes_result) { - strncpy(mapent, hes_result[0], sizeof(mapent) - 1); - syslog(LOG_DEBUG, MODPREFIX "lookup for \"%s\" gave \"%s\"", - name, mapent); - free(hes_result); + if ( !hes_result ) { + syslog(LOG_NOTICE, MODPREFIX "entry \"%s\" not found in map\n", name); + return 1; } - - return ctxt->parser->parse_mount(root,name,name_len,mapent,ctxt->parser->context); + + syslog(LOG_DEBUG, MODPREFIX "lookup for \"%s\" gave \"%s\"", + name, hes_result[0]); + rv = ctxt->parser->parse_mount(root,name,name_len,hes_result[0],ctxt->parser->context); + free(hes_result); + return rv; } /* This destroys a context for queries to this module. It releases the parser |