OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.98 / (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.97: +1 -3 lines
Diff to previous 1.97 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.97 / (download) - annotate - [select for diffs], Mon Sep 19 21:14:38 2022 UTC (19 months, 4 weeks ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.96: +1 -25 lines
Diff to previous 1.96 (colored)

Remove now-unused connect_wait() function.

Revision 1.96 / (download) - annotate - [select for diffs], Thu Sep 15 12:47:10 2022 UTC (20 months ago) by millert
Branch: MAIN
Changes since 1.95: +79 -1 lines
Diff to previous 1.95 (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.95 / (download) - annotate - [select for diffs], Tue Feb 2 12:58:42 2021 UTC (3 years, 3 months ago) by robert
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
Changes since 1.94: +15 -1 lines
Diff to previous 1.94 (colored)

introduce support for sending the If-Modified-Since header while
fetching over http(s) and use the timestamps from the remote server's
Last-Modified header if available when saving local files
this makes it possible to mirror files better with ftp(1)

the new timestamp behaviour can be disabled with the new '-u' flag

ok sthen@, input from sthen@ and gnezdo@

Revision 1.94 / (download) - annotate - [select for diffs], Sun Oct 18 20:35:18 2020 UTC (3 years, 7 months ago) by naddy
Branch: MAIN
Changes since 1.93: +5 -4 lines
Diff to previous 1.93 (colored)

Accommodate POSIX basename(3) that takes a non-const parameter and
may modify the string buffer.

improved and ok jca@

Revision 1.93 / (download) - annotate - [select for diffs], Mon Jul 6 17:11:29 2020 UTC (3 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.92: +8 -6 lines
Diff to previous 1.92 (colored)

in 2014 I added this annotation: /* XXX floating point printf in signal handler */
our snprintf is reentrant safe except for floating point.
Break the double apart into integer.integer notation, to avoid that.
ok kettenis millert

Revision 1.92 / (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_6_7_BASE, OPENBSD_6_7
Changes since 1.91: +2 -3 lines
Diff to previous 1.91 (colored)

various knf and whitespace; ok jca

Revision 1.91 / (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.90: +2 -2 lines
Diff to previous 1.90 (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.90 / (download) - annotate - [select for diffs], Fri Jun 28 05:35:34 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.89: +2 -2 lines
Diff to previous 1.89 (colored)

mkstemp() returns -1 on failure

Revision 1.89 / (download) - annotate - [select for diffs], Thu May 16 12:44:18 2019 UTC (5 years ago) by florian
Branch: MAIN
Changes since 1.88: +1015 -145 lines
Diff to previous 1.88 (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.88 / (download) - annotate - [select for diffs], Sun May 12 20:58:19 2019 UTC (5 years ago) by jasper
Branch: MAIN
Changes since 1.87: +2 -0 lines
Diff to previous 1.87 (colored)

add rcs ids

Revision 1.87 / (download) - annotate - [select for diffs], Sun May 12 20:44:39 2019 UTC (5 years ago) by kmos
Branch: MAIN
Changes since 1.86: +145 -1017 lines
Diff to previous 1.86 (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.86 / (download) - annotate - [select for diffs], Sat Dec 23 20:04:23 2017 UTC (6 years, 4 months ago) by cheloha
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
Changes since 1.85: +14 -14 lines
Diff to previous 1.85 (colored)

Use the monotonic clock for logging progress in cdio(1) and ftp(1).

Keeps the progress log from blipping or stalling if, e.g., the
system time is changed in the midst of a rip or a transfer.

ok tb@ jca@

Revision 1.85 / (download) - annotate - [select for diffs], Tue Sep 5 05:37:35 2017 UTC (6 years, 8 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.84: +4 -2 lines
Diff to previous 1.84 (colored)

Avoid a possible leak in progressmeter

From Scott Cheloha, ok bluhm@

Revision 1.84 / (download) - annotate - [select for diffs], Sat Jan 21 08:33:07 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.83: +11 -11 lines
Diff to previous 1.83 (colored)

Nuke whitespace foolish enough to expose itself during the great
"warning:" rectification.

Revision 1.83 / (download) - annotate - [select for diffs], Fri Jan 20 01:19:18 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.82: +3 -1 lines
Diff to previous 1.82 (colored)

#ifndef SMALL around a couple of non-SMALL labels.

ok deraadt@

Revision 1.82 / (download) - annotate - [select for diffs], Wed Jan 11 13:40:24 2017 UTC (7 years, 4 months ago) by zhuk
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)

Don't attempt to read .netrc when we already force anonymous FTP (-a).

Patch from Anton Lindqvist via tech@, thanks!

okay deraadt@

Revision 1.81 / (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.80: +13 -22 lines
Diff to previous 1.80 (colored)

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

Revision 1.80 / (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.79: +35 -1 lines
Diff to previous 1.79 (colored)

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

Revision 1.79 / (download) - annotate - [select for diffs], Sun Aug 14 18:34:48 2016 UTC (7 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

Convert remaining calls to strtoq/strtouq in base with strtoll/strtoull.
Fix a type mismatch in ftp's "page" command and could make transfers restart
at the wrong position.

ok and a ull->ll tweak from natano@, ok tedu@

Revision 1.78 / (download) - annotate - [select for diffs], Thu Jul 28 21:37:45 2016 UTC (7 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.77: +2 -3 lines
Diff to previous 1.77 (colored)

these programs probably do not need to use TMPDIR. ok florian

Revision 1.77 / (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.76: +4 -4 lines
Diff to previous 1.76 (colored)

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

Feedback millert@ kettenis@

Revision 1.76 / (download) - annotate - [select for diffs], Wed Dec 9 17:55:42 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.75: +3 -5 lines
Diff to previous 1.75 (colored)

Remove NULL-checks before free(). ok tb@

Revision 1.75 / (download) - annotate - [select for diffs], Sun Oct 18 03:41:14 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.74: +2 -1 lines
Diff to previous 1.74 (colored)

unrelated commit; not ready yet

Revision 1.74 / (download) - annotate - [select for diffs], Sun Oct 18 03:39:37 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.73: +2 -3 lines
Diff to previous 1.73 (colored)

First casualty of making pledge "dns" mandatory for dns users.
"dns" was missing, and this was relying on "inet" support..

Revision 1.73 / (download) - annotate - [select for diffs], Sun Oct 18 03:04:11 2015 UTC (8 years, 7 months ago) by mmcc
Branch: MAIN
Changes since 1.72: +5 -5 lines
Diff to previous 1.72 (colored)

A whole buncha unsigned char casts for ctype function arguments.

ok guenther@

Revision 1.72 / (download) - annotate - [select for diffs], Tue Mar 17 19:31:30 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Eliminate use of TM_YEAR_BASE.  OK guenther@ deraadt@ miod@

Revision 1.71 / (download) - annotate - [select for diffs], Sun Mar 15 00:41:28 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.70: +1 -2 lines
Diff to previous 1.70 (colored)

tzfile.h is an internal header that should never have been installed.
What's worse, the tzfile.h that gets installed is over 20 years old
and doesn't match the real tzfile.h in libc/time.  This makes the
tree safe for /usr/include/tzfile.h removal.  The TM_YEAR_BASE
define has been moved to time.h temporarily until its usage is
replaced by 1900 in the tree.  Actual removal of tzfile.h is pending
a ports build.  Based on a diff from deraadt@

Revision 1.70 / (download) - annotate - [select for diffs], Mon Feb 9 04:10:50 2015 UTC (9 years, 3 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.69: +1 -8 lines
Diff to previous 1.69 (colored)

remove the safeguard against porting to machines without 8 bit bytes.
allows removing sys/param.h include as well.

Revision 1.69 / (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.68: +1 -6 lines
Diff to previous 1.68 (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.68 / (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.67: +13 -10 lines
Diff to previous 1.67 (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.67 / (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.66: +11 -5 lines
Diff to previous 1.66 (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.66 / (download) - annotate - [select for diffs], Wed Jan 29 16:58:21 2014 UTC (10 years, 3 months ago) by dcoppa
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.65: +2 -2 lines
Diff to previous 1.65 (colored)

Unbreak ftp progress meter after the introduction of the '-D' flag

ok tedu@

Revision 1.65 / (download) - annotate - [select for diffs], Thu Jan 23 00:39:15 2014 UTC (10 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.64: +24 -2 lines
Diff to previous 1.64 (colored)

Add -D shorttitle support, so that the progress meter can show some sort
of reason why it is processing a certain file.  This will be used by the
installer for that purpose.
ok krw rpe

Revision 1.64 / (download) - annotate - [select for diffs], Wed Nov 11 17:10:25 2009 UTC (14 years, 6 months ago) by deraadt
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, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

do not walk off the prefix array, off by one; found by parfait
ok jsg millert

Revision 1.63 / (download) - annotate - [select for diffs], Sun May 10 16:31:17 2009 UTC (15 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

show which username login failed for; ok martynas

Revision 1.62 / (download) - annotate - [select for diffs], Tue May 5 19:35:30 2009 UTC (15 years ago) by martynas
Branch: MAIN
Changes since 1.61: +10 -1 lines
Diff to previous 1.61 (colored)

make it clean removing the ifdef SMALL maze.  separate cmds and
small stuff.  make it a fetcher.  shrinks quite a bit
agreed by millert@, krw@
ok theo, sthen@

Revision 1.61 / (download) - annotate - [select for diffs], Mon Apr 27 22:51:51 2009 UTC (15 years ago) by martynas
Branch: MAIN
Changes since 1.60: +3 -1 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Mon Apr 27 21:37:13 2009 UTC (15 years ago) by deraadt
Branch: MAIN
Changes since 1.59: +1 -5 lines
Diff to previous 1.59 (colored)

toast the rcsid strings which just get in the way

Revision 1.59 / (download) - annotate - [select for diffs], Sun Apr 26 21:26:03 2009 UTC (15 years ago) by martynas
Branch: MAIN
Changes since 1.58: +16 -8 lines
Diff to previous 1.58 (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.58 / (download) - annotate - [select for diffs], Sun Apr 26 10:30:07 2009 UTC (15 years ago) by sthen
Branch: MAIN
Changes since 1.57: +3 -3 lines
Diff to previous 1.57 (colored)

make two similar text strings identical; improves consistency and shrinks
the text segment slightly (though due to padding it does not change the size
of the binary).  ok martynas@

Revision 1.57 / (download) - annotate - [select for diffs], Mon Apr 13 01:47:04 2009 UTC (15 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.56: +22 -5 lines
Diff to previous 1.56 (colored)

add a "-T title" option to ftp; this is is used in progress bar mode to
show which filename is being used. ok krw, mdoc repair from jmc

Revision 1.56 / (download) - annotate - [select for diffs], Tue Jan 27 22:04:36 2009 UTC (15 years, 3 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.55: +6 -3 lines
Diff to previous 1.55 (colored)

on some servers LIST defaults to LIST -a.  ignore pseudo-directories
so that recursive transfers don't cause a loop.  problem reported
and tested by Jesus Sanchez.  string compare inlining and looks
good to millert@

Revision 1.55 / (download) - annotate - [select for diffs], Fri Aug 22 08:52:35 2008 UTC (15 years, 9 months ago) by sobrado
Branch: MAIN
Changes since 1.54: +3 -3 lines
Diff to previous 1.54 (colored)

default file transfer type is binary, not ascii;
commands which toggle settings can take an explicit on or off argument
to force the setting appropiately, show these arguments in usage;
synchronize synopsis and usage of commands; spacing; KNF;
other minor documentation tweaks.

written with help by jmc@

ok jmc@ (documentation), martynas@ (type usage and default file transfer type)

Revision 1.54 / (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_4_BASE, OPENBSD_4_4
Changes since 1.53: +70 -25 lines
Diff to previous 1.53 (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.53 / (download) - annotate - [select for diffs], Thu Jun 26 05:42:20 2008 UTC (15 years, 10 months ago) by ray
Branch: MAIN
Changes since 1.52: +2 -9 lines
Diff to previous 1.52 (colored)

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@

Revision 1.52 / (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.51: +3 -3 lines
Diff to previous 1.51 (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.51 / (download) - annotate - [select for diffs], Mon Jun 16 19:56:04 2008 UTC (15 years, 11 months ago) by martynas
Branch: MAIN
Changes since 1.50: +26 -21 lines
Diff to previous 1.50 (colored)

- add 'q', which does the same as eof
- add '?', which will help
- make use of mflag, instead of special-case interactive
- change mflag++ to mflag = 1, because theoretically it can go out
of range
"i like it" millert@.  man page help and ok jmc@

Revision 1.50 / (download) - annotate - [select for diffs], Mon Jun 16 12:03:51 2008 UTC (15 years, 11 months ago) by martynas
Branch: MAIN
Changes since 1.49: +11 -6 lines
Diff to previous 1.49 (colored)

fix transfer interrupting when confirmrest mode is used.  change
confirm() to have a 'force' argument, so that ointer/oconf dance
is not needed, and to prevent further bugs like this;  ok millert@

Revision 1.49 / (download) - annotate - [select for diffs], Sun Jun 15 03:09:13 2008 UTC (15 years, 11 months ago) by martynas
Branch: MAIN
Changes since 1.48: +14 -4 lines
Diff to previous 1.48 (colored)

make further prompts work after eof, don't spam with prompts in
m*() cases;  ok millert@

Revision 1.48 / (download) - annotate - [select for diffs], Tue May 13 02:09:38 2008 UTC (16 years ago) by ray
Branch: MAIN
Changes since 1.47: +2 -20 lines
Diff to previous 1.47 (colored)

Remove #if 0 code that has been unused for nearly a decade (and
probably doesn't compile, since the types for some variables have
changed from long to char *).

OK millert@

Revision 1.47 / (download) - annotate - [select for diffs], Tue Sep 11 15:47:17 2007 UTC (16 years, 8 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.46: +6 -8 lines
Diff to previous 1.46 (colored)

use strcspn to properly overwrite '\n' in fgets returned buffer

ok pyr@, ray@, millert@, moritz@, chl@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jun 6 19:15:33 2007 UTC (16 years, 11 months ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.45: +4 -2 lines
Diff to previous 1.45 (colored)

Remove the .netrc parser when compiling a SMALL binary.
there is no .netrc file on the install media and keeping the parser
shaves a good deal of bytes in the binary.
ok millert@, "go on" deraadt@, "makes sense" steven@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Nov 2 01:51:33 2006 UTC (17 years, 6 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

Pass full buffer size to fgets.

OK moritz@ and jaredy@.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Nov 2 01:43:01 2006 UTC (17 years, 6 months ago) by ray
Branch: MAIN
Changes since 1.43: +11 -9 lines
Diff to previous 1.43 (colored)

Add checks for fgets and properly overwrite newline.

Initial patch from Charles Longeau <chl at tuxfamily dot org>.

OK moritz@ and jaredy@.

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

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

Found by lint.

OK beck@, deraadt@

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

two strtol calls that were begging to be converted to strtonum

Revision 1.41 / (download) - annotate - [select for diffs], Wed Oct 12 06:50:42 2005 UTC (18 years, 7 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.40: +36 -2 lines
Diff to previous 1.40 (colored)

Fix mget directory traversal vulnerability. From NetBSD. CAN-2002-1345.
ok millert@ deraadt@, prodding by david@

Revision 1.40 / (download) - annotate - [select for diffs], Mon Apr 11 15:16:50 2005 UTC (19 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.39: +52 -58 lines
Diff to previous 1.39 (colored)

knf; cloder ok

Revision 1.39 / (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_7_BASE, OPENBSD_3_7
Changes since 1.38: +8 -6 lines
Diff to previous 1.38 (colored)

type corrections and other delinting

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

ansi; khalek@linuxgamers.net

Revision 1.37 / (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.36: +4 -4 lines
Diff to previous 1.36 (colored)

for -DSMALL, do not include rcsid[]s

Revision 1.36 / (download) - annotate - [select for diffs], Fri Oct 31 08:47:31 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.35: +6 -4 lines
Diff to previous 1.35 (colored)

New libedit api changes.

Tested by djm@, mouring@, jmc@.

ok deraadt@

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

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

Revision 1.34 / (download) - annotate - [select for diffs], Mon Apr 7 22:15:57 2003 UTC (21 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.33: +42 -2 lines
Diff to previous 1.33 (colored)

Some NetBSD changes were committed to this file w/o updating the
copyright.  I have gone through the cvs logs and added the appropriate
NetBSD Foundation copyright corresponding to those changes.

Revision 1.33 / (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.32: +15 -10 lines
Diff to previous 1.32 (colored)

string fixes; ok miod henning

Revision 1.32 / (download) - annotate - [select for diffs], Mon Mar 31 23:04:07 2003 UTC (21 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

Treat empty environment variables the same as NULL.  henning@ OK

Revision 1.31 / (download) - annotate - [select for diffs], Fri Nov 8 03:30:17 2002 UTC (21 years, 6 months ago) by fgsch
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

http redirect support; adapted from NetBSD.

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jul 12 00:25:30 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.29: +4 -2 lines
Diff to previous 1.29 (colored)

malloc/strdup failure not handled; cloder@acm.org

Revision 1.29 / (download) - annotate - [select for diffs], Sat Mar 30 17:45:44 2002 UTC (22 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.28: +10 -5 lines
Diff to previous 1.28 (colored)

stretch banners

Revision 1.28 / (download) - annotate - [select for diffs], Tue Feb 19 18:38:01 2002 UTC (22 years, 3 months ago) by mpech
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

Fix gethostname() usage.

deraadt@ ok

Revision 1.27 / (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.26: +3 -3 lines
Diff to previous 1.26 (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.26 / (download) - annotate - [select for diffs], Thu Jul 12 05:17:08 2001 UTC (22 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored)

first pass at a -Wall cleanup

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jun 18 21:20:17 2001 UTC (22 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.24: +11 -12 lines
Diff to previous 1.24 (colored)

Change default transfer type from ascii to binary; closes PR 1626
Similar to patch from mpech@prosoft.org.lv

Revision 1.24 / (download) - annotate - [select for diffs], Mon May 15 18:27:27 2000 UTC (24 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.23: +19 -5 lines
Diff to previous 1.23 (colored)

0-size files still deserve a progress meter; also, after file is finished
transfer, display a non-ETA line with an elapsed time.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Feb 1 20:53:06 2000 UTC (24 years, 3 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.22: +22 -2 lines
Diff to previous 1.22 (colored)

Work-around for lame servers that return `19100' for a date.

Based on NetBSD patch, slightly trimmed since we don't use the fractional
part yet...

Revision 1.22 / (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.21: +8 -3 lines
Diff to previous 1.21 (colored)

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

Revision 1.21 / (download) - annotate - [select for diffs], Tue Sep 22 04:42:49 1998 UTC (25 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

if winsize.ws_col is 0, assume 80

Revision 1.20 / (download) - annotate - [select for diffs], Sat Sep 19 22:38:56 1998 UTC (25 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.19: +7 -6 lines
Diff to previous 1.19 (colored)

make the progress meter run correctly in all cases if in -m mode

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

make signal handlers save/restore errno

Revision 1.18 / (download) - annotate - [select for diffs], Sun Apr 26 17:52:15 1998 UTC (26 years ago) by deraadt
Branch: MAIN
Changes since 1.17: +3 -2 lines
Diff to previous 1.17 (colored)

recommended fix from tri@iki.fi...

Revision 1.17 / (download) - annotate - [select for diffs], Mon Mar 30 06:59:36 1998 UTC (26 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.16: +4 -3 lines
Diff to previous 1.16 (colored)

Y2K fixes from Andreas.Gunnarsson@emw.ericsson.se; culled from various places

Revision 1.16 / (download) - annotate - [select for diffs], Tue Nov 25 08:10:34 1997 UTC (26 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.15: +4 -5 lines
Diff to previous 1.15 (colored)

prompting error; pr#352, blair@nac.net

Revision 1.15 / (download) - annotate - [select for diffs], Mon Sep 15 04:57:54 1997 UTC (26 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.14: +6 -2 lines
Diff to previous 1.14 (colored)

Don't error out if the remote server doesn't support the "MDTM"
command.  Based on a patch from Martin Fredriksson <martin@netman.se>.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Sep 11 01:55:16 1997 UTC (26 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.13: +11 -9 lines
Diff to previous 1.13 (colored)

- Move `parsed_url' label such that the next statement after the label is
  not an "else" (which some strict compilers reject).

- If getlogin() fails fall back on getpwuid(getuid()).

Revision 1.13 / (download) - annotate - [select for diffs], Thu Sep 4 04:37:17 1997 UTC (26 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.12: +30 -8 lines
Diff to previous 1.12 (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.12 / (download) - annotate - [select for diffs], Mon Aug 25 21:41:55 1997 UTC (26 years, 8 months ago) by jkatz
Branch: MAIN
Changes since 1.11: +11 -2 lines
Diff to previous 1.11 (colored)

dumb fix for dumb users-- ftp's mget now idiot-proofs input!

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

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

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jun 10 19:39:54 1997 UTC (26 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.9: +20 -3 lines
Diff to previous 1.9 (colored)

Disable progress meter if started as a bg process.  Also don't
print the progress meter if the ftp process is put in the bg
(but do print it when/if the process is foregrounded).
From Enami Tsugutomo <enami@ba2.so-net.or.jp> with tweaks by me.

Revision 1.9 / (download) - annotate - [select for diffs], Sun May 11 17:12:57 1997 UTC (27 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.8: +6 -9 lines
Diff to previous 1.8 (colored)

Only retry login as "anonymous" if we are doing anonftp.
Found by grr@openbsd.org.

Revision 1.8 / (download) - annotate - [select for diffs], Mon May 5 20:49:51 1997 UTC (27 years ago) by jkatz
Branch: MAIN
Changes since 1.7: +16 -4 lines
Diff to previous 1.7 (colored)

This fixes FTP so that it first tries with the username FTP, and then with
the username ANONYMOUS. It works, too :-)

Revision 1.7 / (download) - annotate - [select for diffs], Wed Apr 23 20:33:24 1997 UTC (27 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.6: +41 -35 lines
Diff to previous 1.6 (colored)

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

Revision 1.6 / (download) - annotate - [select for diffs], Wed Apr 16 05:02:59 1997 UTC (27 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.5: +108 -4 lines
Diff to previous 1.5 (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.5 / (download) - annotate - [select for diffs], Thu Apr 10 00:17:11 1997 UTC (27 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.4: +40 -4 lines
Diff to previous 1.4 (colored)

Sync with NetBSD (lukem)
    * support $ftp_proxy for ftp:// transfers [bin/3245]
    * add "more" & "less" as synonyms for "page"
    * move editline setup code into controlediting(), and call appropriately.
      only setup setup terminal if going into interactive mode.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Mar 14 04:32:18 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.3: +42 -28 lines
Diff to previous 1.3 (colored)

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

Revision 1.3 / (download) - annotate - [select for diffs], Wed Feb 5 04:55:21 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.2: +20 -5 lines
Diff to previous 1.2 (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.2 / (download) - annotate - [select for diffs], Mon Feb 3 01:05:46 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.1: +39 -33 lines
Diff to previous 1.1 (colored)

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

Revision 1.1 / (download) - annotate - [select for diffs], Mon Feb 3 01:02:43 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN

Sync with NetBSD

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.