diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-18 09:28:11 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-18 09:28:11 +1100 |
commit | 81428f9d10e81d9fe2e4af10df0c4e38d1192d70 (patch) | |
tree | b19982baa6558d387f3537ef67d64a5f6a38ebd0 /scp.c | |
parent | 10f6f6ba9ee14d306f8780edee8a10640c1643e0 (diff) |
- 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
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -42,11 +42,11 @@ and ssh has the necessary privileges.) | |||
42 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 42 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
43 | * SUCH DAMAGE. | 43 | * SUCH DAMAGE. |
44 | * | 44 | * |
45 | * $Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $ | 45 | * $Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $ |
46 | */ | 46 | */ |
47 | 47 | ||
48 | #include "includes.h" | 48 | #include "includes.h" |
49 | RCSID("$Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $"); | 49 | RCSID("$Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $"); |
50 | 50 | ||
51 | #include "ssh.h" | 51 | #include "ssh.h" |
52 | #include "xmalloc.h" | 52 | #include "xmalloc.h" |
@@ -976,7 +976,7 @@ run_err(const char *fmt, ...) | |||
976 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 976 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
977 | * SUCH DAMAGE. | 977 | * SUCH DAMAGE. |
978 | * | 978 | * |
979 | * $Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $ | 979 | * $Id: scp.c,v 1.7 1999/11/17 22:28:11 damien Exp $ |
980 | */ | 980 | */ |
981 | 981 | ||
982 | char * | 982 | char * |
@@ -1112,6 +1112,19 @@ updateprogressmeter(void) | |||
1112 | errno = save_errno; | 1112 | errno = save_errno; |
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | int | ||
1116 | foregroundproc() | ||
1117 | { | ||
1118 | static pid_t pgrp = -1; | ||
1119 | int ctty_pgrp; | ||
1120 | |||
1121 | if (pgrp == -1) | ||
1122 | pgrp = getpgrp(); | ||
1123 | |||
1124 | return((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 && | ||
1125 | ctty_pgrp == pgrp)); | ||
1126 | } | ||
1127 | |||
1115 | void | 1128 | void |
1116 | progressmeter(int flag) | 1129 | progressmeter(int flag) |
1117 | { | 1130 | { |
@@ -1129,6 +1142,9 @@ progressmeter(int flag) | |||
1129 | lastupdate = start; | 1142 | lastupdate = start; |
1130 | lastsize = 0; | 1143 | lastsize = 0; |
1131 | } | 1144 | } |
1145 | if (foregroundproc() == 0) | ||
1146 | return; | ||
1147 | |||
1132 | (void)gettimeofday(&now, (struct timezone *)0); | 1148 | (void)gettimeofday(&now, (struct timezone *)0); |
1133 | cursize = statbytes; | 1149 | cursize = statbytes; |
1134 | if (totalbytes != 0) { | 1150 | if (totalbytes != 0) { |
@@ -1145,10 +1161,10 @@ progressmeter(int flag) | |||
1145 | if (barlength > 0) { | 1161 | if (barlength > 0) { |
1146 | i = barlength * ratio / 100; | 1162 | i = barlength * ratio / 100; |
1147 | snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), | 1163 | snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), |
1148 | "|%.*s%*s|", i, | 1164 | "|%.*s%*s|", i, |
1149 | "*****************************************************************************" | 1165 | "*****************************************************************************" |
1150 | "*****************************************************************************", | 1166 | "*****************************************************************************", |
1151 | barlength - i, ""); | 1167 | barlength - i, ""); |
1152 | } | 1168 | } |
1153 | 1169 | ||
1154 | i = 0; | 1170 | i = 0; |