From nobody@FreeBSD.org  Thu May 29 02:02:46 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0B3D4106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 May 2008 02:02:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A0158FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 May 2008 02:02:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m4T216VL024482
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 May 2008 02:01:06 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m4T216HN024481;
	Thu, 29 May 2008 02:01:06 GMT
	(envelope-from nobody)
Message-Id: <200805290201.m4T216HN024481@www.freebsd.org>
Date: Thu, 29 May 2008 02:01:06 GMT
From: "Michael A. Smith" <michael@smith-li.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: find -execdir does not prepend ./ to filenames, causing problems for certain files.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         124084
>Category:       bin
>Synopsis:       find(1): find -execdir does not prepend ./ to filenames, causing problems for certain files.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 29 02:10:01 UTC 2008
>Closed-Date:    
>Last-Modified:  Tue Mar 24 01:50:04 UTC 2009
>Originator:     Michael A. Smith
>Release:        7.0
>Organization:
>Environment:
>Description:
freebsd find's implementation of -execdir fails for filenames that might be mistaken for arguments.
>How-To-Repeat:
The classic example is a filename starting with a dash.

$ mkdir /tmp/test
$ cd /tmp/test
$ >"-foo"
$ find . -type f -execdir rm {} \;
rm: illegal option -- o
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file

>Fix:
The easiest solution is to patch find to prepend ./ to each filename.

>Release-Note:
>Audit-Trail:

From: Remko Lodder <remko@FreeBSD.org>
To: "Michael A. Smith" <michael@smith-li.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/124084: find -execdir does not prepend ./ to filenames,	causing
 problems for certain files.
Date: Fri, 30 May 2008 16:42:41 +0200

 as a workaround you can do:
 
 find . -type f -exec rm {} \; (for example).
 
 -- 
 
 /"\   Best regards,                      | remko@FreeBSD.org
 \ /   Remko Lodder                       | remko@EFnet
   X    http://www.evilcoder.org/          |
 / \   ASCII Ribbon Campaign              | Against HTML Mail and News

From: Scott Sosna <scott@sosna.org>
To: bug-followup@FreeBSD.org, michael@smith-li.com
Cc:  
Subject: Re: bin/124084: find(1): find -execdir does not prepend ./ to filenames,
 causing problems for certain files.
Date: Mon, 23 Mar 2009 20:29:15 -0500

 This is a multi-part message in MIME format.
 --------------070607050305000006090009
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 The same problem occurs with touch:
 
 $ touch "-foo"
 touch: illegal option -- o
 usage: touch [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...
 
 
 --------------070607050305000006090009
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
 </head>
 <body bgcolor="#ffffff" text="#000000">
 <font size="-1"><font face="Helvetica, Arial, sans-serif">The same
 problem occurs with touch:<br>
 <br>
 $ touch "-foo"<br>
 touch: illegal option -- o<br>
 usage: touch [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...<br>
 <br>
 </font></font>
 </body>
 </html>
 
 --------------070607050305000006090009--
>Unformatted:
