=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/auth.c,v retrieving revision 1.148 retrieving revision 1.149 diff -u -r1.148 -r1.149 --- src/usr.bin/ssh/auth.c 2020/10/16 13:26:13 1.148 +++ src/usr.bin/ssh/auth.c 2020/10/18 11:32:01 1.149 @@ -1,4 +1,4 @@ -/* $OpenBSD: auth.c,v 1.148 2020/10/16 13:26:13 djm Exp $ */ +/* $OpenBSD: auth.c,v 1.149 2020/10/18 11:32:01 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -402,10 +402,10 @@ error("WARNING: revoked key for %s attempted authentication", host); else if (host_status == HOST_OK) - debug("%s: key for %s found at %s:%ld", __func__, + debug_f("key for %s found at %s:%ld", found->host, found->file, found->line); else - debug("%s: key for host %s not found", __func__, host); + debug_f("key for host %s not found", host); free_hostkeys(hostkeys); @@ -522,7 +522,7 @@ if ((fp = sshkey_fingerprint(key, options.fingerprint_hash, SSH_FP_DEFAULT)) == NULL) { r = SSH_ERR_ALLOC_FAIL; - error("%s: fingerprint key: %s", __func__, ssh_err(r)); + error_fr(r, "fingerprint key"); goto out; } @@ -535,9 +535,9 @@ sshkey_type(key), fp, options.revoked_keys_file); goto out; default: - error("Error checking authentication key %s %s in " - "revoked keys file %s: %s", sshkey_type(key), fp, - options.revoked_keys_file, ssh_err(r)); + error_r(r, "Error checking authentication key %s %s in " + "revoked keys file %s", sshkey_type(key), fp, + options.revoked_keys_file); goto out; } @@ -563,7 +563,7 @@ vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); if ((r = sshbuf_put_cstring(auth_debug, buf)) != 0) - fatal("%s: sshbuf_put_cstring: %s", __func__, ssh_err(r)); + fatal_fr(r, "sshbuf_put_cstring"); } void @@ -576,8 +576,7 @@ return; while (sshbuf_len(auth_debug) != 0) { if ((r = sshbuf_get_cstring(auth_debug, &msg, NULL)) != 0) - fatal("%s: sshbuf_get_cstring: %s", - __func__, ssh_err(r)); + fatal_fr(r, "sshbuf_get_cstring"); ssh_packet_send_debug(ssh, "%s", msg); free(msg); } @@ -589,7 +588,7 @@ if (auth_debug != NULL) sshbuf_reset(auth_debug); else if ((auth_debug = sshbuf_new()) == NULL) - fatal("%s: sshbuf_new failed", __func__); + fatal_f("sshbuf_new failed"); } struct passwd * @@ -745,17 +744,17 @@ if (child != NULL) *child = NULL; - debug3("%s: %s command \"%s\" running as %s (flags 0x%x)", __func__, + debug3_f("%s command \"%s\" running as %s (flags 0x%x)", tag, command, pw->pw_name, flags); /* Check consistency */ if ((flags & SSH_SUBPROCESS_STDOUT_DISCARD) != 0 && (flags & SSH_SUBPROCESS_STDOUT_CAPTURE) != 0) { - error("%s: inconsistent flags", __func__); + error_f("inconsistent flags"); return 0; } if (((flags & SSH_SUBPROCESS_STDOUT_CAPTURE) == 0) != (child == NULL)) { - error("%s: inconsistent flags/output", __func__); + error_f("inconsistent flags/output"); return 0; } @@ -867,7 +866,7 @@ return 0; } /* Success */ - debug3("%s: %s pid %ld", __func__, tag, (long)pid); + debug3_f("%s pid %ld", tag, (long)pid); if (child != NULL) *child = f; return pid; @@ -952,7 +951,7 @@ struct sshauthopt *old = auth_opts; const char *emsg = NULL; - debug("%s: setting new authentication options", __func__); + debug_f("setting new authentication options"); if ((auth_opts = sshauthopt_merge(old, opts, &emsg)) == NULL) { error("Inconsistent authentication options: %s", emsg); return -1; @@ -966,7 +965,7 @@ { struct sshauthopt *restricted; - debug("%s: restricting session", __func__); + debug_f("restricting session"); /* A blank sshauthopt defaults to permitting nothing */ restricted = sshauthopt_new(); @@ -974,7 +973,7 @@ restricted->restricted = 1; if (auth_activate_options(ssh, restricted) != 0) - fatal("%s: failed to restrict session", __func__); + fatal_f("failed to restrict session"); sshauthopt_free(restricted); } @@ -1049,8 +1048,7 @@ case -1: default: /* invalid */ - error("%s: Certificate source-address invalid", - loc); + error("%s: Certificate source-address invalid", loc); /* FALLTHROUGH */ case 0: logit("%s: Authentication tried for %.100s with valid "