]> andersk Git - openssh.git/blobdiff - sshconnect2.c
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / sshconnect2.c
index 378526bacd57dfc0ee2ee9104ce525fb121df99b..e81064daed1c049e5cb2837d6fa6b5cb8d2742c8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.175 2009/11/20 00:59:36 dtucker Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.179 2010/01/13 01:20:20 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  * Copyright (c) 2008 Damien Miller.  All rights reserved.
@@ -421,7 +421,7 @@ input_userauth_banner(int type, u_int32_t seq, void *ctxt)
                if (len > 65536)
                        len = 65536;
                msg = xmalloc(len * 4 + 1); /* max expansion from strnvis() */
-               strnvis(msg, raw, len * 4 + 1, VIS_SAFE|VIS_OCTAL);
+               strnvis(msg, raw, len * 4 + 1, VIS_SAFE|VIS_OCTAL|VIS_NOSLASH);
                fprintf(stderr, "%s", msg);
                xfree(msg);
        }
@@ -1250,7 +1250,7 @@ load_identity_file(char *filename)
 {
        Key *private;
        char prompt[300], *passphrase;
-       int perm_ok, quit, i;
+       int perm_ok = 0, quit, i;
        struct stat st;
 
        if (stat(filename, &st) < 0) {
@@ -1514,7 +1514,7 @@ ssh_keysign(Key *key, u_char **sigp, u_int *lenp,
        debug2("ssh_keysign called");
 
        if (stat(_PATH_SSH_KEY_SIGN, &st) < 0) {
-               error("ssh_keysign: no installed: %s", strerror(errno));
+               error("ssh_keysign: not installed: %s", strerror(errno));
                return -1;
        }
        if (fflush(stdout) != 0)
@@ -1586,10 +1586,10 @@ userauth_hostbased(Authctxt *authctxt)
        Sensitive *sensitive = authctxt->sensitive;
        Buffer b;
        u_char *signature, *blob;
-       char *chost, *pkalg, *p, myname[NI_MAXHOST];
+       char *chost, *pkalg, *p;
        const char *service;
        u_int blen, slen;
-       int ok, i, len, found = 0;
+       int ok, i, found = 0;
 
        /* check for a useful key */
        for (i = 0; i < sensitive->nkeys; i++) {
@@ -1610,23 +1610,13 @@ userauth_hostbased(Authctxt *authctxt)
                return 0;
        }
        /* figure out a name for the client host */
-       p = NULL;
-       if (packet_connection_is_on_socket())
-               p = get_local_name(packet_get_connection_in());
-       if (p == NULL) {
-               if (gethostname(myname, sizeof(myname)) == -1) {
-                       verbose("userauth_hostbased: gethostname: %s", 
-                           strerror(errno));
-               } else
-                       p = xstrdup(myname);
-       }
+       p = get_local_name(packet_get_connection_in());
        if (p == NULL) {
                error("userauth_hostbased: cannot get local ipaddr/name");
                key_free(private);
                xfree(blob);
                return 0;
        }
-       len = strlen(p) + 2;
        xasprintf(&chost, "%s.", p);
        debug2("userauth_hostbased: chost %s", chost);
        xfree(p);
This page took 0.139729 seconds and 4 git commands to generate.