History log of /freebsd-11.0-release/bin/mv/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
303975 11-Aug-2016 gjb

Copy stable/11@r303970 to releng/11.0 as part of the 11.0-RELEASE
cycle.

Prune svn:mergeinfo from the new branch, and rename it to RC1.

Update __FreeBSD_version.

Use the quarterly branch for the default FreeBSD.conf pkg(8) repo and
the dvd1.iso packages population.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


300643 25-May-2016 truckman

Close from_fd if malloc() fails to avoid a file descriptor leak.

Reported by: Coverity
CID: 1007203
MFC after: 1 week


299094 04-May-2016 ngie

Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
namespacing is kept with FILES appropriately, and that this shouldn't need
to be repeated if the namespace changes -- only the definition of PACKAGE
needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
`tests`. In the event we get to the point where things can be split up
enough in the base system, it would make more sense to group the tests
with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division


298107 16-Apr-2016 gjb

Merge the projects/release-pkg branch to head.

This allows packaging the base system with pkg(8), including
but not limited to providing the ability to provide upstream
binary update possibilities for non-tier-1 architectures.

This merge is a requirement of the 11.0-RELEASE, and as such,
thank you to everyone that has tested the project branch.

Documentation in build(7) etc. is still somewhat sparse, but
updates to those parts will follow.

Sponsored by: The FreeBSD Foundation


296587 09-Mar-2016 bdrewery

DIRDEPS_BUILD: Connect MK_TESTS.

Sponsored by: EMC / Isilon Storage Division


289172 12-Oct-2015 ngie

Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison


284916 28-Jun-2015 jilles

mv: Improve message when moving two or more files to non-directory.

The message text is from cp, which has had a nicer message for this since
2007 (PR bin/50656).

As with cp, the exit status changes from 64 to 1.

PR: 201083
MFC after: 1 week


284345 13-Jun-2015 sjg

Add META_MODE support.

Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision: D2796
Reviewed by: brooks imp


280386 23-Mar-2015 jilles

cp,mv: Use futimens() instead of utimensat() if possible.


277645 24-Jan-2015 jilles

cp,mv,touch: Set timestamps with nanosecond precision.

This uses utimensat().


268129 01-Jul-2014 delphij

Check if fchflags() is needed by fstat'ing before and check
the results.

Reviewed by: jilles
X-MFC-With: r267977


267977 27-Jun-2014 delphij

Always set UF_ARCHIVE on target (because they are by definition new files
and should be archived) and ignore error when we can't set it (e.g. NFS).

Reviewed by: ken
MFC after: 2 weeks


265420 06-May-2014 imp

Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.


263161 14-Mar-2014 jmmv

Make bsd.test.mk the only public mk fragment for the building of tests.

Change {atf,plain,tap}.test.mk to be internal implementation details of
bsd.test.mk. Makefiles that build tests should now only include bsd.test.mk
and declaratively specify what they want to build, without worrying about
the internal implementation of the mk files.

The reason for this change is to permit building test programs of different
interfaces from a single directory, which is something I had a need for
while porting tests over from src/tools/regression/.

Additionally, this change makes it possible to perform some other requested
changes to bsd.test.mk in an easier manner. Coming soon.


259210 11-Dec-2013 jmmv

Migrate tools/regression/bin/ tests to the new layout.

This change is a proof of concept on how to easily integrate existing
tests from the tools/regression/ hierarchy into the /usr/tests/ test
suite and on how to adapt them to the new layout for src.

To achieve these goals, this change:

- Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/.
- Renames the previous regress.sh files to legacy_test.sh.
- Adds Makefiles to build and install the tests and all their supporting
data files into /usr/tests/bin/.
- Plugs the legacy_test test programs into the test suite using the new
TAP backend for Kyua (appearing in 0.8) so that the code of the test
programs does not have to change.
- Registers the new directories in the BSD.test.dist mtree file.

Reviewed by: freebsd-testing
Approved by: rpaulo (mentor)


248597 21-Mar-2013 pjd

- Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of type
u_long. Before this change it was of type int for syscalls, but prototypes
in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not
for lchflags(2)) stated that it was u_long. Now some related functions
use u_long type for flags (strtofflags(3), fflagstostr(3)).
- Make path argument of type 'const char *' for consistency.

Discussed on: arch
Sponsored by: The FreeBSD Foundation


248342 15-Mar-2013 joel

Add a few examples.

Obtained from: OpenBSD


243072 15-Nov-2012 eadler

Follow the behavior as specified in POSIX:

if (exists AND (NOT f_option) AND
((not_writable AND input_is_terminal) OR i_option))
prompt

in particular, add the test for input_is_terminal

PR: bin/173039
Submitted by: Mark Johnston <markjdb@gmail.com>
Approved by: cperciva
MFC after: 3 days


239951 31-Aug-2012 jhb

Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
symbolic link to a directory for the target as a symbolic link instead of
a directory. This makes it possible to atomically update a symbolic
link using rename().

Reviewed by: gj
MFC after: 2 weeks


226961 31-Oct-2011 ed

Put some static keywords in the source code.

For these simple utilities, it doesn't harm to make all global variables
static. In fact, this allows the compiler to perform better forms of
optimisation and analysis.


225954 03-Oct-2011 ivoras

Don't chop IO into small pieces, follow cp(1) and just use MAXPHYS.


196841 04-Sep-2009 trasz

Add NFSv4 ACL support to mv(1).

Reviewed by: rwatson


180604 19-Jul-2008 delphij

Staticify symbols that will not be used in other
places.


174935 27-Dec-2007 dds

- Roll-back attempts to mimic rename(2) atomicity introduced in 1.47,
and follow the letter of the POSIX specification.

- Moving a directory to an existing non-empty directory will now fail,
as required.

- Improve consistency and remove some style bugs of earlier versions.

This version passes all tests of tools/regression/bin/mv/regress.sh 1.6

Reviewed by: bde
MFC after: 1 month


174709 17-Dec-2007 dds

Calling any function from vfork other than exec* and _exit yields
undefined behavior.

Noted by: alfred


174667 16-Dec-2007 dds

Eliminate gcc "variable clobbered" warnings by declaring the variables
living across the vfork as volatile.

Noted by: kan


174664 16-Dec-2007 dds

When moving a directory across devices to a place where a directory
with the same name exists, delete that directory first, before performing
the copy. This ensures that mv(1) across devices follows the semantics
of rename(2), as required by POSIX.

This change could introduce the potential of data loss, even if the
copy fails, violating the atomicity properties of rename(2). This is
(mostly) mitigated by first renaming the destination and obliterating
it only after a succesfull copy.

The above logic also led to the introduction of code that will cleanup
the results of a partial copy, if a cross-device copy fails.

PR: bin/118367
MFC after: 1 month


173248 01-Nov-2007 ru

Bump document date on behalf of previous revision.


169510 12-May-2007 pav

Replace a fairly opaque sentence with a much clearer wording from NetBSD.

PR: docs/101330 (inspired by)
Submitted by: Peter Gildea <peter@gildea.com>
Obtained from: NetBSD


149790 05-Sep-2005 csjp

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


146418 19-May-2005 mux

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


140353 16-Jan-2005 ru

Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.


139969 10-Jan-2005 imp

/*- or .\"- or #- to begin license clauses.


127958 06-Apr-2004 markm

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


127272 21-Mar-2004 pjd

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


114763 05-May-2003 obrien

Centralize _PATH_* definitions.

Submitted by: Tim Kientzle <kientzle@acm.org> (embellished by me)


114433 01-May-2003 obrien

Quiet warnings about copyright[].


102434 26-Aug-2002 keramida

Grammar fix.

PR: docs/42021
Submitted by: Jeff Ito <jeffi@rcn.com>
MFC after: 3 days


102230 21-Aug-2002 trhodes

s/filesystem/file system/ as discussed on -developers


101571 09-Aug-2002 ru

mdoc(7) police: tidy up, bump document date on behalf of the -n option.


99678 09-Jul-2002 johan

Update usage for the addition of -n in rev 1.35 of mv.c.

Approved by: obrien, sheldonh (mentor).


98280 16-Jun-2002 tjr

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


96806 17-May-2002 jmallett

Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in the
CURRENT <paths.h>.


96702 16-May-2002 trhodes

Consistancy check s/file system/filesystem/

Reviewed by: brian


92974 22-Mar-2002 obrien

Update SCM ID.


92973 22-Mar-2002 obrien

Note that -n is non-standard.


92935 22-Mar-2002 obrien

Add the -n option, which automatically answers "no" to the overwrite question.


91085 22-Feb-2002 markm

Warnings fixes.


90644 14-Feb-2002 imp

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


90114 02-Feb-2002 imp

missed a few registers


90110 02-Feb-2002 imp

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.


87323 04-Dec-2001 obrien

Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by: mike


81687 15-Aug-2001 ru

mdoc(7) police: utilize the new .Ex macro.


79758 15-Jul-2001 dd

Set WARNS=2 on programs which compile cleanly.

Submitted by: Mike Barcroft <mike@q9media.com>


79754 15-Jul-2001 dd

Remove whitespace at EOL.


79452 09-Jul-2001 brian

Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


77409 29-May-2001 imp

Use PATH_MAX in preference to MAXPATHLEN.


76878 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on alpha and i386, except for mode_t
warnings.

MFC after: 1 week


68935 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


63680 20-Jul-2000 sada

Don't emit a warning message if fchflags() returns EOPNOTSUPP

Requested by: FUJISHIMA Satsuki <k5@cheerful.com>
Obtained from: OpenBSD


63225 15-Jul-2000 sada

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


62963 11-Jul-2000 dwmalone

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


55301 01-Jan-2000 joe

Removed bogus dependancy on libutil.

Noticed by: bde


50871 04-Sep-1999 mharo

mention that -v is non-standard

Reviewed-by: obrien


50544 29-Aug-1999 mharo

add verbose flag


50471 27-Aug-1999 peter

$Id$ -> $FreeBSD$


46684 08-May-1999 kris

Various spelling/formatting changes.

Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


40301 13-Oct-1998 des

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


37245 28-Jun-1998 bde

Fixed printf format errors.


36785 09-Jun-1998 imp

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


36383 25-May-1998 steve

Don't append a '/' to the destination directory if there
is already one there.

PR: 3025


36049 15-May-1998 charnier

Correct use of .Nm. Add rcsid.


31664 10-Dec-1997 eivind

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>


30727 26-Oct-1997 helbig

Synchronize usage() and man page.
Pointed out by bde.


30106 04-Oct-1997 wosch

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.


29933 28-Sep-1997 wosch

Endless loop.

$ touch from to
$ echo -n loop | mv -i from to
overwrite to?
^C


24348 28-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


23525 08-Mar-1997 guido

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).


22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


20420 14-Dec-1996 steve

-Wall cleaning.


17891 29-Aug-1996 wosch

[HISTORY] command appeared in Version 1 AT&T UNIX
Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41


14305 01-Mar-1996 wosch

delete unused label endarg
correct indent of last new code
fix usage string, option -f before option -i (alphabetic order)


14166 20-Feb-1996 wosch

option -f and -i are exclusive (Posix)
respond `Y' is equal to `y'
update usage string
prompt only if source exist


14156 19-Feb-1996 pst

-- is implemented in getopt(3)
-? is an unnecessary case statement and not useful


14154 19-Feb-1996 wosch

delete my last commit
Submitted by: pst, ache


14144 18-Feb-1996 wosch

option -f and -i are exclusive
all flag variables initialized with zero
respond `Y' is equal to `y'
update usage string
prompt only if source exist

ignore -i option if file descriptor stdin not refers to a valid
terminal type device


11298 07-Oct-1995 bde

Handle trailing slashes in source filenames correctly. E.g., rewrite
`mv foo/ ../..' to `mv foo/ ../../foo/', not to `mv foo/ ../../'. The
latter caused a panic. Before the trailing slash changes in the kernel,
the trailing slashes caused the rename() for this mv to fail earlier, so
there was no panic in 2.0.

Fixes part of PR 760.


10068 15-Aug-1995 joerg

The command to `move' across file system boundaries is actually

cp -PRp source_file destination

Closes PR # bin/689: mv(1) manpage

Submitted by: wosch@cs.tu-berlin.de (Wolfram Schneider)


3044 24-Sep-1994 dg

Added $Id$


1557 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1556,
which included commits to RCS files with non-trunk default branches.