Commit Graph

62 Commits

Author SHA1 Message Date
Christian S.J. Peron
9b4261c9b4 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
Maxime Henrion
8835fa2759 Correct a few places where we called warn() when warnx() should have
been used.

Submitted by:	"Liam J. Foy" <liamfoy@sepulcrum.org>
Obtained from:	DragonFlyBSD
2005-05-19 21:33:48 +00:00
Ruslan Ermilov
6fca4c7c3f 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
Warner Losh
9ddb49cbe4 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
Mark Murray
6195fb4102 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
Pawel Jakub Dawidek
3184e92100 When symbolic link is pointed onto a mount point, it can't be moved
to a different file system.
Patch in PR was incorrect.

PR:		bin/64430
Submitted by:	Samuel Tardieu
MFC after:	3 days
2004-03-21 13:38:37 +00:00
David E. O'Brien
8d5c19ffbc Centralize _PATH_* definitions.
Submitted by:	Tim Kientzle <kientzle@acm.org> (embellished by me)
2003-05-05 22:49:23 +00:00
David E. O'Brien
09a80d4867 Quiet warnings about copyright[]. 2003-05-01 16:58:57 +00:00
Giorgos Keramidas
99479039bb Grammar fix.
PR:		docs/42021
Submitted by:	Jeff Ito <jeffi@rcn.com>
MFC after:	3 days
2002-08-26 06:16:51 +00:00
Tom Rhodes
7d971bbf29 s/filesystem/file system/ as discussed on -developers 2002-08-21 17:32:44 +00:00
Ruslan Ermilov
ca38f0ddf7 mdoc(7) police: tidy up, bump document date on behalf of the -n option. 2002-08-09 10:46:00 +00:00
Johan Karlsson
0f7109e8c2 Update usage for the addition of -n in rev 1.35 of mv.c.
Approved by:	obrien, sheldonh (mentor).
2002-07-09 17:45:13 +00:00
Tim J. Robbins
9a81395d08 When trying to emulate a cross-device move operation with cp and rm, add
a "--" argument after the options so filenames with leading dashes are
handled correctly.

PR:		39318
Submitted by:	Serge van den Boom <svdb@stack.nl>
MFC after:	1 week
2002-06-16 04:06:58 +00:00
Juli Mallett
71e092d1bb Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in the
CURRENT <paths.h>.
2002-05-17 11:38:48 +00:00
Tom Rhodes
ebd4324457 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +00:00
David E. O'Brien
0302f42b51 Update SCM ID. 2002-03-22 19:52:59 +00:00
David E. O'Brien
12767b8463 Note that -n is non-standard. 2002-03-22 19:52:48 +00:00
David E. O'Brien
dce742c573 Add the -n option, which automatically answers "no" to the overwrite question. 2002-03-22 07:45:36 +00:00
Mark Murray
4b23bd7c2a Warnings fixes. 2002-02-22 21:13:31 +00:00
Warner Losh
fc69394f0a Move user_from_uid to pwd.h
Move group_from_gid to grp.h
Remove from stdlib.h
Make the prototypes match the code
Fix rm and mv to include new files.

NetBSD has these defined in those files, and others too that I've not
done.

Approved by: terminal room kabal
Reviewed by: jhb, phk
2002-02-14 01:59:47 +00:00
Warner Losh
b75c76877e missed a few registers 2002-02-02 07:09:30 +00:00
Warner Losh
46251dde8f o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
2002-02-02 06:48:10 +00:00
David E. O'Brien
a748290789 Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by:	mike
2001-12-04 01:57:47 +00:00
Ruslan Ermilov
d628d776c4 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
Dima Dorfman
b91c884fda Set WARNS=2 on programs which compile cleanly.
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-07-15 10:30:46 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Brian Somers
7bc6d0158f Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
Warner Losh
422a64eac7 Use PATH_MAX in preference to MAXPATHLEN. 2001-05-29 18:20:36 +00:00
Kris Kennaway
29e13abe4c Silence WARNS=2 and BDECFLAGS on alpha and i386, except for mode_t
warnings.

MFC after:	1 week
2001-05-20 05:00:16 +00:00
Ruslan Ermilov
be8b149795 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 11:39:41 +00:00
SADA Kenji
f698dde983 Don't emit a warning message if fchflags() returns EOPNOTSUPP
Requested by:	FUJISHIMA Satsuki <k5@cheerful.com>
Obtained from:	OpenBSD
2000-07-20 18:30:00 +00:00
SADA Kenji
3c2ddcf514 To make inherit file flags when mv(1) moves file between directories
on different file systems.

PR:		bin/12375
Submitted by:	Takashi SHIRAI <shirai@nintendo.co.jp>
No response by:	steve
No problem with:	building 5-current world
2000-07-15 14:59:02 +00:00
David Malone
a95d6fda80 Use lstat(2) instead of stat(2) when deciding if we should fastcopy
a file. This fixes moving symlinks across partitions.

PR:		17847
Reviewed by:	bde
2000-07-11 18:01:42 +00:00
Josef Karthauser
6a9a6f05ed Removed bogus dependancy on libutil.
Noticed by:	bde
2000-01-01 15:40:40 +00:00
Michael Haro
234c2f5b6e mention that -v is non-standard
Reviewed-by:	obrien
1999-09-04 03:33:18 +00:00
Michael Haro
46fedeb096 add verbose flag 1999-08-29 08:21:16 +00:00
Peter Wemm
2a4562393f $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
Kris Kennaway
46be34b902 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
Dag-Erling Smørgrav
1fd98d7d88 Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork()
instead.

Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.

PR:		Loosely related to bin/8252
Approved by:	jkh and bde
1998-10-13 14:52:33 +00:00
Bruce Evans
fe6f0b0824 Fixed printf format errors. 1998-06-28 21:00:04 +00:00
Warner Losh
8a20f85ccb Make sure we don't overflow the path buffer. Exit if we do.
Obtained from or inspired by: A similar change in OpenBSD by theo
1998-06-09 03:39:38 +00:00
Steve Price
191b38b5fa Don't append a '/' to the destination directory if there
is already one there.

PR:		3025
1998-05-25 22:44:16 +00:00
Philippe Charnier
c9a8d1f4dd Correct use of .Nm. Add rcsid. 1998-05-15 06:30:58 +00:00
Eivind Eklund
a33d9e6606 Merge from OpenBSD:
> Error out if someone tries to mv a mount point.  Old behavior was to
> move all files contained in the mounted filesystem to the dest. dir
> which could be quite nasty.  Personally, I think rename(2) should
> return EPERM or EINVAL instead of EXDEV.

Obtained from: OpenBSD mv.c rev 1.6 by Todd Miller <millert@openbsd.org>
1997-12-10 17:52:49 +00:00
Wolfgang Helbig
af6ff02816 Synchronize usage() and man page.
Pointed out by bde.
1997-10-26 10:33:02 +00:00
Wolfram Schneider
ae691257b7 mv(1) is too silent if used with the option -i. It should
print which input mv(1) expect (y/n) and print a warning if the
file was not overwritten.
1997-10-04 13:02:06 +00:00
Wolfram Schneider
fee9ad97d6 Endless loop.
$ touch from to
$ echo -n loop | mv -i from to
overwrite to?
^C
1997-09-28 10:41:40 +00:00
Warner Losh
93ef08af3e compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:24:41 +00:00
Guido van Rooij
03001f577f Make mv more robust. A race has been fixed, as well as an extra warning
added when sbits are cleared.
Fixes PR 1351 and 1377 (I hope).
1997-03-08 16:05:44 +00:00
Peter Wemm
b97fa2ef50 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00