OpenBSD CVS

CVS log for src/usr.bin/ftp/ftp.c


[BACK] Up to [local] / src / usr.bin / ftp

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.109 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:11 2023 UTC (14 months, 1 week ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.108: +1 -9 lines
Diff to previous 1.108 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.108 / (download) - annotate - [select for diffs], Thu Sep 15 12:47:10 2022 UTC (20 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.107: +5 -8 lines
Diff to previous 1.107 (colored)

Use non-blocking connect() with ppoll() and timeout instead of alarm().
For hosts with multiple IP addrs this makes it possible to fall
over from an unresponsive IP to another.  This also replaces the
other connect(2) + connect_wait() calls with timed_connect() so the
-w option now works for more that just http.  OK sthen@ deraadt@

Revision 1.107 / (download) - annotate - [select for diffs], Mon Nov 18 04:37:35 2019 UTC (4 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.106: +11 -12 lines
Diff to previous 1.106 (colored)

various knf and whitespace; ok jca

Revision 1.106 / (download) - annotate - [select for diffs], Tue Oct 15 01:24:07 2019 UTC (4 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.105: +7 -6 lines
Diff to previous 1.105 (colored)

When setting the modification time on the retrieved file, use utimensat()
with UTIME_OMIT for the atime, instead of setting the atime to the current
time.

ok jca@ cheloha@

Revision 1.105 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:01 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.104: +35 -35 lines
Diff to previous 1.104 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.104 / (download) - annotate - [select for diffs], Thu May 16 12:44:17 2019 UTC (5 years ago) by florian
Branch: MAIN
Changes since 1.103: +1973 -337 lines
Diff to previous 1.103 (colored)

Revert suni'ls ftp rewrite for now.
We are juggling too many things at the moment and we can't deal with
the differences in behaviour right now.

Revision 1.103 / (download) - annotate - [select for diffs], Mon May 13 16:04:49 2019 UTC (5 years ago) by tb
Branch: MAIN
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

ephermal -> ephemeral

From Hiltjo Posthuma

Revision 1.102 / (download) - annotate - [select for diffs], Sun May 12 20:58:19 2019 UTC (5 years ago) by jasper
Branch: MAIN
Changes since 1.101: +2 -0 lines
Diff to previous 1.101 (colored)

add rcs ids

Revision 1.101 / (download) - annotate - [select for diffs], Sun May 12 20:44:39 2019 UTC (5 years ago) by kmos
Branch: MAIN
Changes since 1.100: +336 -1974 lines
Diff to previous 1.100 (colored)

Move us from old ftp(1) to Sunil's new ftp(1). The necessary modifications
have been made to make it behave. Any new misbehaviors can be fixed in tree.

OK florian@ deraadt@ "Have you committed ftp yet?"

Revision 1.100 / (download) - annotate - [select for diffs], Mon Aug 22 16:27:00 2016 UTC (7 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.99: +56 -63 lines
Diff to previous 1.99 (colored)

Replace "union sockunion" with "union sockaddr_union" which is also
used in the kernel.  This makes it possible to remove the casts to
"struct sockaddr *" when calling networking syscalls.
OK jsing@ jca@

Revision 1.99 / (download) - annotate - [select for diffs], Sat Aug 20 20:18:42 2016 UTC (7 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.98: +10 -5 lines
Diff to previous 1.98 (colored)

Use connect(2) + a connect_wait() function instead of connect_sync(),
similar to the example in connect(2).  OK tedu@

Revision 1.98 / (download) - annotate - [select for diffs], Thu Aug 18 16:23:06 2016 UTC (7 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.97: +1 -31 lines
Diff to previous 1.97 (colored)

Move connect_sync() to util.c and use it when connecting via http
too.  OK sthen@ deraadt@

Revision 1.97 / (download) - annotate - [select for diffs], Tue Aug 9 12:09:40 2016 UTC (7 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.96: +33 -8 lines
Diff to previous 1.96 (colored)

When connect(2) is interrupted by a signal it continues asynchronously
and you need to do the same poll(2) dance as if the socket was
non-blocking.  Fixes a crash when the window is resized while
connecting.  OK deraadt@

Revision 1.96 / (download) - annotate - [select for diffs], Wed Mar 16 15:41:11 2016 UTC (8 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (colored)

More "(<blah> *)0" -> NULL, avoiding any stdarg functions.

Feedback millert@ kettenis@

Revision 1.95 / (download) - annotate - [select for diffs], Sat Dec 5 22:28:40 2015 UTC (8 years, 5 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.94: +7 -2 lines
Diff to previous 1.94 (colored)

Let special/ftp compile again. 'ares' is only used inside #ifndef SMALL, so
declare it inside #ifdef SMALL.

Revision 1.94 / (download) - annotate - [select for diffs], Sat Dec 5 22:20:44 2015 UTC (8 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.93: +11 -11 lines
Diff to previous 1.93 (colored)

Send bad whitespace to the attic.

Revision 1.93 / (download) - annotate - [select for diffs], Sat Dec 5 22:14:04 2015 UTC (8 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.92: +3 -1 lines
Diff to previous 1.92 (colored)

Silence gcc whining about using 'serrno' uninitialized by initializing
it to 0.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Sep 27 05:25:01 2015 UTC (8 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.91: +1 -2 lines
Diff to previous 1.91 (colored)

lint is dead: delete the trivial uses of /* VARARGS[0-9]+ */
(others require more care)

Revision 1.91 / (download) - annotate - [select for diffs], Mon Feb 9 08:24:20 2015 UTC (9 years, 3 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.90: +1 -21 lines
Diff to previous 1.90 (colored)

various defines always exist, so delete the ifdef test.
the socks support seems to be dead, since there are no other references.
also, redeclaring a standard function? that's a no-no.
custom compiles with gate-ftp servers don't need to be supported either.
ok deraadt

Revision 1.90 / (download) - annotate - [select for diffs], Fri Jan 30 04:45:45 2015 UTC (9 years, 3 months ago) by tedu
Branch: MAIN
Changes since 1.89: +1 -4 lines
Diff to previous 1.89 (colored)

remove tenex transfer support. if you still have TOPS20 machines in
service, you'll need to stick with openbsd 5.6.
bonus: remove references to ebcdic.
ok deraadt

Revision 1.89 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:08 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.88: +6 -6 lines
Diff to previous 1.88 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.88 / (download) - annotate - [select for diffs], Fri Oct 24 02:01:20 2014 UTC (9 years, 6 months ago) by lteo
Branch: MAIN
Changes since 1.87: +1 -2 lines
Diff to previous 1.87 (colored)

Remove unnecessary include: netinet/in_systm.h is not needed by these
programs.

ok deraadt@ millert@

Revision 1.87 / (download) - annotate - [select for diffs], Sat Aug 16 07:49:27 2014 UTC (9 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.86: +18 -12 lines
Diff to previous 1.86 (colored)

I found a number of interactive events which can cause signals, and go
down paths not previously marked as signal handled unsafe.  Try to clean
up a few of them especially regarding errno, mark others as unsafe, and
repair a few by avoiding stdio.  Glanced at by misc people in Slovenia,
but considered too risky before release..

Revision 1.86 / (download) - annotate - [select for diffs], Tue May 20 01:25:23 2014 UTC (10 years ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.85: +11 -11 lines
Diff to previous 1.85 (colored)

Use errc/warnc to simplify code.
Also, in 'ftp', always put the error message last, after the hostname/ipaddr.

ok jsing@ krw@ millert@

Revision 1.85 / (download) - annotate - [select for diffs], Tue Apr 22 20:48:41 2014 UTC (10 years ago) by tedu
Branch: MAIN
Changes since 1.84: +3 -15 lines
Diff to previous 1.84 (colored)

remove dead stores to error. from Fritjof Bornebusch

Revision 1.84 / (download) - annotate - [select for diffs], Fri Dec 20 13:44:51 2013 UTC (10 years, 5 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.83: +4 -2 lines
Diff to previous 1.83 (colored)

When writing a file, break out when we get a write(2) error, not
just EPIPE, else we'll just reattempt the write with non-sensical
values.  From Maxime Villard (max at m00nbsd dot net).

Revision 1.83 / (download) - annotate - [select for diffs], Wed Nov 13 20:41:14 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.82: +10 -10 lines
Diff to previous 1.82 (colored)

protos

Revision 1.82 / (download) - annotate - [select for diffs], Mon Apr 30 13:41:26 2012 UTC (12 years ago) by haesbaert
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.81: +72 -2 lines
Diff to previous 1.81 (colored)

Add a -s flag to ftp(1) to let the user specify the source IP address
of the connection. This is useful for testing ftp(1) over VPN tunnels.

This -s flag is present in the other BSDs, including OS X.

All work was done by Lawrence Teo, thanks (-:.

ok myself mikeb

Revision 1.81 / (download) - annotate - [select for diffs], Fri Sep 3 03:49:37 2010 UTC (13 years, 8 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.80: +5 -4 lines
Diff to previous 1.80 (colored)

Make second parameter of poll() the correct type. Removes compile warning.

advice and ok martynas@

Revision 1.80 / (download) - annotate - [select for diffs], Fri Jul 2 22:01:10 2010 UTC (13 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.79: +3 -1 lines
Diff to previous 1.79 (colored)

#ifndef SMALL a few more things to save space on the ramdisks

Revision 1.79 / (download) - annotate - [select for diffs], Sat Jun 6 23:14:44 2009 UTC (14 years, 11 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.78: +24 -5 lines
Diff to previous 1.78 (colored)

make it possible to abort transfers of broken ftp servers.  first
interrupt will do the standard abort procedure per rfc959.  second
interrupt will force the abort, and close the connection.
done after email from halex@ couple of months ago.  liked by many
"I like this a lot" marco@.  ok halex@, millert@, phessler@

Revision 1.78 / (download) - annotate - [select for diffs], Mon Apr 27 23:20:48 2009 UTC (15 years ago) by martynas
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

in silent mode, shut up connect to address warning since it spams
install media if, e.g. ipv6 is not present
discussed with theo, sthen@, millert@, todd@

Revision 1.77 / (download) - annotate - [select for diffs], Mon Apr 27 22:51:51 2009 UTC (15 years ago) by martynas
Branch: MAIN
Changes since 1.76: +3 -1 lines
Diff to previous 1.76 (colored)

remove uploading and macros support from install media;  to save
some space
discussed with theo, todd@, millert@
tested and looked over by sthen@

Revision 1.76 / (download) - annotate - [select for diffs], Mon Apr 27 21:37:13 2009 UTC (15 years ago) by deraadt
Branch: MAIN
Changes since 1.75: +1 -5 lines
Diff to previous 1.75 (colored)

toast the rcsid strings which just get in the way

Revision 1.75 / (download) - annotate - [select for diffs], Sun Apr 26 21:26:03 2009 UTC (15 years ago) by martynas
Branch: MAIN
Changes since 1.74: +6 -6 lines
Diff to previous 1.74 (colored)

figure out titles automatically by using remote file name.  remove
-T and just show titles by default for non-verbose transfers;
discussed with, ok theo, sthen@

Revision 1.74 / (download) - annotate - [select for diffs], Sat Apr 25 12:22:19 2009 UTC (15 years ago) by martynas
Branch: MAIN
Changes since 1.73: +8 -2 lines
Diff to previous 1.73 (colored)

guard NOOP code (that tries to send remaining NOOP string) after
server closes connection during any get/put transfer.  it dereferences
cout, which will be NULL, oops

originally reported on misc@.  pirofti@ can't reproduce it again
since the server has been fixed

tested by simulating the very same failure
sthen@ and pirofti@ agree that my analysis is correct
ok sthen@

Revision 1.73 / (download) - annotate - [select for diffs], Tue Jul 8 21:07:57 2008 UTC (15 years, 10 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.72: +22 -7 lines
Diff to previous 1.72 (colored)

- add support for recursive transfers (but not for floppies), e.g.
'mget -cr 4.*' would recursively fetch (-r), and resume the previous
transfers (-c) of 4.X release directories
uses local matching (fnmatch), but only for recursive transfers.
current behavior is not changed in any way.
- while here, ifndef SMALL debugging stuff, this saves some space,
for floppies
- some debugging code was enabled for non-debugging mode, checks
assume debug is set to zero, but it's not initially set
- all "Confirm with" prompts are forced, remove redundant argument
- fix usage: -C and -c are not available for SMALL

discussed a year ago w/ pyr@
looks good to millert@
previous version looked good to pyr@
man page tweaks & ok jmc@

Revision 1.72 / (download) - annotate - [select for diffs], Wed Jun 25 21:15:19 2008 UTC (15 years, 10 months ago) by martynas
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored)

in resume mode, pass -c to mget when {dir,file}hasglob, so that i'm
able to continue multiple transfers with -C;  ok millert@
while here fix some comments (!SMALL vs. SMALL stuff), and add
missing

Revision 1.71 / (download) - annotate - [select for diffs], Wed Jun 25 18:07:00 2008 UTC (15 years, 10 months ago) by martynas
Branch: MAIN
Changes since 1.70: +4 -7 lines
Diff to previous 1.70 (colored)

- fix -Wall (no behavior change, a || b && c = a || (b && c) anyway)
- use argv[0] for "Confirm with", as other confirm()s do
- fix confirm cases, pass force=1 for mdelete and mabort too, fixes
a bug when you end up deleting all files when you ^C, instead of
getting a confirmation
- add reput command, that will allow to continue transfer uploads
- add -c for mget and mput, that will allow to continue multiple
transfers
- fix a bug when you use restart command together with put.  the
progressmeter would start from zero, and eta would show fictional
time.  this actually allows reput/put -c to have correct progressmeter
too
- document everything
discussed with, suggestions, reminded to ifdef SMALL the code so
we're able to fit in floppies, and ok millert@, and jmc@

Revision 1.70 / (download) - annotate - [select for diffs], Sat May 24 00:42:35 2008 UTC (15 years, 11 months ago) by pyr
Branch: MAIN
Changes since 1.69: +4 -3 lines
Diff to previous 1.69 (colored)

Enclose an informational message in a verbose check.
From Alexander Hall <alexander@beard.se>
ok henning@, ``I suppose so'' deraadt@

Revision 1.69 / (download) - annotate - [select for diffs], Sat Apr 12 21:20:58 2008 UTC (16 years, 1 month ago) by ray
Branch: MAIN
Changes since 1.68: +34 -19 lines
Diff to previous 1.68 (colored)

Protect errno from being trashed by other functions.

okay okan.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Mar 10 22:56:43 2008 UTC (16 years, 2 months ago) by espie
Branch: MAIN
Changes since 1.67: +3 -3 lines
Diff to previous 1.67 (colored)

turn on keepalive by default (one byte every 60 seconds)
okay beck@, deraadt@, krw@

Revision 1.67 / (download) - annotate - [select for diffs], Sat Jun 16 08:58:33 2007 UTC (16 years, 11 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.66: +77 -2 lines
Diff to previous 1.66 (colored)

implement a `keep-alive' option that sends bytes over an inactive
connection. The FTP protocol provides us with a NOOP operation that
is perfectly suitable for that, and so far servers are happy with it.
Sending the command slowly is an idea I borrowed from spamd.
No change for people not using the option, so it can't break normal ftp.

okay beck@, jmc@

Revision 1.66 / (download) - annotate - [select for diffs], Tue Mar 6 05:16:01 2007 UTC (17 years, 2 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.65: +11 -2 lines
Diff to previous 1.65 (colored)

Since our ftp client opportuniticly tries EPSV, then falls back to PASV for
older clients, dont' spew out "500 unimplimented" when a sever that
doesn't do EPSV doesn't like it, just notice, and fall back to PASV, then
complain if that fails.
ok deraadt@

Revision 1.65 / (download) - annotate - [select for diffs], Fri Jun 23 20:35:25 2006 UTC (17 years, 11 months ago) by steven
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.64: +3 -4 lines
Diff to previous 1.64 (colored)

free and sl_free already check against NULL, remove a few unneeded ifs.

ok otto

Revision 1.64 / (download) - annotate - [select for diffs], Tue May 16 23:43:16 2006 UTC (18 years ago) by ray
Branch: MAIN
Changes since 1.63: +8 -8 lines
Diff to previous 1.63 (colored)

Remove shadowing variables and properly use /* FALLTHROUGH */
comments.  No binary change.

Found by lint.

OK beck@, deraadt@

Revision 1.63 / (download) - annotate - [select for diffs], Tue May 16 16:20:42 2006 UTC (18 years ago) by deraadt
Branch: MAIN
Changes since 1.62: +6 -2 lines
Diff to previous 1.62 (colored)

https URL support; rototilled by a few people including me; originally
from Rainer_Giedat@genua.de

Revision 1.62 / (download) - annotate - [select for diffs], Tue Apr 25 05:45:20 2006 UTC (18 years ago) by tedu
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

two strtol calls that were begging to be converted to strtonum

Revision 1.61 / (download) - annotate - [select for diffs], Thu Feb 16 07:41:01 2006 UTC (18 years, 3 months ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.60: +2 -5 lines
Diff to previous 1.60 (colored)

delete a few double declarations; ok otto

Revision 1.60 / (download) - annotate - [select for diffs], Tue Jan 10 18:12:46 2006 UTC (18 years, 4 months ago) by moritz
Branch: MAIN
Changes since 1.59: +4 -2 lines
Diff to previous 1.59 (colored)

Prevent close() from clobbering errno. ok otto@ deraadt@

From Ray Lai

Revision 1.59 / (download) - annotate - [select for diffs], Sun Nov 13 20:26:09 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.58: +6 -6 lines
Diff to previous 1.58 (colored)

fseeko() and lseek() have different return values.  cope with that correctly.  spotted by dhill@mindcry.org

Revision 1.58 / (download) - annotate - [select for diffs], Sun Oct 30 15:17:41 2005 UTC (18 years, 6 months ago) by sturm
Branch: MAIN
Changes since 1.57: +5 -5 lines
Diff to previous 1.57 (colored)

restart_point is of type off_t, so use it with fseeko() and cast it
to long long for printing

this way we can reget partially downloaded files of more than 2GB on
i386

noticed by Thilo Hannemann <hannemann at physnet.uni-hamburg.de>
ok djm@

Revision 1.57 / (download) - annotate - [select for diffs], Thu Sep 16 04:39:16 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.56: +26 -16 lines
Diff to previous 1.56 (colored)

type corrections and other delinting

Revision 1.56 / (download) - annotate - [select for diffs], Tue Jul 20 03:50:25 2004 UTC (19 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.55: +21 -39 lines
Diff to previous 1.55 (colored)

ansi; khalek@linuxgamers.net

Revision 1.55 / (download) - annotate - [select for diffs], Tue Dec 16 21:46:22 2003 UTC (20 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.54: +4 -8 lines
Diff to previous 1.54 (colored)

for -DSMALL, do not include rcsid[]s

Revision 1.54 / (download) - annotate - [select for diffs], Mon Aug 11 21:23:58 2003 UTC (20 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.53: +24 -35 lines
Diff to previous 1.53 (colored)

The empty() function basically effects a poll, so replace it with
real poll().  Gets rid of another static select().  OK deraadt@

Revision 1.53 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:08 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.52: +3 -7 lines
Diff to previous 1.52 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.52 / (download) - annotate - [select for diffs], Sat Apr 5 17:19:47 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.51: +7 -7 lines
Diff to previous 1.51 (colored)

string fixes; ok miod henning

Revision 1.51 / (download) - annotate - [select for diffs], Tue Mar 11 04:01:29 2003 UTC (21 years, 2 months ago) by itojun
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

getnameinfo buffer has to be NI_MAXHOST

Revision 1.50 / (download) - annotate - [select for diffs], Tue Mar 11 04:01:11 2003 UTC (21 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.49: +10 -7 lines
Diff to previous 1.49 (colored)

check error on getnameinfo failure.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Jul 4 10:08:00 2002 UTC (21 years, 10 months ago) by jakob
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.48: +16 -2 lines
Diff to previous 1.48 (colored)

use tcp high portrange for active data connections. ok deraadt@

Revision 1.48 / (download) - annotate - [select for diffs], Sun Jun 9 02:36:03 2002 UTC (21 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored)

strlcpy fix, PR 2727

Revision 1.47 / (download) - annotate - [select for diffs], Sun Jun 9 00:40:29 2002 UTC (21 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.46: +14 -10 lines
Diff to previous 1.46 (colored)

do not present scopeid on wire format, as it is local to node

Revision 1.46 / (download) - annotate - [select for diffs], Sat Jun 1 20:21:49 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

more snprintf

Revision 1.45 / (download) - annotate - [select for diffs], Thu May 30 06:51:46 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

-4 and -6 options; kanai@big.or.jp; itojun ok

Revision 1.43.2.1 / (download) - annotate - [select for diffs], Fri May 17 04:45:34 2002 UTC (22 years ago) by jason
Branch: OPENBSD_3_1
Changes since 1.43: +6 -5 lines
Diff to previous 1.43 (colored) next main 1.44 (colored)

Pull in patch from current:
Fix (itojun):
avoid buffer overrun on PASV from malicious server.
http://online.securityfocus.com/archive/1/269356/2002-04-22/2002-04-28/0

Revision 1.39.4.1 / (download) - annotate - [select for diffs], Thu May 16 21:45:31 2002 UTC (22 years ago) by miod
Branch: OPENBSD_2_9
Changes since 1.39: +6 -5 lines
Diff to previous 1.39 (colored) next main 1.40 (colored)

MFC, requested by millert, diff by itojun:
avoid buffer overrun on PASV from malicious server.
http://online.securityfocus.com/archive/1/269356/2002-04-22/2002-04-28/0

Revision 1.41.2.1 / (download) - annotate - [select for diffs], Thu May 16 21:44:27 2002 UTC (22 years ago) by miod
Branch: OPENBSD_3_0
Changes since 1.41: +6 -5 lines
Diff to previous 1.41 (colored) next main 1.42 (colored)

MFC, requested by millert, diff by itojun:
avoid buffer overrun on PASV from malicious server.
http://online.securityfocus.com/archive/1/269356/2002-04-22/2002-04-28/0

Revision 1.44 / (download) - annotate - [select for diffs], Thu Apr 25 10:58:05 2002 UTC (22 years ago) by itojun
Branch: MAIN
Changes since 1.43: +6 -5 lines
Diff to previous 1.43 (colored)

avoid buffer overrun on PASV from malicious server.
http://online.securityfocus.com/archive/1/269356/2002-04-22/2002-04-28/0

Revision 1.43 / (download) - annotate - [select for diffs], Tue Feb 19 19:39:38 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE
Branch point for: OPENBSD_3_1
Changes since 1.42: +2 -24 lines
Diff to previous 1.42 (colored)

We live in an ANSI C world.  Remove lots of gratuitous #ifdef __STDC__ cruft.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:46 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.41 / (download) - annotate - [select for diffs], Tue Jun 26 23:44:00 2001 UTC (22 years, 10 months ago) by lebel
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE
Branch point for: OPENBSD_3_0
Changes since 1.40: +10 -17 lines
Diff to previous 1.40 (colored)

use strlcpy vs strncpy+a[len-1]='\0'.  millert@ ok.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Jun 23 22:48:44 2001 UTC (22 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.39: +13 -37 lines
Diff to previous 1.39 (colored)

remove evil #ifdef __GNUC__ garbage to avoid longjmp clobbering and use volatile instead

Revision 1.39 / (download) - annotate - [select for diffs], Wed Oct 18 06:53:24 2000 UTC (23 years, 7 months ago) by itojun
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_8_BASE, OPENBSD_2_8
Branch point for: OPENBSD_2_9
Changes since 1.38: +6 -3 lines
Diff to previous 1.38 (colored)

emit more easier-to-understand error message on port name error.  from deraadt

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Fri Oct 6 21:16:13 2000 UTC (23 years, 7 months ago) by jason
Branch: OPENBSD_2_7
Changes since 1.35: +6 -4 lines
Diff to previous 1.35 (colored) next main 1.36 (colored)

Pull in patch from current (even more to come):
Fix (millert):
warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant).  These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 30 16:00:14 2000 UTC (23 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.37: +6 -4 lines
Diff to previous 1.37 (colored)

warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant).  These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jun 27 00:19:16 2000 UTC (23 years, 10 months ago) by fgsch
Branch: MAIN
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored)

initialize result. this fixes the recent problem that makes ftp coredump
if epsv4 is disabled. problem reported by price@netdoor.com on misc.

Revision 1.36 / (download) - annotate - [select for diffs], Wed Jun 21 19:22:54 2000 UTC (23 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.35: +32 -7 lines
Diff to previous 1.35 (colored)

add epsv4 command, which turns off epsv on ipv4 (off by dfeault)
automagicaslly disable epsv on ipv4, if epsv fails for single connection.
merge from netbsd-current.

req from fgs.

Revision 1.35 / (download) - annotate - [select for diffs], Wed May 3 19:50:41 2000 UTC (24 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE
Branch point for: OPENBSD_2_7
Changes since 1.34: +19 -2 lines
Diff to previous 1.34 (colored)

if no /etc/services file, use defaults. found by millert, fixed by itojun

Revision 1.34 / (download) - annotate - [select for diffs], Wed Dec 8 12:57:06 1999 UTC (24 years, 5 months ago) by itojun
Branch: MAIN
Changes since 1.33: +383 -116 lines
Diff to previous 1.33 (colored)

ftp(1) from KAME, should be good for testing.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Dec 13 21:01:29 1998 UTC (25 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.32: +9 -2 lines
Diff to previous 1.32 (colored)

Fall back from passive to active if connect() fails.  This can happen if the remote server has an ip filter in place (live cvs does).

Revision 1.32 / (download) - annotate - [select for diffs], Sat Sep 19 23:00:50 1998 UTC (25 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.31: +14 -3 lines
Diff to previous 1.31 (colored)

write() can do short-writes -- deal; based on rahnds@ code

Revision 1.31 / (download) - annotate - [select for diffs], Sat Sep 19 20:47:16 1998 UTC (25 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.30: +10 -6 lines
Diff to previous 1.30 (colored)

Make -m flag turn on progress meter in all situations

Revision 1.30 / (download) - annotate - [select for diffs], Sat Sep 19 20:02:23 1998 UTC (25 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.29: +2 -3 lines
Diff to previous 1.29 (colored)

Don't turn of progress meter when output file is stdout.  The meter will go to stderr in this case.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jul 7 17:26:41 1998 UTC (25 years, 10 months ago) by art
Branch: MAIN
Changes since 1.28: +7 -7 lines
Diff to previous 1.28 (colored)

fd_set is not a struct

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jun 8 16:55:57 1998 UTC (25 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

Fix some problems noted by lukem@netbsd.org
 o getopt string is wrong in main(); (missing : after P)
 o use of vprintf(...) instead of vfprintf(ttyout,...) in ftp.c::command()
 o missing \n in fputs in cmds.c::status()
 o should use strtol() instead of atol()
 o sometimes use 'NULL' instead of 'NUL' (in comments)

Revision 1.27 / (download) - annotate - [select for diffs], Wed May 13 10:42:35 1998 UTC (26 years ago) by deraadt
Branch: MAIN
Changes since 1.26: +9 -4 lines
Diff to previous 1.26 (colored)

handle EINTR

Revision 1.26 / (download) - annotate - [select for diffs], Wed May 13 08:59:07 1998 UTC (26 years ago) by deraadt
Branch: MAIN
Changes since 1.25: +4 -2 lines
Diff to previous 1.25 (colored)

make signal handlers save/restore errno

Revision 1.25 / (download) - annotate - [select for diffs], Tue Feb 10 02:13:10 1998 UTC (26 years, 3 months ago) by weingart
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.24: +3 -2 lines
Diff to previous 1.24 (colored)

Fix buffer overflows in quote1(), clear line buffer
before use.  Hopefully, this is the last of the
PR# 406 stuff that this will need.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Dec 17 16:03:03 1997 UTC (26 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.23: +10 -2 lines
Diff to previous 1.23 (colored)

By default, use passive mode and fall back to active as needed.
The user can specify active only with the -A flag, or use the
new FTPMODE envariable.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Sep 5 00:02:29 1997 UTC (26 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.22: +10 -10 lines
Diff to previous 1.22 (colored)

getc() -> fgetc() for easy socksification.  imp@openbsd.org

Revision 1.22 / (download) - annotate - [select for diffs], Thu Sep 4 04:37:16 1997 UTC (26 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.21: +17 -16 lines
Diff to previous 1.21 (colored)

Updtaes from NetBSD (lukem)
    bugs fixed:
      * don't interpret '-' or '|' when a local filename is determined from
        the remote name (i.e, in mget, and in get with only one argument).
        This is implemented using an extra argument to recvrequest().
        Fixes a major security hole.
      * clean up memory leak when using globulize()
      * clean up a couple of comments
      * fix wording in TNF copyright

    features added:
      * support for TIS fwtk gate-ftp servers:
        * read defaults from $FTPSERVER && $FTPSERVERPORT
        * start in gate-ftp mode if invoked as 'gate-ftp'
        * toggle or set with 'gate [host [port]]'

Other changes:
    * use symbolic flags in access(2)
    * Use USHRT_MAX, not 0xffff

Revision 1.21 / (download) - annotate - [select for diffs], Wed Aug 6 17:35:41 1997 UTC (26 years, 9 months ago) by mickey
Branch: MAIN
Changes since 1.20: +5 -4 lines
Diff to previous 1.20 (colored)

proper msgs display w/ -r

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jul 25 21:56:21 1997 UTC (26 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.19: +53 -17 lines
Diff to previous 1.19 (colored)

Updates from NetBSD (lukem) include -Wall cleanup.
More -W* cleanup and in_port_t usage by me.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jun 17 20:40:40 1997 UTC (26 years, 11 months ago) by kstailey
Branch: MAIN
Changes since 1.18: +6 -6 lines
Diff to previous 1.18 (colored)

(foo *)NULL -> NULL

Revision 1.18 / (download) - annotate - [select for diffs], Wed Apr 23 20:33:13 1997 UTC (27 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.17: +58 -57 lines
Diff to previous 1.17 (colored)

allow "ftp -aV ftp://host/foo.tar.gz | tar xvfpz -" to work

Revision 1.17 / (download) - annotate - [select for diffs], Wed Apr 16 05:02:54 1997 UTC (27 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.16: +3 -100 lines
Diff to previous 1.16 (colored)

Sync with NetBSD (lukem):
 * differentiate between being connected, and being logged in
 * cleanup some text messages
 * support username & password ftp URLs (ftp://user:pass@host/) in non-proxy
   situations; assume proxy supports it for proxy situations.
 * cd to / before performing any autofetch transfers

Revision 1.16 / (download) - annotate - [select for diffs], Fri Mar 21 20:59:29 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.15: +12 -3 lines
Diff to previous 1.15 (colored)

Add in recent NetBSD changes we didn't already have:
    Always compile complete.c but ifdef out the bits if -DSMALL (christos)
    reset interactive mode correctly in auto_fetch() mget mode (lukem)

Revision 1.15 / (download) - annotate - [select for diffs], Fri Mar 14 23:25:46 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.14: +3 -2 lines
Diff to previous 1.14 (colored)

Add missing line, doh!

Revision 1.14 / (download) - annotate - [select for diffs], Fri Mar 14 05:40:20 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

Correct usage of S_IFREG.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Mar 14 04:32:16 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.12: +75 -20 lines
Diff to previous 1.12 (colored)

Sync with NetBSD and fix "get foo.txt /dev/tty" wrt progress meter
and setting times.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Feb 5 04:55:18 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.11: +21 -17 lines
Diff to previous 1.11 (colored)

Include signal.h where reasonable and make signal handlers match
what signal(3)'s prototype says (and cast when not).
Also change MAXFOO+1 -> MAXFOO since MAXFOO includes the NULL.
Support $TMPDIR and use utime(3) not utimes(2) for portability's sake.
Don't spew "Passive mode enabled/disabled" unless verbose (this means
togglevar() needs to watch for a NULL 'message').

Revision 1.11 / (download) - annotate - [select for diffs], Mon Feb 3 01:05:40 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.10: +198 -200 lines
Diff to previous 1.10 (colored)

Add back ``-r'' option and fix strncpy() usage and other nits because
I'm anal.  Closer to KNF now.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Feb 3 01:02:39 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.9: +201 -119 lines
Diff to previous 1.9 (colored)

Sync with NetBSD

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jan 8 13:19:11 1997 UTC (27 years, 4 months ago) by niklas
Branch: MAIN
Changes since 1.8: +7 -6 lines
Diff to previous 1.8 (colored)

"Too much paranoia" + fake domain in anonftp password as some stupid sites
requires it to at least look sensible.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Dec 16 15:51:28 1996 UTC (27 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +5 -4 lines
Diff to previous 1.7 (colored)

strncat botch

Revision 1.7 / (download) - annotate - [select for diffs], Sat Nov 9 19:57:46 1996 UTC (27 years, 6 months ago) by kstailey
Branch: MAIN
Changes since 1.6: +10 -12 lines
Diff to previous 1.6 (colored)

optional size argument to hash command

Revision 1.6 / (download) - annotate - [select for diffs], Thu Oct 31 14:36:56 1996 UTC (27 years, 6 months ago) by mickey
Branch: MAIN
Changes since 1.5: +9 -7 lines
Diff to previous 1.5 (colored)

add -r<seconds> option to retry connection.
dunno how to do optional argument.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Aug 2 05:56:23 1996 UTC (27 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.4: +5 -8 lines
Diff to previous 1.4 (colored)

password user@, not user@hostname

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jun 26 05:33:36 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

rcsid

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jun 3 16:34:54 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

correct anonftp passwd

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jun 3 15:55:46 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +9 -0 lines
Diff to previous 1.1 (colored)

add support for automatic anonftp fetches of host:path
add support for -p portnum
might need todo: -N for silence, better exit status for failures

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:17 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:17 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.