diff options
author | Moritz Jodeit <moritz@cvs.openbsd.org> | 2007-02-16 09:04:35 +0000 |
---|---|---|
committer | Moritz Jodeit <moritz@cvs.openbsd.org> | 2007-02-16 09:04:35 +0000 |
commit | 2cb2cb979ec33467cab56b5903d93f0464fa22b5 (patch) | |
tree | e323268a373910100fb7b235feb38b87eb80ca00 /bin/mv | |
parent | 5066e68b81c9309d61a1c3186a9aab6d328c512b (diff) |
Allow moving files starting with a dash across
file system boundaries. Noticed by Roland Illig.
ok otto@ millert@ jaredy@
Diffstat (limited to 'bin/mv')
-rw-r--r-- | bin/mv/mv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 8c905dd36d4..ddcbdadabc5 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mv.c,v 1.32 2005/06/30 15:13:24 millert Exp $ */ +/* $OpenBSD: mv.c,v 1.33 2007/02/16 09:04:34 moritz Exp $ */ /* $NetBSD: mv.c,v 1.9 1995/03/21 09:06:52 cgd Exp $ */ /* @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: mv.c,v 1.32 2005/06/30 15:13:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: mv.c,v 1.33 2007/02/16 09:04:34 moritz Exp $"; #endif #endif /* not lint */ @@ -357,7 +357,7 @@ copy(char *from, char *to) pid_t pid; if ((pid = vfork()) == 0) { - execl(_PATH_CP, "mv", "-PRp", from, to, (char *)NULL); + execl(_PATH_CP, "mv", "-PRp", "--", from, to, (char *)NULL); warn("%s", _PATH_CP); _exit(1); } @@ -375,7 +375,7 @@ copy(char *from, char *to) return (1); } if (!(pid = vfork())) { - execl(_PATH_RM, "mv", "-rf", from, (char *)NULL); + execl(_PATH_RM, "mv", "-rf", "--", from, (char *)NULL); warn("%s", _PATH_RM); _exit(1); } |