From nobody@FreeBSD.org  Tue Jun 28 06:22:15 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 77B5316A41C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Jun 2005 06:22:15 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 631E843D49
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Jun 2005 06:22:15 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j5S6MFTd001329
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Jun 2005 06:22:15 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j5S6MEqY001328;
	Tue, 28 Jun 2005 06:22:14 GMT
	(envelope-from nobody)
Message-Id: <200506280622.j5S6MEqY001328@www.freebsd.org>
Date: Tue, 28 Jun 2005 06:22:14 GMT
From: "Adil F. Mamedov" <adilm@risk.az>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rm doesn't remove file with name, which is like flag for the command (-l, -a...)
X-Send-Pr-Version: www-2.3

>Number:         82721
>Category:       misc
>Synopsis:       rm doesn't remove file with name, which is like flag for the command (-l, -a...)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 28 06:30:18 GMT 2005
>Closed-Date:    Tue Jun 28 07:00:24 GMT 2005
>Last-Modified:  Tue Jun 28 07:00:24 GMT 2005
>Originator:     Adil F. Mamedov
>Release:        5.3
>Organization:
R.I.S.K Company, Baku, Azerbaijan.
>Environment:
FreeBSD myhostname 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Tue Mar  1 19:11:54 AZT 2005     ejik@myhostname:/usr/src/sys/i386/compile/GENERIC  i386
>Description:
I found a file with name "-l" in my home directory. When i try to delete it or rename it, i get error:

ejik-/home/ejik# rm "-l"
rm: illegal option -- l
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file

ejik-/home/ejik# rm -l
rm: illegal option -- l
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file

ejik-/home/ejik# mv "-l" l
mv: illegal option -- l
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory

ejik-/home/ejik# mv -l l
mv: illegal option -- l
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory

ejik-/home/ejik# mv '-l' l
mv: illegal option -- l
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory

ejik-/home/ejik# rm '-l'
rm: illegal option -- l
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file
ejik-/home/ejik#
>How-To-Repeat:
echo > -l - This creates the file
Then just try to delete, or move it...
>Fix:
      
>Release-Note:
>Audit-Trail:

From: "Adil F. Mamedov" <AdilM@risk.az>
To: <bug-followup@FreeBSD.org>,
	"Adil F. Mamedov" <AdilM@risk.az>
Cc:  
Subject: Re: misc/82721: rm doesn't remove file with name, which is like flag for the command (-l, -a...)
Date: Tue, 28 Jun 2005 11:41:05 +0500

 This is a multi-part message in MIME format.
 
 ------_=_NextPart_001_01C57BAC.5D448378
 Content-Type: text/plain;
 	charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 
 The files can be deleted this way:
 
 =20
 
 root# rm ./-l
 
 =20
 
 Adil F. Mamedov,
 
 R.I.S.K. Company <http://www.risk.az> , Service Center.
 
 =20
 
 
 ------_=_NextPart_001_01C57BAC.5D448378
 Content-Type: text/html;
 	charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 
 <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
 xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
 xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
 xmlns=3D"http://www.w3.org/TR/REC-html40">
 
 <head>
 <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
 charset=3Dus-ascii">
 <meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
 <o:SmartTagType =
 namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
  name=3D"place"/>
 <o:SmartTagType =
 namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
  name=3D"PlaceType"/>
 <o:SmartTagType =
 namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
  name=3D"PlaceName"/>
 <!--[if !mso]>
 <style>
 st1\:*{behavior:url(#default#ieooui) }
 </style>
 <![endif]-->
 <style>
 <!--
  /* Style Definitions */
  p.MsoNormal, li.MsoNormal, div.MsoNormal
 	{margin:0cm;
 	margin-bottom:.0001pt;
 	font-size:12.0pt;
 	font-family:"Times New Roman";}
 a:link, span.MsoHyperlink
 	{color:blue;
 	text-decoration:underline;}
 a:visited, span.MsoHyperlinkFollowed
 	{color:purple;
 	text-decoration:underline;}
 span.EmailStyle17
 	{mso-style-type:personal-compose;
 	font-family:Arial;
 	color:windowtext;}
 @page Section1
 	{size:595.3pt 841.9pt;
 	margin:2.0cm 42.5pt 2.0cm 3.0cm;}
 div.Section1
 	{page:Section1;}
 -->
 </style>
 
 </head>
 
 <body lang=3DRU link=3Dblue vlink=3Dpurple>
 
 <div class=3DSection1>
 
 <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
 style=3D'font-size:
 10.0pt;font-family:Arial'>The files can be deleted this =
 way:<o:p></o:p></span></font></p>
 
 <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
 style=3D'font-size:
 10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
 
 <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
 style=3D'font-size:
 10.0pt;font-family:Arial'>root# rm ./-l<o:p></o:p></span></font></p>
 
 <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
 style=3D'font-size:
 10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
 
 <p class=3DMsoNormal><em><b><i><font size=3D3 face=3D"Times New =
 Roman"><span
 lang=3DEN-US style=3D'font-size:12.0pt;font-weight:bold'>Adil F. =
 Mamedov</span></font></i></b></em><em><i><font
 face=3D"Times New Roman"><span lang=3DEN-US =
 style=3D'font-style:normal'>,</span></font></i></em><span
 lang=3DEN-US><o:p></o:p></span></p>
 
 <p class=3DMsoNormal><font size=3D2 color=3Dblack face=3DArial><span =
 style=3D'font-size:
 10.0pt;font-family:Arial;color:black'><a =
 href=3D"http://www.risk.az"><strong><b><font
 color=3Dblack face=3DArial><span lang=3DEN-US =
 style=3D'font-family:Arial;color:black'>R.I.S.K.
 Company</span></font></b></strong></a></span></font><font size=3D2 =
 face=3DArial><span
 lang=3DEN-US style=3D'font-size:10.0pt;font-family:Arial'>, <st1:place =
 w:st=3D"on"><st1:PlaceName
  w:st=3D"on">Service</st1:PlaceName> <st1:PlaceType =
 w:st=3D"on">Center</st1:PlaceType></st1:place>.</span></font><font
 size=3D2 face=3DArial><span lang=3DEN-US =
 style=3D'font-size:10.0pt;font-family:Arial'><o:p></o:p></span></font></p=
 >
 
 <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
 lang=3DEN-US
 style=3D'font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>
 
 </div>
 
 </body>
 
 </html>
 
 ------_=_NextPart_001_01C57BAC.5D448378--

From: Matteo Riondato <matteo@freebsd.org>
To: bug-followup@freebsd.org, "Adil F. Mamedov" <adilm@risk.az>
Cc:  
Subject: Re: misc/82721: rm doesn't remove file with name, which is like flag for the command (-l, -a...)
Date: Tue, 28 Jun 2005 08:48:11 +0200

 kaiser#touch -- -l
 kaiser#ls | grep "\-l"
 -l
 kaiser#mv -- -l l
 kaiser#ls | grep "\-l"
 kaiser#ls | grep -e ^l$
 l
 kaiser#
 
 This work with rm too.
 Note that this work with any program which uses the getopt(3) routine.
 If you don't have any objection I will close this bug.
 Best Regards
 -- 
 Matteo Riondato
 FreeBSD Volunteer (http://freebsd.org)
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)
State-Changed-From-To: open->closed 
State-Changed-By: matteo 
State-Changed-When: Tue Jun 28 06:59:07 GMT 2005 
State-Changed-Why:  
Closed at submitter's request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=82721 
>Unformatted:
