mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-25 14:54:45 +02:00
upstream: bring the __func__
OpenBSD-Commit-ID: 71a3a45b0fe1b8f680ff95cf264aa81f7abbff67
This commit is contained in:
parent
483cc723d1
commit
36eaa356d3
12
readpass.c
12
readpass.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: readpass.c,v 1.58 2019/11/27 05:00:17 djm Exp $ */
|
/* $OpenBSD: readpass.c,v 1.59 2019/12/06 02:55:21 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Markus Friedl. All rights reserved.
|
* Copyright (c) 2001 Markus Friedl. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -58,26 +58,26 @@ ssh_askpass(char *askpass, const char *msg)
|
|||||||
void (*osigchld)(int);
|
void (*osigchld)(int);
|
||||||
|
|
||||||
if (fflush(stdout) != 0)
|
if (fflush(stdout) != 0)
|
||||||
error("ssh_askpass: fflush: %s", strerror(errno));
|
error("%s: fflush: %s", __func__, strerror(errno));
|
||||||
if (askpass == NULL)
|
if (askpass == NULL)
|
||||||
fatal("internal error: askpass undefined");
|
fatal("internal error: askpass undefined");
|
||||||
if (pipe(p) == -1) {
|
if (pipe(p) == -1) {
|
||||||
error("ssh_askpass: pipe: %s", strerror(errno));
|
error("%s: pipe: %s", __func__, strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
osigchld = signal(SIGCHLD, SIG_DFL);
|
osigchld = signal(SIGCHLD, SIG_DFL);
|
||||||
if ((pid = fork()) == -1) {
|
if ((pid = fork()) == -1) {
|
||||||
error("ssh_askpass: fork: %s", strerror(errno));
|
error("%s: fork: %s", __func__, strerror(errno));
|
||||||
signal(SIGCHLD, osigchld);
|
signal(SIGCHLD, osigchld);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
close(p[0]);
|
close(p[0]);
|
||||||
if (dup2(p[1], STDOUT_FILENO) == -1)
|
if (dup2(p[1], STDOUT_FILENO) == -1)
|
||||||
fatal("ssh_askpass: dup2: %s", strerror(errno));
|
fatal("%s: dup2: %s", __func__, strerror(errno));
|
||||||
setenv("SSH_ASKPASS_PROMPT", "confirm", 1); /* hint to UI */
|
setenv("SSH_ASKPASS_PROMPT", "confirm", 1); /* hint to UI */
|
||||||
execlp(askpass, askpass, msg, (char *)NULL);
|
execlp(askpass, askpass, msg, (char *)NULL);
|
||||||
fatal("ssh_askpass: exec(%s): %s", askpass, strerror(errno));
|
fatal("%s: exec(%s): %s", __func__, askpass, strerror(errno));
|
||||||
}
|
}
|
||||||
close(p[1]);
|
close(p[1]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user