From owner-freebsd-bugs Fri Jun 14 19:20:15 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A9C5F37B42F for ; Fri, 14 Jun 2002 19:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5F2K1V16114; Fri, 14 Jun 2002 19:20:01 -0700 (PDT) (envelope-from gnats) Received: from inferno.stuiver.net (t-indiv8-234.athome.tue.nl [131.155.242.234]) by hub.freebsd.org (Postfix) with ESMTP id BE16C37B42F for ; Fri, 14 Jun 2002 19:16:21 -0700 (PDT) Received: by inferno.stuiver.net (Postfix, from userid 1106) id 7DE8B5A; Sat, 15 Jun 2002 04:04:25 +0200 (CEST) Message-Id: <20020615020425.7DE8B5A@inferno.stuiver.net> Date: Sat, 15 Jun 2002 04:04:25 +0200 (CEST) From: Serge van den Boom Reply-To: Serge van den Boom To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/39318: /bin/mv executes /bin/cp and /bin/rm without -- Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 39318 >Category: bin >Synopsis: /bin/mv executes /bin/cp and /bin/rm without -- >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jun 14 19:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Serge van den Boom >Release: FreeBSD 4.5-RELEASE i386 >Organization: M.C.G.V. Stack >Environment: System: FreeBSD inferno.stuiver.net 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Sun Mar 17 04:23:07 CET 2002 svdb@inferno.stuiver.net:/usr/src/sys/compile/INFERNO i386 >Description: When moving a directory to another filesystem, /bin/mv executes /bin/cp and /bin/mv, without '--', so that filenames starting with '-' are interpreted as options to /bin/cp and /bin/mv. >How-To-Repeat: mkdir -- -v mv -- -v /tmp # where /tmp is on another filesystem >Fix: diff -u mv/mv.c mv.patched/mv.c --- mv/mv.c Sat Jun 15 03:10:09 2002 +++ mv.patched/mv.c Sat Jun 15 03:11:23 2002 @@ -331,7 +331,7 @@ int pid, status; if ((pid = fork()) == 0) { - execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", from, to, + execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to, (char *)NULL); warn("%s", _PATH_CP); _exit(1); @@ -350,7 +350,7 @@ 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); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message