From vaidab@phenix.rootshell.be  Fri Nov  4 05:38:16 2005
Return-Path: <vaidab@phenix.rootshell.be>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B445816A41F
	for <bug-followup@FreeBSD.org>; Fri,  4 Nov 2005 05:38:16 +0000 (GMT)
	(envelope-from vaidab@phenix.rootshell.be)
Received: from phenix.rootshell.be (phenix.rootshell.be [217.22.55.50])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6008043D45
	for <bug-followup@FreeBSD.org>; Fri,  4 Nov 2005 05:38:16 +0000 (GMT)
	(envelope-from vaidab@phenix.rootshell.be)
Received: by phenix.rootshell.be (Postfix, from userid 55646)
	id 5DC9B183C1; Thu,  3 Nov 2005 23:38:43 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
	by phenix.rootshell.be (Postfix) with ESMTP id 5892C1835C
	for <bug-followup@FreeBSD.org>; Thu,  3 Nov 2005 23:38:43 +0100 (CET)
Message-Id: <Pine.LNX.4.62.0511032336380.2160@phenix.rootshell.be>
Date: Thu, 3 Nov 2005 23:38:43 +0100 (CET)
From: vaidab <vaidab@phenix.rootshell.be>
To: bug-followup@FreeBSD.org
Subject: Re: [patch] rm(1): "/bin/rm -P" cannot remove files not writeable
 by user while "/bin/rm" can

>Number:         88479
>Category:       bin
>Synopsis:       Re: [patch] rm(1): "/bin/rm -P" cannot remove files not writeable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 04 05:40:14 GMT 2005
>Closed-Date:    Fri Nov 04 15:23:55 GMT 2005
>Last-Modified:  Fri Nov 04 15:23:55 GMT 2005
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 --- /usr/src/bin/rm/rm.c.orig	Thu Nov  3 21:19:47 2005
 +++ /usr/src/bin/rm/rm.c	Thu Nov  3 21:20:42 2005
 @@ -393,6 +393,8 @@
   	}
   	if (!S_ISREG(sbp->st_mode))
   		return (1);
 +	if (lchmod(file, S_IWUSR) == -1)
 +		goto err;
   	if ((fd = open(file, O_WRONLY, 0)) == -1)
   		goto err;
   	if (fstatfs(fd, &fsb) == -1)
 @@ -450,7 +452,7 @@
   		 * we will not be able to overwrite file contents and will
   		 * barf later.
   		 */
 -		if (!stdin_ok || S_ISLNK(sp->st_mode) || Pflag ||
 +		if (!stdin_ok || S_ISLNK(sp->st_mode) ||
   		    (!access(name, W_OK) &&
   		    !(sp->st_flags & (SF_APPEND|SF_IMMUTABLE)) &&
   		    (!(sp->st_flags & (UF_APPEND|UF_IMMUTABLE)) || !uid)))
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Fri Nov 4 15:23:04 GMT 2005 
State-Changed-Why:  
Misfiled followup to kern/88365. 


Responsible-Changed-From-To: gnats-admin->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Nov 4 15:23:04 GMT 2005 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=88479 
>Unformatted:
  by user while "/bin/rm" can
