Home | History | Annotate | only in /src/bin/rcp
History log of /src/bin/rcp
RevisionDateAuthorComments
 1.25 14-Feb-2009  lukem branches: 1.25.48;
Default to WARNS=4 (except for rcp & ksh)
 1.24 20-Mar-2006  christos branches: 1.24.28;
Goodbye KerberosIV
 1.23 05-Sep-2004  manu Kerberos support is broken in rcommands, thus making -K -k and -x options
unavailable. Remove theses options from the man pages (it won't be very
hard to bring them back if we fix kerberos one day)
 1.22 23-Jul-2003  itojun split MKKERBEROS4 from MKKERBEROS. based on work by lha at stacken.kth.se
(build confirmed with both MKKERBEROS4=yes and MKKERBEROS4=no)
 1.21 19-Aug-2002  lukem Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc).
 1.20 22-Mar-2002  thorpej Split the notion of building Hesiod, Kerberos, S/key, and YP
infrastructure and using that infrastructure in programs.

* MKHESIOD, MKKERBEROS, MKSKEY, and MKYP control building
of the infratsructure (libraries, support programs, etc.)

* USE_HESIOD, USE_KERBEROS, USE_SKEY, and USE_YP control
building of support for using the corresponding API
in various libraries/programs that can use it.

As discussed on tech-toolchain.
 1.19 12-Dec-2001  tv MKfoo=no -> NOfoo=
 1.18 23-Jun-2000  thorpej Add MK... variables to enable/disable various aspects of building
crypto support into the system. See share/mk/bsd.README for more
a full description.
 1.17 20-Jun-2000  thorpej branches: 1.17.2;
Merge a bunch of things from crypto-us and crypto-intl into basesrc,
adding support for Heimdal/KTH Kerberos where easy to do so. Eliminate
bsd.crypto.mk.

There is still a bunch more work to do, but crypto is now more-or-less
fully merged into the base NetBSD distribution.
 1.16 20-Jul-1999  mrg branches: 1.16.6;
optionally include CRYPTOPATH Makefile.frag files.
 1.15 12-Jul-1999  thorpej Use bsd.crypto.mk.
 1.14 18-Feb-1999  scottr Remove the crypto-related bits until such time as we have a fully-
integrated source tree. Export-controlled versions of these are now
built during the domestic build process.
 1.13 17-Feb-1999  scottr Check the rlogin source for headers ifdef KERBEROS
 1.12 10-Oct-1997  christos CFLAGS->CPPFLAGS
 1.11 20-Jul-1997  christos Remove WARNS=1 from all the subdirectory Makefiles, and add it to Makefile.inc
now that all /bin has been cleaned.
 1.10 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.9 27-May-1997  mrg remove the setuid bit.
 1.8 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.7 06-May-1997  gwr Use .PATH.c: ...
 1.6 23-Mar-1995  mycroft branches: 1.6.4;
Rearrange Kerberos stuff.
 1.5 21-Mar-1995  cgd actually do the import. rcp appears to have been previously imported
but not merged(?!?!?).
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.4 07-Sep-1995  jtc imported from 44lite2
 1.1.1.3 21-Mar-1995  cgd bin/rcp from Lite
 1.1.1.2 22-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.4.1 17-Feb-1997  mrg this program is not setuid in the new-rcmd-world-order
 1.16.6.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.17.2.2 24-Jun-2000  thorpej Update from trunk:
Add MK... variables to enable/disable various aspects of building
crypto support into the system. See share/mk/bsd.README for more
a full description.
 1.17.2.1 20-Jun-2000  thorpej file Makefile was added on branch netbsd-1-5 on 2000-06-24 06:59:32 +0000
 1.24.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.25.48.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.25.48.1 21-Apr-2020  martin Sync with HEAD
 1.6 11-Mar-2005  ginsbach branches: 1.6.92;
Add mechanism for escaping IPv6 address strings, since they already
contain colons. Idea from Solaris rcp(1).
 1.5 17-Feb-2005  xtraeme Kill __P(), use ANSI function declarations.
 1.4 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.3 28-May-1997  mrg oops, forgot to commit these: garbage collect setuid stuff.
 1.2 21-Mar-1995  cgd actually do the import. rcp appears to have been previously imported
but not merged(?!?!?).
 1.1 22-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 22-Sep-1994  mycroft Import original 4.4-Lite version.
 1.6.92.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.6.92.1 21-Apr-2020  martin Sync with HEAD
 1.7 19-Aug-2004  christos branches: 1.7.92;
Handle RESCUEDIR
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.5 21-Mar-1995  cgd actually do the import. rcp appears to have been previously imported
but not merged(?!?!?).
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 22-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.92.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.7.92.1 21-Apr-2020  martin Sync with HEAD
 1.22 22-Mar-2012  wiz branches: 1.22.34;
Fix whitespace nits. Suggested by Bug Hunting.
 1.21 11-Mar-2005  wiz branches: 1.21.48;
Use more macros (Sq/Dq).
 1.20 11-Mar-2005  ginsbach Add mechanism for escaping IPv6 address strings, since they already
contain colons. Idea from Solaris rcp(1).
 1.19 09-Mar-2005  ginsbach - Support -4 and -6. Approved by christos.
 1.18 05-Sep-2004  wiz Bump date for removal of Kerberos option descriptions.
Remove dots at end of SEE ALSO.
 1.17 05-Sep-2004  manu Kerberos support is broken in rcommands, thus making -K -k and -x options
unavailable. Remove theses options from the man pages (it won't be very
hard to bring them back if we fix kerberos one day)
 1.16 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.15 26-May-2003  lukem * Document $RCMD_CMD in environ(7).
* Cross-reference rcmd(1), rcmd(3), and environ(7) as appropriate.

Should fix [bin/21670] from Geoff Wing.
 1.14 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.13 25-Sep-2002  wiz New policy: New sentences start on a new line.
Patches by Robert Elz <kre at munnari oz au>, with minimal changes by me.
 1.12 20-Dec-2001  wiz Sort SEE ALSO.
 1.11 22-Mar-1999  garbled More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Many more to
come.
 1.10 26-Nov-1997  tv Add xrefs to new hosts.equiv(5)/rhosts(5) man page.
 1.9 11-Oct-1997  enami branches: 1.9.2;
- Use ``.Nm ""'' instead of ``.Nm rcp'' in SYNOPSIS.
- Use ``.Nm "" .'' instead of ``.Nm rcp .''.
 1.8 10-Oct-1997  lukem all but the first .Nm in SYNOPSIS need to be spelt out. [bin/4256]
 1.7 14-Sep-1997  lukem - cleanup use of .Nm in man page
- getopt returns -1 not EOF
 1.6 25-Jul-1995  jtc Use "utility" instead of "command". Modern definitions of these terms
are distinct (See POSIX.2 glossary).

A utility is a executable, script or shell builtin; while a command
can be any of those things plus lists, pipelines, compound commands
(if, for, while) and shell function definitions.
 1.5 21-Mar-1995  cgd actually do the import. rcp appears to have been previously imported
but not merged(?!?!?).
 1.4 01-Aug-1993  mycroft Add RCS indentifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 22-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.9.2.1 27-Nov-1997  mellon Pull rev 1.10 up from trunk (tv)
 1.21.48.1 17-Apr-2012  yamt sync with head
 1.22.34.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.22.34.1 21-Apr-2020  martin Sync with HEAD
 1.53 01-Aug-2023  mrg convert explicit length check before unchecked snprintf() with just a
overflow checked snprintf(). for res_debug.c and res_query.c, convert
from sprintf() to snprintf().

tested scp and rcp fail properly with too-long paths.
tested getaddrinfo fails as expected for too-long domains.
tested dig and ping for similar (res_debug.c/res_query.c).
created a temporary fs with quotas to test edquota with a long EDITOR.
did not test ypserv directly, but it's the same pattern.

avoids GCC 12 snprintf() warnings, and reduces total code size.
 1.52 18-Jul-2022  rin Fix bug revealed by SIGINFO support; Do not treat short read(2)/write(2)
as error (*). This occurs typically when signal is received.

(*) For older version, we already deal with short read(2) from remote
host in sink(). But for other cases, i.e., write(2) to local file in
sink(), read(2)/write(2) in source(), error was raised.

This version of rcp(1) can successfully send/receive files with older
version, even if short read(2)/write(2) occurs by SIGINFO.

Also, when real error occurs, give up immediately instead of continue to
send/receive wrong data.

Clean up the mess a little bit as well...
 1.51 26-Jun-2022  rin Add SIGINFO support. Mostly stolen from scan_ffs(8).
 1.50 06-May-2020  aymeric In sink(), upon error, avoid multiple replies to the source as this
would lead to a desynchronization of the protocol and further files or
directories to be ignored or corrupted.

Reported by Daniel Goujot, Georges-Axel Jaloyan, Ryan Lahfa, and David Naccache.
 1.49 07-May-2012  chs branches: 1.49.12; 1.49.14; 1.49.22; 1.49.26; 1.49.34; 1.49.36;
allocate a separate buffer in each call to sink().
reusing the buffer across recursive calls just doesn't work right.
 1.48 31-Aug-2009  dholland branches: 1.48.6; 1.48.8;
Fix up seriously borked mallocing of a static buffer, which seems to
have been this way since at least 4.4. This will still dump core if
malloc fails on the first trip through, instead of on any malloc
failure, but should otherwise behave much more reasonably.
 1.47 20-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
 1.46 26-May-2008  christos PR/38755: murray armfield: /bin posix programs missing setprogname and/or
setlocale
 1.45 24-Feb-2008  dholland branches: 1.45.2; 1.45.4;
Print time_t as long long, not long.
 1.44 15-Dec-2006  christos branches: 1.44.4; 1.44.8;
pass lint; from Anon Ymous
 1.43 15-Dec-2006  christos remove two (void)&foo; which are ot needed. From Anon Ymous
 1.42 20-Mar-2006  christos Goodbye KerberosIV
 1.41 18-Mar-2006  ginsbach Fix Coverity CID 1863, 1864; resource leak, bp not freed when !okname()
before function return and/or bp overwritten by malloc().
 1.40 26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.39 11-Mar-2005  ginsbach Add mechanism for escaping IPv6 address strings, since they already
contain colons. Idea from Solaris rcp(1).
 1.38 09-Mar-2005  wiz Add -4 and -6 to usage.
 1.37 09-Mar-2005  ginsbach - Support -4 and -6. Approved by christos.
 1.36 17-Feb-2005  xtraeme Kill __P(), use ANSI function declarations.
 1.35 02-Apr-2004  martin Remove duplicate include, fixes PR bin/25018 from Jeff Ito.
 1.34 28-Mar-2004  jdolecek IPv6 support, based on src/usr.bin/rsh/rsh.c rev. 1.13
fixes PR bin/24940 by Manuel Bouyer
 1.33 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.32 23-Jul-2003  itojun include des.h, not kerberosIV/des.h
 1.31 16-Apr-2003  itojun misuse of strncpy. PR 21201 from Christian Biere.
 1.30 22-Nov-2002  ragge It's a very bad habit to store file sizes in int's, so change it to off_t
instead. Obviously noone has tried to rcp files larger than 2GB.
 1.29 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.28 24-Sep-2001  wiz branches: 1.28.2;
va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
 1.27 04-Jan-2001  lukem use more standard %ll_ in favour of %q_
 1.26 09-Nov-1999  drochner Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
 1.25 17-Feb-1999  scottr branches: 1.25.6;
Make this compile ifdef KERBEROS.
 1.24 05-Nov-1998  christos s/MODEMASK/RCPMODEMASK/
From Darrin Jewell.
 1.23 04-Nov-1998  christos char -> unsigned char
work around missing futimes.
 1.22 28-Jul-1998  mycroft Be more retentive about use of NOTREACHED and noreturn.
 1.21 28-Jul-1998  mycroft Delint.
 1.20 03-Feb-1998  mycroft Deal with GCC warnings.
 1.19 21-Oct-1997  christos PR/4284: Tatoku Ogaito: rcmd(3) get be called with getpwent(3) results as
arguments, leading to memory corruption.
 1.18 19-Oct-1997  mycroft Use futimes(2).
Send microseconds over the wire, rather than just 0.
 1.17 14-Sep-1997  lukem - cleanup use of .Nm in man page
- getopt returns -1 not EOF
 1.16 30-Jul-1997  thorpej Cast some printf arguments to keep the compiler happy on the Alpha.
 1.15 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.14 07-Jun-1997  jeremy Fix incorrect use of name vs. pwd->pw_name and wrong logic in strdup() test.
[PR/3718]
 1.13 05-Jun-1997  mrg fix PR#3710, reported by Tatoku Ogaito <tacha@trap.fukui-med.ac.jp>.
- don't pass pw->pw_name into functions; make a copy.
 1.12 27-May-1997  mrg use rcmd(); garbage collect junk.
 1.11 26-May-1997  mrg use orcmd() for now.
 1.10 01-Feb-1996  jtc Rename struct timespec fields to conform to POSIX.1b
 1.9 21-Mar-1995  cgd actually do the import. rcp appears to have been previously imported
but not merged(?!?!?).
 1.8 30-Jan-1995  mycroft Use S_IS*().
 1.7 30-Jan-1995  mycroft Use S_IS*().
 1.6 04-Dec-1994  cgd from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.
 1.5 27-Mar-1994  cgd more off_t
 1.4 01-Aug-1993  mycroft Add RCS identifiers.
 1.3 23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2 22-Mar-1993  cgd added rcs ids to all files
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 22-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.25.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.28.2.1 22-Nov-2002  tron Pull up revision 1.30 (requested by ragge in ticket #1008):
It's a very bad habit to store file sizes in int's, so change it to off_t
instead. Obviously noone has tried to rcp files larger than 2GB.
 1.44.8.1 24-Mar-2008  keiichi sync with head.
 1.44.4.1 23-Mar-2008  matt sync with HEAD
 1.45.4.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.45.4.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.45.2.1 04-Jun-2008  yamt sync with head
 1.48.8.1 09-May-2012  riz Pull up following revision(s) (requested by chs in ticket #230):
bin/rcp/rcp.c: revision 1.49
allocate a separate buffer in each call to sink().
reusing the buffer across recursive calls just doesn't work right.
 1.48.6.1 23-May-2012  yamt sync with head.
 1.49.36.1 07-May-2020  martin Pull up following revision(s) (requested by aymeric in ticket #890):

bin/rcp/rcp.c: revision 1.50

In sink(), upon error, avoid multiple replies to the source as this
would lead to a desynchronization of the protocol and further files or
directories to be ignored or corrupted.

Reported by Daniel Goujot, Georges-Axel Jaloyan, Ryan Lahfa, and David Naccache.
 1.49.34.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.49.34.1 21-Apr-2020  martin Sync with HEAD
 1.49.26.1 07-May-2020  martin Pull up following revision(s) (requested by aymeric in ticket #1546):

bin/rcp/rcp.c: revision 1.50

In sink(), upon error, avoid multiple replies to the source as this
would lead to a desynchronization of the protocol and further files or
directories to be ignored or corrupted.

Reported by Daniel Goujot, Georges-Axel Jaloyan, Ryan Lahfa, and David Naccache.
 1.49.22.1 07-May-2020  sborrill Pull up the following revisions(s) (requested by aymeric in ticket #1731):
bin/rcp/rcp.c: revision 1.50

In sink(), upon error, avoid multiple replies to the source as this
would lead to a desynchronization of the protocol and further files or
directories to be ignored or corrupted.
 1.49.14.1 07-May-2020  sborrill Pull up the following revisions(s) (requested by aymeric in ticket #1731):
bin/rcp/rcp.c: revision 1.50

In sink(), upon error, avoid multiple replies to the source as this
would lead to a desynchronization of the protocol and further files or
directories to be ignored or corrupted.
 1.49.12.1 07-May-2020  sborrill Pull up the following revisions(s) (requested by aymeric in ticket #1731):
bin/rcp/rcp.c: revision 1.50

In sink(), upon error, avoid multiple replies to the source as this
would lead to a desynchronization of the protocol and further files or
directories to be ignored or corrupted.
 1.11 15-Dec-2006  christos branches: 1.11.78;
pass lint; from Anon Ymous
 1.10 15-Dec-2006  christos fix an unused variable warning. From Anon Ymous
 1.9 11-Mar-2005  ginsbach Add mechanism for escaping IPv6 address strings, since they already
contain colons. Idea from Solaris rcp(1).
 1.8 17-Feb-2005  xtraeme Kill __P(), use ANSI function declarations.
 1.7 19-Sep-2003  itojun realloc pedant
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.5 28-Jul-1998  mycroft Delint.
 1.4 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.3 28-May-1997  mrg oops, forgot to commit these: garbage collect setuid stuff.
 1.2 21-Mar-1995  cgd actually do the import. rcp appears to have been previously imported
but not merged(?!?!?).
 1.1 22-Sep-1994  mycroft branches: 1.1.1;
Initial revision
 1.1.1.1 22-Sep-1994  mycroft Import original 4.4-Lite version.
 1.11.78.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.11.78.1 21-Apr-2020  martin Sync with HEAD

RSS XML Feed