From fluffy@FreeBSD.org  Mon Sep 21 13:51:42 2009
Return-Path: <fluffy@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0CCB41065672
	for <FreeBSD-gnats-submit@FreeBSD.org>; Mon, 21 Sep 2009 13:51:42 +0000 (UTC)
	(envelope-from fluffy@FreeBSD.org)
Received: from ns.ael.RU (ns.ael.ru [62.76.207.226])
	by mx1.freebsd.org (Postfix) with ESMTP id 54C108FC15
	for <FreeBSD-gnats-submit@FreeBSD.org>; Mon, 21 Sep 2009 13:51:40 +0000 (UTC)
Received: from Fluffy.Khv.RU ([80.83.238.211])
	by ns.ael.RU (8.14.3/8.14.3/Fluffy/5.3) with ESMTP id n8LDpUe2038219
	for <FreeBSD-gnats-submit@FreeBSD.org>; Tue, 22 Sep 2009 00:51:33 +1100 (VLAST)
	(envelope-from fluffy@FreeBSD.org)
Received: from Fluffy.Khv.RU (localhost [127.0.0.1])
	by Fluffy.Khv.RU (8.14.3/8.14.3/Fluffy/5.4.1) with ESMTP id n8LDpRF8067317
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 22 Sep 2009 00:51:27 +1100 (VLAST)
	(envelope-from fluffy@FreeBSD.org)
Message-Id: <1253541087.99336@Fluffy.Khv.RU>
Date: Tue, 22 Sep 2009 00:51:27 +1100
From: "Dima Panov" <fluffy@FreeBSD.org>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject: devfs: /dev/null must be immunable to delete/unlink
X-Send-Pr-Version: gtk-send-pr 0.4.9 
X-GNATS-Notify:

>Number:         139014
>Category:       kern
>Synopsis:       [null] /dev/null must be immunable to delete/unlink
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 21 14:00:04 UTC 2009
>Closed-Date:    
>Last-Modified:  Wed Sep 25 11:50:00 UTC 2013
>Originator:     Dima Panov
>Release:        FreeBSD 9.0-900001-CURRENT amd64
>Organization:
Fluffy.Khv.RU 
>Environment:


System: FreeBSD 9.0-900001-CURRENT #0: Thu Sep 10 16:58:16 VLAST 2009
    fluffy@Fluffy.Khv.RU:/usr/obj/usr/src/sys/Spot



>Description:


/dev/null affected by unlink process, which is not good and leads to hiding null from devfs tree.

It must be immunable to unlinking




>How-To-Repeat:


please run this small script (part of one configure script)

------------------
#!/bis/sh
cat >conftest.cpp <<EOF
int main() { return 0; }
EOF
gcc -o /dev/null conftest.cpp
------------------

after gcc ends   node /dev/null will be absent and not autorecovered to
available state.


>Fix:


unknown :(


>Release-Note:
>Audit-Trail:

From: Bruce Cran <bruce@cran.org.uk>
To: bug-followup@freebsd.org,
 fluffy@freebsd.org
Cc:  
Subject: Re: kern/139014: [null] /dev/null must be immunable to delete/unlink
Date: Thu, 4 Mar 2010 18:40:44 +0000

 I can't replicate this on a recent 9-CURRENT installation: running 'g++ -o 
 /dev/null conftest.cpp' (gcc gives an error) as a normal user does nothing, 
 and as root it just updates the permissions to add execute permission.
 
 -- 
 Bruce Cran
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Thu Mar 4 19:17:56 UTC 2010 
State-Changed-Why:  
Note that feedback was requested. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139014 

From: Dima Panov <fluffy@freebsd.org>
To: Bruce Cran <bruce@cran.org.uk>
Cc: bug-followup@freebsd.org
Subject: Re: kern/139014: [null] /dev/null must be immunable to delete/unlink
Date: Fri, 5 Mar 2010 12:33:23 +1000

 On Friday 05 March 2010 04:40:44 Bruce Cran wrote:
 Synopsis: [null] /dev/null must be immunable to delete/unlink
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=139014
 
 > I can't replicate this on a recent 9-CURRENT installation: running 'g++ -o
 > /dev/null conftest.cpp' (gcc gives an error) as a normal user does nothing,
 > and as root it just updates the permissions to add execute permission.
 
 
 [fluffy@Fluffy] /tmp/1> cat conftest.cpp
 int main() { return 0; }
 [fluffy@Fluffy] /tmp/1> ll /dev/null
 crw-rw-rw-  1 root  wheel    0,  29  5 Mar 10:34 /dev/null
 [fluffy@Fluffy] /tmp/1> gcc -o /dev/null conftest.cpp
 /var/tmp//ccFieWqh.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
 [fluffy@Fluffy] /tmp/1> ll /dev/null
 crw-rw-rw-  1 root  wheel    0,  29  5 Mar 10:34 /dev/null
 [fluffy@Fluffy] /tmp/1> sudo gcc -o /dev/null conftest.cpp
 /var/tmp//ccQGuy8l.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
 [fluffy@Fluffy] /tmp/1> ll /dev/null
 ls: /dev/null: No such file or directory
 [fluffy@Fluffy] /tmp/1>
 
 FreeBSD Fluffy.Khv.RU 9.0-900009-CURRENT FreeBSD 9.0-900009-CURRENT #1 r203791M: Fri Feb 
 12 23:12:30 VLAT 2010     fluffy@Fluffy.Khv.RU:/usr/obj/usr/src/sys/Spot  amd64
 
 -- 
 Dima "Red Fox" Panov @ Home | C73E 2B72 1FFD 61BD E206 1234 A626 76ED 93E3 B018
 Khabarovsk, Russia          | 2D30 2CCB 9984 130C 6F87 BAFC FB8B A09D D539 8F29
 KDE@FreeBSD Team | FreeBSD committer since 10.08.2009 | FreeBSD since Sept 1995
 Twitter.com:fluffy_khv | Skype:dima.panov | Jabber.org:fluffy.khv | ICQ:1745024
State-Changed-From-To: feedback->open  
State-Changed-By: brucec 
State-Changed-When: Fri Mar 5 07:19:45 UTC 2010 
State-Changed-Why:  
Feedback received. 
A simpler way to replicate the problem is to run "rm /dev/null" as root. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139014 

From: Robert Lorentz <robert.lorentz@gmail.com>
To: bug-followup@FreeBSD.org,
 fluffy@FreeBSD.org
Cc:  
Subject: Re: kern/139014: [null] /dev/null must be immunable to delete/unlink
Date: Mon, 25 Apr 2011 22:19:47 -0400

 I've just started poking around the PR's to try to learn and help out, =
 and this one looked like a good first try..
 
 Sure enough, as root on 9.0 -CURRENT I can "rm /dev/null" and it does =
 unlink and is missing.  However, I just recreate it with mknod /dev/null =
 c 0 6 ..  the behavior is identical on 8.2-RELEASE.
 
 Am I missing something here?  Is there some kind of new default behavior =
 that should be implemented here?=20=

From: Bryan Drewery <bdrewery@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/139014: [null] /dev/null must be immunable to delete/unlink
Date: Wed, 25 Sep 2013 06:47:31 -0500

 This is still present as of 10.0 r255865 on head.
>Unformatted:
