Surprising error IO error is returned when directory name
is given instead of named.conf file. It can be passed to named-checkconf
or include statement. Make a simple change to return Invalid file
instead. Still not precise, but much better error message is returned.
Fix of rhbz#490837.
case ENAMETOOLONG:
case EBADF:
return (ISC_R_INVALIDFILE);
+ case EISDIR:
+ return (ISC_R_NOTFILE);
case ENOENT:
return (ISC_R_FILENOTFOUND);
case EACCES:
#include <isc/string.h>
#include <isc/util.h>
+#include "errno2result.h"
+
typedef struct inputsource {
isc_result_t result;
bool is_file;
#endif /* if defined(HAVE_FLOCKFILE) && defined(HAVE_GETC_UNLOCKED) */
if (c == EOF) {
if (ferror(stream)) {
- source->result = ISC_R_IOERROR;
+ source->result =
+ isc__errno2result(
+ errno);
result = source->result;
goto done;
}