View | Details | Raw Unified | Return to bug 2021 | Differences between
and this patch

Collapse All | Expand All

(-)sftp-client.c (-20 / +45 lines)
Lines 112-118 send_msg(struct sftp_conn *conn, Buffer Link Here
112
	iov[1].iov_len = buffer_len(m);
112
	iov[1].iov_len = buffer_len(m);
113
113
114
	if (atomiciov6(writev, conn->fd_out, iov, 2,
114
	if (atomiciov6(writev, conn->fd_out, iov, 2,
115
	    conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_out) != 
115
	    conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_out) !=
116
	    buffer_len(m) + sizeof(mlen))
116
	    buffer_len(m) + sizeof(mlen))
117
		fatal("Couldn't send packet: %s", strerror(errno));
117
		fatal("Couldn't send packet: %s", strerror(errno));
118
118
Lines 988-1003 send_read_request(struct sftp_conn *conn Link Here
988
988
989
int
989
int
990
do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
990
do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
991
    Attrib *a, int pflag)
991
    Attrib *a, int pflag, int resume)
992
{
992
{
993
	Attrib junk;
993
	Attrib junk;
994
	Buffer msg;
994
	Buffer msg;
995
	char *handle;
995
	char *handle;
996
	int local_fd, status = 0, write_error;
996
	int local_fd = -1, status = 0, write_error;
997
	int read_error, write_errno;
997
	int read_error, write_errno, reordered = 0;
998
	u_int64_t offset, size;
998
	u_int64_t offset = 0, size, highwater;
999
	u_int handle_len, mode, type, id, buflen, num_req, max_req;
999
	u_int handle_len, mode, type, id, buflen, num_req, max_req;
1000
	off_t progress_counter;
1000
	off_t progress_counter;
1001
	struct stat st;
1001
	struct request {
1002
	struct request {
1002
		u_int id;
1003
		u_int id;
1003
		u_int len;
1004
		u_int len;
Lines 1050-1070 do_download(struct sftp_conn *conn, char Link Here
1050
		return(-1);
1051
		return(-1);
1051
	}
1052
	}
1052
1053
1053
	local_fd = open(local_path, O_WRONLY | O_CREAT | O_TRUNC,
1054
	local_fd = open(local_path, O_WRONLY | O_CREAT | (resume ? : O_TRUNC),
1054
	    mode | S_IWUSR);
1055
	    mode | S_IWUSR);
1055
	if (local_fd == -1) {
1056
	if (local_fd == -1) {
1056
		error("Couldn't open local file \"%s\" for writing: %s",
1057
		error("Couldn't open local file \"%s\" for writing: %s",
1057
		    local_path, strerror(errno));
1058
		    local_path, strerror(errno));
1059
		goto fail;
1060
	}
1061
	if (fstat(local_fd, &st) == -1) {
1062
		error("Unable to stat local file \"%s\": %s",
1063
		    local_path, strerror(errno));
1064
		goto fail;
1065
	}
1066
	offset = highwater = st.st_size;
1067
	if ((size_t)st.st_size > size) {
1068
		error("Unable to resume download of \"%s\": "
1069
		    "local file is larger than remote", local_path);
1070
 fail:
1058
		do_close(conn, handle, handle_len);
1071
		do_close(conn, handle, handle_len);
1059
		buffer_free(&msg);
1072
		buffer_free(&msg);
1060
		free(handle);
1073
		free(handle);
1061
		return(-1);
1074
		return -1;
1062
	}
1075
	}
1063
1076
1064
	/* Read from remote and write to local */
1077
	/* Read from remote and write to local */
1065
	write_error = read_error = write_errno = num_req = offset = 0;
1078
	write_error = read_error = write_errno = num_req = 0;
1066
	max_req = 1;
1079
	max_req = 1;
1067
	progress_counter = 0;
1080
	progress_counter = offset;
1068
1081
1069
	if (showprogress && size != 0)
1082
	if (showprogress && size != 0)
1070
		start_progress_meter(remote_path, size, &progress_counter);
1083
		start_progress_meter(remote_path, size, &progress_counter);
Lines 1139-1144 do_download(struct sftp_conn *conn, char Link Here
1139
				write_error = 1;
1152
				write_error = 1;
1140
				max_req = 0;
1153
				max_req = 0;
1141
			}
1154
			}
1155
			else if (!reordered && req->offset <= highwater)
1156
				highwater = req->offset + len;
1157
			else if (!reordered && req->offset > highwater)
1158
				reordered = 1;
1142
			progress_counter += len;
1159
			progress_counter += len;
1143
			free(data);
1160
			free(data);
1144
1161
Lines 1187-1193 do_download(struct sftp_conn *conn, char Link Here
1187
	/* Sanity check */
1204
	/* Sanity check */
1188
	if (TAILQ_FIRST(&requests) != NULL)
1205
	if (TAILQ_FIRST(&requests) != NULL)
1189
		fatal("Transfer complete, but requests still in queue");
1206
		fatal("Transfer complete, but requests still in queue");
1190
1207
	/* Truncate at highest contiguous point to avoid holes on interrupt */
1208
	if (read_error || write_error || interrupted) {
1209
		if (reordered && resume) {
1210
			error("Unable to resume download of \"%s\": "
1211
			    "server reordered requests", local_path);
1212
		}
1213
		debug("truncating at %llu", highwater);
1214
		ftruncate(local_fd, highwater);
1215
	}
1191
	if (read_error) {
1216
	if (read_error) {
1192
		error("Couldn't read from remote file \"%s\" : %s",
1217
		error("Couldn't read from remote file \"%s\" : %s",
1193
		    remote_path, fx2txt(status));
1218
		    remote_path, fx2txt(status));
Lines 1199-1205 do_download(struct sftp_conn *conn, char Link Here
1199
		do_close(conn, handle, handle_len);
1224
		do_close(conn, handle, handle_len);
1200
	} else {
1225
	} else {
1201
		status = do_close(conn, handle, handle_len);
1226
		status = do_close(conn, handle, handle_len);
1202
1227
		if (interrupted)
1228
			status = -1;
1203
		/* Override umask and utimes if asked */
1229
		/* Override umask and utimes if asked */
1204
#ifdef HAVE_FCHMOD
1230
#ifdef HAVE_FCHMOD
1205
		if (pflag && fchmod(local_fd, mode) == -1)
1231
		if (pflag && fchmod(local_fd, mode) == -1)
Lines 1227-1233 do_download(struct sftp_conn *conn, char Link Here
1227
1253
1228
static int
1254
static int
1229
download_dir_internal(struct sftp_conn *conn, char *src, char *dst,
1255
download_dir_internal(struct sftp_conn *conn, char *src, char *dst,
1230
    Attrib *dirattrib, int pflag, int printflag, int depth)
1256
    Attrib *dirattrib, int pflag, int printflag, int depth, int resume)
1231
{
1257
{
1232
	int i, ret = 0;
1258
	int i, ret = 0;
1233
	SFTP_DIRENT **dir_entries;
1259
	SFTP_DIRENT **dir_entries;
Lines 1280-1290 download_dir_internal(struct sftp_conn * Link Here
1280
				continue;
1306
				continue;
1281
			if (download_dir_internal(conn, new_src, new_dst,
1307
			if (download_dir_internal(conn, new_src, new_dst,
1282
			    &(dir_entries[i]->a), pflag, printflag,
1308
			    &(dir_entries[i]->a), pflag, printflag,
1283
			    depth + 1) == -1)
1309
			    depth + 1, resume) == -1)
1284
				ret = -1;
1310
				ret = -1;
1285
		} else if (S_ISREG(dir_entries[i]->a.perm) ) {
1311
		} else if (S_ISREG(dir_entries[i]->a.perm) ) {
1286
			if (do_download(conn, new_src, new_dst,
1312
			if (do_download(conn, new_src, new_dst,
1287
			    &(dir_entries[i]->a), pflag) == -1) {
1313
			    &(dir_entries[i]->a), pflag, resume) == -1) {
1288
				error("Download of file %s to %s failed",
1314
				error("Download of file %s to %s failed",
1289
				    new_src, new_dst);
1315
				    new_src, new_dst);
1290
				ret = -1;
1316
				ret = -1;
Lines 1317-1323 download_dir_internal(struct sftp_conn * Link Here
1317
1343
1318
int
1344
int
1319
download_dir(struct sftp_conn *conn, char *src, char *dst,
1345
download_dir(struct sftp_conn *conn, char *src, char *dst,
1320
    Attrib *dirattrib, int pflag, int printflag)
1346
    Attrib *dirattrib, int pflag, int printflag, int resume)
1321
{
1347
{
1322
	char *src_canon;
1348
	char *src_canon;
1323
	int ret;
1349
	int ret;
Lines 1328-1334 download_dir(struct sftp_conn *conn, cha Link Here
1328
	}
1354
	}
1329
1355
1330
	ret = download_dir_internal(conn, src_canon, dst,
1356
	ret = download_dir_internal(conn, src_canon, dst,
1331
	    dirattrib, pflag, printflag, 0);
1357
	    dirattrib, pflag, printflag, 0, resume);
1332
	free(src_canon);
1358
	free(src_canon);
1333
	return ret;
1359
	return ret;
1334
}
1360
}
Lines 1553-1559 upload_dir_internal(struct sftp_conn *co Link Here
1553
	a.perm &= 01777;
1579
	a.perm &= 01777;
1554
	if (!pflag)
1580
	if (!pflag)
1555
		a.flags &= ~SSH2_FILEXFER_ATTR_ACMODTIME;
1581
		a.flags &= ~SSH2_FILEXFER_ATTR_ACMODTIME;
1556
	
1582
1557
	status = do_mkdir(conn, dst, &a, 0);
1583
	status = do_mkdir(conn, dst, &a, 0);
1558
	/*
1584
	/*
1559
	 * we lack a portable status for errno EEXIST,
1585
	 * we lack a portable status for errno EEXIST,
Lines 1563-1569 upload_dir_internal(struct sftp_conn *co Link Here
1563
	if (status != SSH2_FX_OK) {
1589
	if (status != SSH2_FX_OK) {
1564
		if (status != SSH2_FX_FAILURE)
1590
		if (status != SSH2_FX_FAILURE)
1565
			return -1;
1591
			return -1;
1566
		if (do_stat(conn, dst, 0) == NULL) 
1592
		if (do_stat(conn, dst, 0) == NULL)
1567
			return -1;
1593
			return -1;
1568
	}
1594
	}
1569
1595
Lines 1571-1577 upload_dir_internal(struct sftp_conn *co Link Here
1571
		error("Failed to open dir \"%s\": %s", src, strerror(errno));
1597
		error("Failed to open dir \"%s\": %s", src, strerror(errno));
1572
		return -1;
1598
		return -1;
1573
	}
1599
	}
1574
	
1600
1575
	while (((dp = readdir(dirp)) != NULL) && !interrupted) {
1601
	while (((dp = readdir(dirp)) != NULL) && !interrupted) {
1576
		if (dp->d_ino == 0)
1602
		if (dp->d_ino == 0)
1577
			continue;
1603
			continue;
Lines 1640-1643 path_append(char *p1, char *p2) Link Here
1640
1666
1641
	return(ret);
1667
	return(ret);
1642
}
1668
}
1643
(-)sftp-client.h (-2 / +2 lines)
Lines 106-118 int do_symlink(struct sftp_conn *, char Link Here
106
 * Download 'remote_path' to 'local_path'. Preserve permissions and times
106
 * Download 'remote_path' to 'local_path'. Preserve permissions and times
107
 * if 'pflag' is set
107
 * if 'pflag' is set
108
 */
108
 */
109
int do_download(struct sftp_conn *, char *, char *, Attrib *, int);
109
int do_download(struct sftp_conn *, char *, char *, Attrib *, int, int);
110
110
111
/*
111
/*
112
 * Recursively download 'remote_directory' to 'local_directory'. Preserve 
112
 * Recursively download 'remote_directory' to 'local_directory'. Preserve 
113
 * times if 'pflag' is set
113
 * times if 'pflag' is set
114
 */
114
 */
115
int download_dir(struct sftp_conn *, char *, char *, Attrib *, int, int);
115
int download_dir(struct sftp_conn *, char *, char *, Attrib *, int, int, int);
116
116
117
/*
117
/*
118
 * Upload 'local_path' to 'remote_path'. Preserve permissions and times
118
 * Upload 'local_path' to 'remote_path'. Preserve permissions and times
(-)sftp.c (-24 / +48 lines)
Lines 88-93 int showprogress = 1; Link Here
88
/* When this option is set, we always recursively download/upload directories */
88
/* When this option is set, we always recursively download/upload directories */
89
int global_rflag = 0;
89
int global_rflag = 0;
90
90
91
/* When this option is set, we resume download if possible */
92
int global_aflag = 0;
93
91
/* When this option is set, the file transfers will always preserve times */
94
/* When this option is set, the file transfers will always preserve times */
92
int global_pflag = 0;
95
int global_pflag = 0;
93
96
Lines 151-156 extern char *__progname; Link Here
151
#define I_SYMLINK	21
154
#define I_SYMLINK	21
152
#define I_VERSION	22
155
#define I_VERSION	22
153
#define I_PROGRESS	23
156
#define I_PROGRESS	23
157
#define I_REGET		26
154
158
155
struct CMD {
159
struct CMD {
156
	const char *c;
160
	const char *c;
Lines 190-195 static const struct CMD cmds[] = { Link Here
190
	{ "put",	I_PUT,		LOCAL	},
194
	{ "put",	I_PUT,		LOCAL	},
191
	{ "pwd",	I_PWD,		REMOTE	},
195
	{ "pwd",	I_PWD,		REMOTE	},
192
	{ "quit",	I_QUIT,		NOARGS	},
196
	{ "quit",	I_QUIT,		NOARGS	},
197
	{ "reget",	I_REGET,	REMOTE	},
193
	{ "rename",	I_RENAME,	REMOTE	},
198
	{ "rename",	I_RENAME,	REMOTE	},
194
	{ "rm",		I_RM,		REMOTE	},
199
	{ "rm",		I_RM,		REMOTE	},
195
	{ "rmdir",	I_RMDIR,	REMOTE	},
200
	{ "rmdir",	I_RMDIR,	REMOTE	},
Lines 239-244 help(void) Link Here
239
	    "                                   filesystem containing 'path'\n"
244
	    "                                   filesystem containing 'path'\n"
240
	    "exit                               Quit sftp\n"
245
	    "exit                               Quit sftp\n"
241
	    "get [-Ppr] remote [local]          Download file\n"
246
	    "get [-Ppr] remote [local]          Download file\n"
247
	    "reget remote [local]		Resume download file\n"
242
	    "help                               Display this help text\n"
248
	    "help                               Display this help text\n"
243
	    "lcd path                           Change local directory to 'path'\n"
249
	    "lcd path                           Change local directory to 'path'\n"
244
	    "lls [ls-options [path]]            Display local directory listing\n"
250
	    "lls [ls-options [path]]            Display local directory listing\n"
Lines 350-357 make_absolute(char *p, char *pwd) Link Here
350
}
356
}
351
357
352
static int
358
static int
353
parse_getput_flags(const char *cmd, char **argv, int argc, int *pflag,
359
parse_getput_flags(const char *cmd, char **argv, int argc,
354
    int *rflag)
360
    int *aflag, int *pflag, int *rflag)
355
{
361
{
356
	extern int opterr, optind, optopt, optreset;
362
	extern int opterr, optind, optopt, optreset;
357
	int ch;
363
	int ch;
Lines 359-367 parse_getput_flags(const char *cmd, char Link Here
359
	optind = optreset = 1;
365
	optind = optreset = 1;
360
	opterr = 0;
366
	opterr = 0;
361
367
362
	*rflag = *pflag = 0;
368
	*aflag = *rflag = *pflag = 0;
363
	while ((ch = getopt(argc, argv, "PpRr")) != -1) {
369
	while ((ch = getopt(argc, argv, "aPpRr")) != -1) {
364
		switch (ch) {
370
		switch (ch) {
371
		case 'a':
372
			*aflag = 1;
373
			break;
365
		case 'p':
374
		case 'p':
366
		case 'P':
375
		case 'P':
367
			*pflag = 1;
376
			*pflag = 1;
Lines 519-525 pathname_is_dir(char *pathname) Link Here
519
528
520
static int
529
static int
521
process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd,
530
process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd,
522
    int pflag, int rflag)
531
    int pflag, int rflag, int resume)
523
{
532
{
524
	char *abs_src = NULL;
533
	char *abs_src = NULL;
525
	char *abs_dst = NULL;
534
	char *abs_dst = NULL;
Lines 571-585 process_get(struct sftp_conn *conn, char Link Here
571
		}
580
		}
572
		free(tmp);
581
		free(tmp);
573
582
574
		if (!quiet)
583
		resume |= global_aflag;
584
		if (!quiet && resume)
585
			printf("Resuming %s to %s\n", g.gl_pathv[i], abs_dst);
586
		else if (!quiet && !resume)
575
			printf("Fetching %s to %s\n", g.gl_pathv[i], abs_dst);
587
			printf("Fetching %s to %s\n", g.gl_pathv[i], abs_dst);
576
		if (pathname_is_dir(g.gl_pathv[i]) && (rflag || global_rflag)) {
588
		if (pathname_is_dir(g.gl_pathv[i]) && (rflag || global_rflag)) {
577
			if (download_dir(conn, g.gl_pathv[i], abs_dst, NULL, 
589
			if (download_dir(conn, g.gl_pathv[i], abs_dst, NULL, 
578
			    pflag || global_pflag, 1) == -1)
590
			    pflag || global_pflag, 1, resume) == -1)
579
				err = -1;
591
				err = -1;
580
		} else {
592
		} else {
581
			if (do_download(conn, g.gl_pathv[i], abs_dst, NULL,
593
			if (do_download(conn, g.gl_pathv[i], abs_dst, NULL,
582
			    pflag || global_pflag) == -1)
594
			    pflag || global_pflag, resume) == -1)
583
				err = -1;
595
				err = -1;
584
		}
596
		}
585
		free(abs_dst);
597
		free(abs_dst);
Lines 1118-1125 makeargv(const char *arg, int *argcp, in Link Here
1118
}
1130
}
1119
1131
1120
static int
1132
static int
1121
parse_args(const char **cpp, int *pflag, int *rflag, int *lflag, int *iflag,
1133
parse_args(const char **cpp, int *aflag, int *hflag, int *iflag, int *lflag,
1122
    int *hflag, int *sflag, unsigned long *n_arg, char **path1, char **path2)
1134
    int *pflag, int *rflag, int *sflag, unsigned long *n_arg,
1135
    char **path1, char **path2)
1123
{
1136
{
1124
	const char *cmd, *cp = *cpp;
1137
	const char *cmd, *cp = *cpp;
1125
	char *cp2, **argv;
1138
	char *cp2, **argv;
Lines 1163-1176 parse_args(const char **cpp, int *pflag, Link Here
1163
	}
1176
	}
1164
1177
1165
	/* Get arguments and parse flags */
1178
	/* Get arguments and parse flags */
1166
	*lflag = *pflag = *rflag = *hflag = *n_arg = 0;
1179
	*aflag = *lflag = *pflag = *rflag = *hflag = *n_arg = 0;
1167
	*path1 = *path2 = NULL;
1180
	*path1 = *path2 = NULL;
1168
	optidx = 1;
1181
	optidx = 1;
1169
	switch (cmdnum) {
1182
	switch (cmdnum) {
1170
	case I_GET:
1183
	case I_GET:
1184
	case I_REGET:
1171
	case I_PUT:
1185
	case I_PUT:
1172
		if ((optidx = parse_getput_flags(cmd, argv, argc,
1186
		if ((optidx = parse_getput_flags(cmd, argv, argc,
1173
		    pflag, rflag)) == -1)
1187
		    aflag, pflag, rflag)) == -1)
1174
			return -1;
1188
			return -1;
1175
		/* Get first pathname (mandatory) */
1189
		/* Get first pathname (mandatory) */
1176
		if (argc - optidx < 1) {
1190
		if (argc - optidx < 1) {
Lines 1185-1190 parse_args(const char **cpp, int *pflag, Link Here
1185
			/* Destination is not globbed */
1199
			/* Destination is not globbed */
1186
			undo_glob_escape(*path2);
1200
			undo_glob_escape(*path2);
1187
		}
1201
		}
1202
		if (*aflag && cmdnum == I_PUT) {
1203
			/* XXX implement resume for uploads */
1204
			error("Resume is not supported for uploads");
1205
			return -1;
1206
		}
1188
		break;
1207
		break;
1189
	case I_LINK:
1208
	case I_LINK:
1190
		if ((optidx = parse_link_flags(cmd, argv, argc, sflag)) == -1)
1209
		if ((optidx = parse_link_flags(cmd, argv, argc, sflag)) == -1)
Lines 1293-1299 parse_dispatch_command(struct sftp_conn Link Here
1293
    int err_abort)
1312
    int err_abort)
1294
{
1313
{
1295
	char *path1, *path2, *tmp;
1314
	char *path1, *path2, *tmp;
1296
	int pflag = 0, rflag = 0, lflag = 0, iflag = 0, hflag = 0, sflag = 0;
1315
	int aflag = 0, hflag = 0, iflag = 0, lflag = 0, pflag = 0;
1316
	int rflag = 0, sflag = 0;
1297
	int cmdnum, i;
1317
	int cmdnum, i;
1298
	unsigned long n_arg = 0;
1318
	unsigned long n_arg = 0;
1299
	Attrib a, *aa;
1319
	Attrib a, *aa;
Lines 1302-1310 parse_dispatch_command(struct sftp_conn Link Here
1302
	glob_t g;
1322
	glob_t g;
1303
1323
1304
	path1 = path2 = NULL;
1324
	path1 = path2 = NULL;
1305
	cmdnum = parse_args(&cmd, &pflag, &rflag, &lflag, &iflag, &hflag,
1325
	cmdnum = parse_args(&cmd, &aflag, &hflag, &iflag, &lflag, &pflag,
1306
	    &sflag, &n_arg, &path1, &path2);
1326
	    &rflag, &sflag, &n_arg, &path1, &path2); 
1307
1308
	if (iflag != 0)
1327
	if (iflag != 0)
1309
		err_abort = 0;
1328
		err_abort = 0;
1310
1329
Lines 1319-1326 parse_dispatch_command(struct sftp_conn Link Here
1319
		/* Unrecognized command */
1338
		/* Unrecognized command */
1320
		err = -1;
1339
		err = -1;
1321
		break;
1340
		break;
1341
	case I_REGET:
1342
		aflag = 1;
1343
		/* FALLTHROUGH */
1322
	case I_GET:
1344
	case I_GET:
1323
		err = process_get(conn, path1, path2, *pwd, pflag, rflag);
1345
		err = process_get(conn, path1, path2, *pwd, pflag,
1346
		    rflag, aflag);
1324
		break;
1347
		break;
1325
	case I_PUT:
1348
	case I_PUT:
1326
		err = process_put(conn, path1, path2, *pwd, pflag, rflag);
1349
		err = process_put(conn, path1, path2, *pwd, pflag, rflag);
Lines 1948-1959 interactive_loop(struct sftp_conn *conn, Link Here
1948
			}
1971
			}
1949
		} else {
1972
		} else {
1950
			/* XXX this is wrong wrt quoting */
1973
			/* XXX this is wrong wrt quoting */
1951
			if (file2 == NULL)
1974
			snprintf(cmd, sizeof cmd, "get%s %s%s%s",
1952
				snprintf(cmd, sizeof cmd, "get %s", dir);
1975
			    global_aflag ? " -a" : "", dir,
1953
			else
1976
			    file2 == NULL ? "" : " ",
1954
				snprintf(cmd, sizeof cmd, "get %s %s", dir,
1977
			    file2 == NULL ? "" : file2);
1955
				    file2);
1956
1957
			err = parse_dispatch_command(conn, cmd,
1978
			err = parse_dispatch_command(conn, cmd,
1958
			    &remote_path, 1);
1979
			    &remote_path, 1);
1959
			free(dir);
1980
			free(dir);
Lines 2142-2148 main(int argc, char **argv) Link Here
2142
	infile = stdin;
2163
	infile = stdin;
2143
2164
2144
	while ((ch = getopt(argc, argv,
2165
	while ((ch = getopt(argc, argv,
2145
	    "1246hpqrvCc:D:i:l:o:s:S:b:B:F:P:R:")) != -1) {
2166
	    "1246ahpqrvCc:D:i:l:o:s:S:b:B:F:P:R:")) != -1) {
2146
		switch (ch) {
2167
		switch (ch) {
2147
		/* Passed through to ssh(1) */
2168
		/* Passed through to ssh(1) */
2148
		case '4':
2169
		case '4':
Lines 2181-2186 main(int argc, char **argv) Link Here
2181
			break;
2202
			break;
2182
		case '2':
2203
		case '2':
2183
			sshver = 2;
2204
			sshver = 2;
2205
			break;
2206
		case 'a':
2207
			global_aflag = 1;
2184
			break;
2208
			break;
2185
		case 'B':
2209
		case 'B':
2186
			copy_buffer_len = strtol(optarg, &cp, 10);
2210
			copy_buffer_len = strtol(optarg, &cp, 10);

Return to bug 2021