summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-04-03 04:34:15 +0000
committerDamien Miller <djm@mindrot.org>2020-04-03 15:41:28 +1100
commit9cd40b829a5295cc81fbea8c7d632b2478db6274 (patch)
treef8c2b3d892bab8bbe7d761e76735ff76d4b70dcc
parent6ce51a5da5d333a44e7c74c027f3571f70c39b24 (diff)
upstream: Add a flag to re-enable verbose output when in batch
mode; requested in bz3135; ok dtucker OpenBSD-Commit-ID: 5ad2ed0e6440562ba9c84b666a5bbddc1afe2e2b
-rw-r--r--sftp.110
-rw-r--r--sftp.c12
2 files changed, 16 insertions, 6 deletions
diff --git a/sftp.1 b/sftp.1
index 6d69472e1..146d706d8 100644
--- a/sftp.1
+++ b/sftp.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: sftp.1,v 1.128 2019/11/30 07:07:59 jmc Exp $ 1.\" $OpenBSD: sftp.1,v 1.129 2020/04/03 04:34:15 djm Exp $
2.\" 2.\"
3.\" Copyright (c) 2001 Damien Miller. All rights reserved. 3.\" Copyright (c) 2001 Damien Miller. All rights reserved.
4.\" 4.\"
@@ -22,7 +22,7 @@
22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24.\" 24.\"
25.Dd $Mdocdate: November 30 2019 $ 25.Dd $Mdocdate: April 3 2020 $
26.Dt SFTP 1 26.Dt SFTP 1
27.Os 27.Os
28.Sh NAME 28.Sh NAME
@@ -30,7 +30,7 @@
30.Nd OpenSSH secure file transfer 30.Nd OpenSSH secure file transfer
31.Sh SYNOPSIS 31.Sh SYNOPSIS
32.Nm sftp 32.Nm sftp
33.Op Fl 46aCfpqrv 33.Op Fl 46aCfNpqrv
34.Op Fl B Ar buffer_size 34.Op Fl B Ar buffer_size
35.Op Fl b Ar batchfile 35.Op Fl b Ar batchfile
36.Op Fl c Ar cipher 36.Op Fl c Ar cipher
@@ -275,6 +275,10 @@ For full details of the options listed below, and their possible values, see
275.El 275.El
276.It Fl P Ar port 276.It Fl P Ar port
277Specifies the port to connect to on the remote host. 277Specifies the port to connect to on the remote host.
278.It Fl N
279Disables quiet mode, e.g. to override the implicit quiet mode set by the
280.Fl b
281flag.
278.It Fl p 282.It Fl p
279Preserves modification times, access times, and modes from the 283Preserves modification times, access times, and modes from the
280original files transferred. 284original files transferred.
diff --git a/sftp.c b/sftp.c
index fc809dc6e..2cef84db7 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.198 2020/02/26 11:46:51 dtucker Exp $ */ 1/* $OpenBSD: sftp.c,v 1.199 2020/04/03 04:34:15 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -2375,7 +2375,7 @@ usage(void)
2375int 2375int
2376main(int argc, char **argv) 2376main(int argc, char **argv)
2377{ 2377{
2378 int in, out, ch, err, tmp, port = -1; 2378 int in, out, ch, err, tmp, port = -1, noisy = 0;
2379 char *host = NULL, *user, *cp, *file2 = NULL; 2379 char *host = NULL, *user, *cp, *file2 = NULL;
2380 int debug_level = 0; 2380 int debug_level = 0;
2381 char *file1 = NULL, *sftp_server = NULL; 2381 char *file1 = NULL, *sftp_server = NULL;
@@ -2409,7 +2409,7 @@ main(int argc, char **argv)
2409 infile = stdin; 2409 infile = stdin;
2410 2410
2411 while ((ch = getopt(argc, argv, 2411 while ((ch = getopt(argc, argv,
2412 "1246afhpqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:")) != -1) { 2412 "1246afhNpqrvCc:D:i:l:o:s:S:b:B:F:J:P:R:")) != -1) {
2413 switch (ch) { 2413 switch (ch) {
2414 /* Passed through to ssh(1) */ 2414 /* Passed through to ssh(1) */
2415 case '4': 2415 case '4':
@@ -2473,6 +2473,9 @@ main(int argc, char **argv)
2473 case 'f': 2473 case 'f':
2474 global_fflag = 1; 2474 global_fflag = 1;
2475 break; 2475 break;
2476 case 'N':
2477 noisy = 1; /* Used to clear quiet mode after getopt */
2478 break;
2476 case 'p': 2479 case 'p':
2477 global_pflag = 1; 2480 global_pflag = 1;
2478 break; 2481 break;
@@ -2511,6 +2514,9 @@ main(int argc, char **argv)
2511 if (!isatty(STDERR_FILENO)) 2514 if (!isatty(STDERR_FILENO))
2512 showprogress = 0; 2515 showprogress = 0;
2513 2516
2517 if (noisy)
2518 quiet = 0;
2519
2514 log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1); 2520 log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1);
2515 2521
2516 if (sftp_direct == NULL) { 2522 if (sftp_direct == NULL) {