X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/18f8ef7af1666ffce0b901b9c79f4d3b070b810f..HEAD:/hostfile.c diff --git a/hostfile.c b/hostfile.c index 3ed64624..cd28bf44 100644 --- a/hostfile.c +++ b/hostfile.c @@ -1,3 +1,4 @@ +/* $OpenBSD: hostfile.c,v 1.46 2009/10/11 23:03:15 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -36,18 +37,25 @@ */ #include "includes.h" -RCSID("$OpenBSD: hostfile.c,v 1.36 2005/11/22 03:36:03 dtucker Exp $"); -#include +#include + +#include + #include #include -#include "packet.h" +#include +#include +#include +#include +#include + +#include "xmalloc.h" #include "match.h" #include "key.h" #include "hostfile.h" #include "log.h" -#include "xmalloc.h" static int extract_salt(const char *s, u_int l, char *salt, size_t salt_len) @@ -196,7 +204,7 @@ check_host_in_hostfile_by_key_or_type(const char *filename, char *cp, *cp2, *hashed_host; HostStatus end_return; - debug3("check_host_in_hostfile: filename %s", filename); + debug3("check_host_in_hostfile: host %s filename %s", host, filename); /* Open the file containing the list of known hosts. */ f = fopen(filename, "r"); @@ -254,8 +262,10 @@ check_host_in_hostfile_by_key_or_type(const char *filename, if (key == NULL) { /* we found a key of the requested type */ - if (found->type == keytype) + if (found->type == keytype) { + fclose(f); return HOST_FOUND; + } continue; }