=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/readpass.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- src/usr.bin/ssh/readpass.c 2020/10/03 09:22:26 1.64 +++ src/usr.bin/ssh/readpass.c 2020/10/18 11:32:01 1.65 @@ -1,4 +1,4 @@ -/* $OpenBSD: readpass.c,v 1.64 2020/10/03 09:22:26 djm Exp $ */ +/* $OpenBSD: readpass.c,v 1.65 2020/10/18 11:32:01 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -55,27 +55,27 @@ void (*osigchld)(int); if (fflush(stdout) != 0) - error("%s: fflush: %s", __func__, strerror(errno)); + error_f("fflush: %s", strerror(errno)); if (askpass == NULL) fatal("internal error: askpass undefined"); if (pipe(p) == -1) { - error("%s: pipe: %s", __func__, strerror(errno)); + error_f("pipe: %s", strerror(errno)); return NULL; } osigchld = ssh_signal(SIGCHLD, SIG_DFL); if ((pid = fork()) == -1) { - error("%s: fork: %s", __func__, strerror(errno)); + error_f("fork: %s", strerror(errno)); ssh_signal(SIGCHLD, osigchld); return NULL; } if (pid == 0) { close(p[0]); if (dup2(p[1], STDOUT_FILENO) == -1) - fatal("%s: dup2: %s", __func__, strerror(errno)); + fatal_f("dup2: %s", strerror(errno)); if (env_hint != NULL) setenv("SSH_ASKPASS_PROMPT", env_hint, 1); execlp(askpass, askpass, msg, (char *)NULL); - fatal("%s: exec(%s): %s", __func__, askpass, strerror(errno)); + fatal_f("exec(%s): %s", askpass, strerror(errno)); } close(p[1]); @@ -138,7 +138,7 @@ rppflags = (flags & RP_ECHO) ? RPP_ECHO_ON : RPP_ECHO_OFF; if (use_askpass) - debug("%s: requested to askpass", __func__); + debug_f("requested to askpass"); else if (flags & RP_USE_ASKPASS) use_askpass = 1; else if (flags & RP_ALLOW_STDIN) { @@ -239,7 +239,7 @@ va_end(args); if (fflush(NULL) != 0) - error("%s: fflush: %s", __func__, strerror(errno)); + error_f("fflush: %s", strerror(errno)); if (!force_askpass && isatty(STDERR_FILENO)) { (void)write(STDERR_FILENO, "\r", 1); (void)write(STDERR_FILENO, prompt, strlen(prompt)); @@ -249,35 +249,35 @@ if ((askpass = getenv("SSH_ASKPASS")) == NULL) askpass = _PATH_SSH_ASKPASS_DEFAULT; if (*askpass == '\0') { - debug3("%s: cannot notify: no askpass", __func__); + debug3_f("cannot notify: no askpass"); goto out; } if (getenv("DISPLAY") == NULL && ((s = getenv(SSH_ASKPASS_REQUIRE_ENV)) == NULL || strcmp(s, "force") != 0)) { - debug3("%s: cannot notify: no display", __func__); + debug3_f("cannot notify: no display"); goto out; } osigchld = ssh_signal(SIGCHLD, SIG_DFL); if ((pid = fork()) == -1) { - error("%s: fork: %s", __func__, strerror(errno)); + error_f("fork: %s", strerror(errno)); ssh_signal(SIGCHLD, osigchld); free(prompt); return NULL; } if (pid == 0) { if (stdfd_devnull(1, 1, 0) == -1) - fatal("%s: stdfd_devnull failed", __func__); + fatal_f("stdfd_devnull failed"); closefrom(STDERR_FILENO + 1); setenv("SSH_ASKPASS_PROMPT", "none", 1); /* hint to UI */ execlp(askpass, askpass, prompt, (char *)NULL); - error("%s: exec(%s): %s", __func__, askpass, strerror(errno)); + error_f("exec(%s): %s", askpass, strerror(errno)); _exit(1); /* NOTREACHED */ } if ((ret = calloc(1, sizeof(*ret))) == NULL) { kill(pid, SIGTERM); - fatal("%s: calloc failed", __func__); + fatal_f("calloc failed"); } ret->pid = pid; ret->osigchld = osigchld; @@ -301,7 +301,7 @@ break; } if (ret == -1) - fatal("%s: waitpid: %s", __func__, strerror(errno)); + fatal_f("waitpid: %s", strerror(errno)); ssh_signal(SIGCHLD, ctx->osigchld); free(ctx); }