Commit Graph

105 Commits

Author SHA1 Message Date
jhb
12d32f9576 Add an '-a' option which is identical to specifying '-RpP' for
compatibility with other implementations.

MFC after:	1 month
2008-03-10 19:58:41 +00:00
edwin
fff68913a6 As suggested, replace earlier changed warnx() / exit() with an errx()
Submitted by:	Peter Jeremy <peterjeremy@optushome.com.au>
2007-12-26 08:32:20 +00:00
edwin
75cfd08629 When copying multiple files to a directory, make sure that a proper
warning is given when the directory doesn't exist.

PR:		bin/50656
Submitted by:	Edwin Groothuis <edwin@mavetju.org>
Approved by:	grog@
Not reviewed by: grog@
2007-12-25 00:40:32 +00:00
ceri
e83c4c55c0 Fix typo. 2006-11-02 19:10:05 +00:00
trhodes
3e2d73c3e9 Wording nits. 2006-10-27 08:26:24 +00:00
trhodes
e0efadd7e5 Flesh out the compatibility section a little bit. Bump doc date. 2006-10-24 18:42:42 +00:00
trhodes
ca75959a96 Fix style(9) bugs in previous commit.
Lesson from:	bde
2006-10-11 10:26:34 +00:00
trhodes
06666564b4 Make -r a synonym for -R, similar to behavior on Linux while being backwards
compatible with old -r behavior with regards to -L.  You can now copy fifos
and other special files with -r.

Reviewed by:	-standards (long ago), das, bde
Approved by:	bde (recently)
2006-10-07 22:14:43 +00:00
maxim
1f6d578128 o Style(9).
Submitted by:	bde
2006-10-07 12:14:50 +00:00
maxim
a9cb1cf4c1 o Avoid division by zero.
o Place error checking code near to the syscall.

Submitted by:	bde
2006-10-07 12:11:21 +00:00
maxim
157dbabffd o Hold copied bytes counter in off_t. This prevents statistics
displayed by SIGINFO handler from overflow.

PR:		bin/104039
Submitted by:	Geoffrey Giesemann
MFC after:	2 weeks
2006-10-06 08:30:33 +00:00
ru
92c5371767 Move the -l option processing to where it belongs.
Overall still not kosher but better matches style(9).
2006-09-29 06:06:39 +00:00
ru
a48b0e1228 - Fix options order.
- Touch manpage's document date.
2006-08-25 09:58:13 +00:00
ru
1f50dbf4f2 Remove a stray -a option that probably sneaked in from julian's
attempt to enter append mode twice in vi(1).  :-)
2006-08-25 09:42:16 +00:00
julian
b0fd0e6925 Add an option to allow copying of a hierarchy while linking he regular files.
Bikeshedded to death on: hackers
Submitted by:andersonatcenttech.com
MFC in: 1 month
2006-08-24 20:45:38 +00:00
maxim
9926c77bc7 o Call fts_close() before exit.
Obtained from:	NetBSD, Coverity ID 1754
2006-07-04 20:52:36 +00:00
csjp
549c6812a9 Attempt to complete the userspace integration of POSIX.1e extended ACLs.
This includes adding support for ACLs into cp(1) and mv(1) userspace
utilities.

For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination
operands, the destination file's ACLs shall reflect the source.

For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination
operands, and -p has been specified, the ACLs from the source shall be
preserved on the destination.

MFC after:	1 month
2005-09-05 04:36:08 +00:00
trhodes
98afb7c0a2 Fix a few markup nits in previous commit.
Noticed by:	ru, who else? :)
2005-02-25 00:40:46 +00:00
trhodes
f1a5d5f825 Note how cp(1) handles directories ending in "/."
PR:		75774
Submitted by:	Mike Meyer <mwm@mired.org> (original version)
2005-02-24 00:06:22 +00:00
ru
978b8f7f1d Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
ru
ffd9fd4c0e Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
imp
a76898b849 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
ru
d40c857e0d Mechanically kill hard sentence breaks. 2004-07-02 21:04:19 +00:00
tjr
6dc95a9614 Plug file descriptor leak in implementation of -n option. 2004-06-05 02:32:21 +00:00
markm
4383f14801 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
alc
5bdb94b838 Don't mmap(2) and munmap(2) zero-length files.
Submitted by:	Wiktor Niesiobedzki <bsd@w.evip.pl>
2003-11-13 05:26:55 +00:00
jmg
cfd592ad57 pass -1 to setfile in cp.c
Submitted by:	Jun Kuriyama
2003-06-30 06:16:06 +00:00
jmg
89d97224ad support saving both user/group and permissions on symlinks (from PR)
also fix a slight bogon that assumed an fd of 0 was not valid.  Changed
it to be -1.

PR:		bin/25017
Submitted by:	Martin Kammerhofer
2003-06-22 07:02:17 +00:00
ru
db49af5126 Clarify what -p option does.
Prodded by:	marcel

While here, spell the "set-{user,group}-ID bit" correctly.
2003-06-07 06:35:36 +00:00
obrien
eaf3fff90a Quiet warnings about copyright[]. 2003-05-01 16:58:57 +00:00
bde
0f2f76bb73 Include <signal.h> instead of depending on namespace pollution in
<sys/param.h>.  Include <sys/types.h> instead of of <sys/param.h>
so that further such dependencies don't develop.
2003-04-13 08:47:30 +00:00
bde
93c5f89d55 Fixed some style bugs in rev.1.44. 2003-04-13 08:27:35 +00:00
mdodd
86b0c078f7 Use the correct data type and qualifier for signal flag. 2003-04-07 12:09:17 +00:00
mdodd
7e2b8444e0 Add a SIGINFO handler. 2003-04-07 11:00:56 +00:00
markm
bde9100ebe Constify and staticify for lint. 2002-10-18 14:45:00 +00:00
mckay
918629fa38 cp -p could report success even if a file copy failed. This was due to
the cumulative exit status being overwritten when directory permissions
were being set.  This was particularly bad when called from mv(1) to
perform a cross-device move as the original files were deleted even if
the copy failed.

Reported by:    Slaven Rezic <slaven.rezic@berlin.de>
Patch by:       bde
PR:             42789
2002-09-22 11:15:56 +00:00
wollman
aa09d8b564 Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI.  FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about.  As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use.  All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch
2002-09-21 01:28:41 +00:00
johan
831411db5b Bump document date for the -n option.
Approved by: sheldonh (mentor)
2002-08-16 03:13:59 +00:00
ru
704e2cf623 mdoc(7) police: grammar. 2002-08-09 10:38:34 +00:00
markm
7726f590e7 Fix some easy WARNS. 2002-07-31 16:52:16 +00:00
johan
c464bca234 Add the -n option, which automatically answers "no" to the overwrite question.
PR:		7828
Suggested by:	Daniel O'Connor <doconnor@gsoft.com.au>
Approved by:	sheldonh (mentor)
MFC after:	2 weeks
2002-07-23 00:42:56 +00:00
sheldonh
eaeed7f0ff Revert previous delta, which is not required with rev 1.5 of
src/contrib/gcc/c-format.c .
2002-07-15 12:08:21 +00:00
sheldonh
aa9de7efae Set WFORMAT=0, because our compiler currently complains about NULL
arg 2 to err() and friends, and warnings are promoted to errors.

This allows the following revisions to be reverted:

	rev 1.39	src/bin/cp/cp.c
	rev 1.26	src/bin/chmod/chmod.c
	rev 1.40	src/bin/rm/rm.c

The following revisions can already be reverted, because they were
already covered by WFORMAT=0:

	rev 1.8		src/bin/ls/lomac.c
	rev 1.63	src/bin/ls/ls.c
	rev 1.8		src/bin/ps/lomac.c
	rev 1.34	src/bin/rcp/rcp.c
2002-07-11 08:45:38 +00:00
dillon
3adf63f81d err() is documented as allowing NULL for the format string but GCC isn't
happy about it any more so change the usage to make buildworld work again.
2002-07-10 20:44:55 +00:00
markm
837d0142a4 Fix some low-hanging lint-fruit: endianness and staticness warnings. 2002-07-03 16:35:20 +00:00
obrien
c84c569bd1 Consistently use __FBSDID 2002-06-30 05:13:54 +00:00
tjr
041d0fbbd9 When -R is not specified, fail to copy the contents of dangling symlinks
instead of making a copy of the link itself (SUSv3)

Obtained from:	NetBSD
2002-06-13 15:48:36 +00:00
ache
fbce3fb517 Optimize prev. commit code a bit 2002-05-17 12:24:19 +00:00
ache
c711b20bf2 Trailing slash fixes.
Fix the case:
        cp file nonexistent/
which create nonextstent as file while trailing slash clearly indicates
that nonexistent must be a directory.
Also fix the case:
	cp file1 file2/
which should produce error.
2002-05-17 11:52:48 +00:00
alfred
c4d4a5fa12 Add semicolon to empty default case to silence warning. 2002-05-11 00:21:00 +00:00