From 81428f9d10e81d9fe2e4af10df0c4e38d1192d70 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 18 Nov 1999 09:28:11 +1100 Subject: - Merged OpenBSD CVS changes - [scp.c] foregroundproc() in scp - [sshconnect.h] include fingerprint.h - [sshd.c] bugfix: the log() for passwd-auth escaped during logging changes. - Added openssh.com info to README --- scp.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'scp.c') diff --git a/scp.c b/scp.c index 2850f76fa..e156f7ba7 100644 --- a/scp.c +++ b/scp.c @@ -42,11 +42,11 @@ and ssh has the necessary privileges.) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $ + * $Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $ */ #include "includes.h" -RCSID("$Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $"); +RCSID("$Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -976,7 +976,7 @@ run_err(const char *fmt, ...) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $ + * $Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $ */ char * @@ -1112,6 +1112,19 @@ updateprogressmeter(void) errno = save_errno; } +int +foregroundproc() +{ + static pid_t pgrp = -1; + int ctty_pgrp; + + if (pgrp == -1) + pgrp = getpgrp(); + + return((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 && + ctty_pgrp == pgrp)); +} + void progressmeter(int flag) { @@ -1129,6 +1142,9 @@ progressmeter(int flag) lastupdate = start; lastsize = 0; } + if (foregroundproc() == 0) + return; + (void)gettimeofday(&now, (struct timezone *)0); cursize = statbytes; if (totalbytes != 0) { @@ -1145,10 +1161,10 @@ progressmeter(int flag) if (barlength > 0) { i = barlength * ratio / 100; snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "|%.*s%*s|", i, + "|%.*s%*s|", i, "*****************************************************************************" "*****************************************************************************", - barlength - i, ""); + barlength - i, ""); } i = 0; -- cgit v1.2.3