~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to auth2-hostbased.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenBSD: auth2-hostbased.c,v 1.11 2006/08/03 03:34:41 deraadt Exp $ */
 
1
/* $OpenBSD: auth2-hostbased.c,v 1.12 2008/07/17 08:51:07 djm Exp $ */
2
2
/*
3
3
 * Copyright (c) 2000 Markus Friedl.  All rights reserved.
4
4
 *
145
145
        HostStatus host_status;
146
146
        int len;
147
147
 
 
148
        if (reject_blacklisted_key(key, 0) == 1)
 
149
                return 0;
 
150
 
148
151
        resolvedname = get_canonical_hostname(options.use_dns);
149
152
        ipaddr = get_remote_ipaddr();
150
153
 
151
154
        debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s",
152
155
            chost, resolvedname, ipaddr);
153
156
 
 
157
        if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') {
 
158
                debug2("stripping trailing dot from chost %s", chost);
 
159
                chost[len - 1] = '\0';
 
160
        }
 
161
 
154
162
        if (options.hostbased_uses_name_from_packet_only) {
155
163
                if (auth_rhosts2(pw, cuser, chost, chost) == 0)
156
164
                        return 0;
157
165
                lookup = chost;
158
166
        } else {
159
 
                if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') {
160
 
                        debug2("stripping trailing dot from chost %s", chost);
161
 
                        chost[len - 1] = '\0';
162
 
                }
163
167
                if (strcasecmp(resolvedname, chost) != 0)
164
168
                        logit("userauth_hostbased mismatch: "
165
169
                            "client sends %s, but we resolve %s to %s",