summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/progressmeter.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace all calls to signal(2) with a wrapper around sigaction(2).dtucker2020-01-231-3/+3
| | | | | | This wrapper blocks all other signals during the handler preventing races between handlers, and sets SA_RESTART which should reduce the potential for short read/write operations.
* Signal handler cleanup: remove leftover support for unreliable signalsdtucker2019-10-291-3/+1
| | | | and now-unneeded save and restore of errno. ok deraadt@ markus@
* Use the correct (according to POSIX) format for left-justificationdtucker2019-05-031-3/+3
| | | | in snmprintf. bz#3002, patch from velemas at gmail.com, ok markus@.
* Have progressmeter force an update at the beginning and end of eachdtucker2019-01-241-8/+5
| | | | | transfer. Fixes the problem recently introduces where very quick transfers do not display the progressmeter at all. Spotted by naddy@
* Sanitize scp filenames via snmprintf. To do this we move thedtucker2019-01-231-29/+24
| | | | | | progressmeter formatting outside of signal handler context and have the atomicio callback called for EINTR too. bz#2434 with contributions from djm and jjelen at redhat.com, ok djm@
* Explicitly check for 100% completion to avoid potential floating pointdtucker2016-06-301-4/+4
| | | | | rounding error, which could cause progressmeter to report 99% on completion. While there invert the test so the 100% case is clearer. with & ok djm@
* Backout rev. 1.43 for now.schwarze2016-05-301-27/+24
| | | | | | | | The function update_progress_meter() calls refresh_progress_meter() which calls snmprintf() which calls malloc(); but update_progress_meter() acts as the SIGALRM signal handler. "malloc(): error: recursive call" reported by sobrado@.
* To prevent screwing up terminal settings when printing to theschwarze2016-05-251-24/+27
| | | | | | | | | | | | | | | | | | | | | terminal, for ASCII and UTF-8, escape bytes not forming characters and bytes forming non-printable characters with vis(3) VIS_OCTAL. For other character sets, abort printing of the current string in these cases. In particular, * let scp(1) respect the local user's LC_CTYPE locale(1); * sanitize data received from the remote host; * sanitize filenames, usernames, and similar data even locally; * take character display widths into account for the progressmeter. This is believed to be sufficient to keep the local terminal safe on OpenBSD, but bad things can still happen on other systems with state-dependent locales because many places in the code print unencoded ASCII characters into the output stream. Using feedback from djm@ and martijn@, various aspects discussed with many others. deraadt@ says it should go in now, i probably already hesitated too long
* Improve precision of progressmeter for sftp and scp by storing sub-seconddtucker2016-03-021-7/+6
| | | | timestamps. Pointed out by mmcc@, ok deraadt@ markus@
* update sftp client and server to new buffer API.djm2015-01-141-3/+3
| | | | pretty much just mechanical changes; with & ok markus
* store the initial file offset so the progress meter doesn't freak outdjm2013-09-191-3/+5
| | | | when resuming sftp transfers. bz#2137; patch from Iain Morgan; ok dtucker@
* Add misc.h for monotim prototype.dtucker2013-06-021-1/+2
|
* Use clock_gettime(CLOCK_MONOTONIC ...) for ssh timers so that things likedtucker2013-06-011-3/+3
| | | | | keepalives and rekeying will work properly over clock steps. Suggested by markus@, "looks good" djm@.
* almost entirely get rid of the culture of ".h files that include .h files"deraadt2006-08-031-3/+2
| | | | | ok djm, sort of ok stevesk makes the pain stop in one easy step
* clean extra spacesstevesk2006-08-011-2/+2
|
* move #include <stdio.h> out of includes.hstevesk2006-08-011-1/+2
|
* move #include <string.h> out of includes.hstevesk2006-07-221-1/+2
|
* move #include <time.h> out of includes.hstevesk2006-07-221-1/+2
|
* ARGSUSED for signal handlerstevesk2006-07-211-1/+2
|
* move #include <unistd.h> out of includes.hstevesk2006-07-171-1/+3
|
* move #include <errno.h> out of includes.h; ok markus@stevesk2006-07-111-1/+2
|
* Put $OpenBSD$ tags back (as comments) to replace the RCSID()s thatdjm2006-03-251-0/+1
| | | | Theo nuked - our scripts to sync -portable need them in the files
* ARGSUSED for signal handlersderaadt2006-03-191-0/+1
|
* RCSID() can diederaadt2006-03-191-1/+0
|
* move #include <signal.h> out of includes.h; ok markus@stevesk2006-02-201-1/+3
|
* move #include <sys/ioctl.h> out of includes.h; ok markus@stevesk2006-02-101-1/+3
|
* catch SIGWINCH and resize progress meter accordingly; ok markus dtuckerjaredy2005-06-071-13/+34
|
* add snprintf checks. ok djm@ markus@moritz2005-04-281-1/+3
|
* spacesderaadt2004-07-111-9/+9
|
* make ssh -Wshadow clean, no functional changesavsm2004-06-211-3/+3
| | | | markus@ ok
* improve some code lint did not like; djm millert okderaadt2004-05-111-2/+2
|
* fix ETA for > 4GB; bugzilla #791; ok henning@ deraadt@markus2004-02-051-2/+2
|
* improvments from andreas@:markus2003-12-021-3/+7
| | | | | | | * saner speed estimate for transfers that takes less than a second by rounding the time to 1 second. * when the transfer is finished calculate the actual total speed rather than the current speed which is given during the transfer
* fix rounding errors; from andreas@markus2003-11-201-2/+2
|
* don't print trailing \0; bug #709; Robert.Dahlem@siemens.commarkus2003-09-231-2/+2
| | | | ok millert/deraadt@
* do write to buf[-1]markus2003-08-311-1/+3
|
* pass file_size + 1 to snprintf: fixes printing of truncatedmarkus2003-08-311-2/+2
| | | | file names; fix based on patch/report from sturm@;
* print rate similar old version; round instead truncate;markus2003-07-311-5/+27
|
* whitespacemarkus2003-07-301-4/+3
|
* use only 4 digits in format_sizemarkus2003-07-301-6/+4
|
* fix length for "- stalled -"markus2003-07-291-2/+2
|
* replace 4 clause BSD licensed progressmeter code with a replacementmarkus2003-07-291-201/+182
| | | | from Nils Nordman and myself; ok deraadt@
* deal with typing of write vs read in atomicioderaadt2003-06-281-3/+3
|
* mostly ansi cleanup; pval okderaadt2003-06-101-3/+3
|
* The UCB copyright here is incorrect. This code did not originatemillert2003-04-071-21/+25
| | | | | at UCB, it was written by Luke Mewburn. Updated the copyright at the author's request. markus@ OK
* remove $OpenBSD$, as other *.c does not have it.itojun2003-04-031-3/+1
|
* $OpenBSD$itojun2003-04-031-1/+3
|
* don't print \n if backgrounded; from ho@markus2003-03-171-2/+3
|
* allow WARNINGS=yes; ok djm@markus2003-01-121-2/+3
|
* sftp progress meter support.fgsch2003-01-101-0/+256
original diffs by Nils Nordman <nino at nforced dot com> via markus@, merged to -current by me, djm@ ok.