From wxs@atarininja.org  Thu Jun 21 02:12:34 2007
Return-Path: <wxs@atarininja.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id E1EB816A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Jun 2007 02:12:34 +0000 (UTC)
	(envelope-from wxs@atarininja.org)
Received: from syn.atarininja.org (syn.csh.rit.edu [129.21.60.158])
	by mx1.freebsd.org (Postfix) with ESMTP id BC83413C447
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Jun 2007 02:12:34 +0000 (UTC)
	(envelope-from wxs@atarininja.org)
Received: by syn.atarininja.org (Postfix, from userid 1001)
	id 60EEE5C2E; Wed, 20 Jun 2007 22:16:51 -0400 (EDT)
Message-Id: <20070621021651.60EEE5C2E@syn.atarininja.org>
Date: Wed, 20 Jun 2007 22:16:51 -0400 (EDT)
From: Wesley Shields <wxs@atarininja.org>
Reply-To: Wesley Shields <wxs@atarininja.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: onatan@gmail.com
Subject: [UPDATE]: Mark net/libdnet as broken in a jail.
X-Send-Pr-Version: 3.113
X-GNATS-Notify: onatan@gmail.com

>Number:         113893
>Category:       ports
>Synopsis:       [UPDATE]: Mark net/libdnet as broken in a jail.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 21 02:20:01 GMT 2007
>Closed-Date:    Mon Jul 16 07:13:08 GMT 2007
>Last-Modified:  Mon Mar 31 11:20:00 UTC 2008
>Originator:     Wesley Shields
>Release:        FreeBSD 6.2-RELEASE-p5 amd64
>Organization:
>Environment:
System: FreeBSD syn.csh.rit.edu 6.2-RELEASE-p5 FreeBSD 6.2-RELEASE-p5 #7: Thu May 24 09:18:59 EDT 2007 root@syn.csh.rit.edu:/usr/obj/usr/src/sys/SMP amd64

>Description:
net/libdnet does not build inside of a jail.  I believe this is because
the configure script looks for /dev/bpf0 and builds eth-bsd.c if it
exists.  In the case of a jail /dev/bpf0 does not exist so the
post-build step fails.  The only reference I could find to this problem
is at:

http://lists.freebsd.org/pipermail/freebsd-ports/2006-November/037099.html

and has no solution.  I've attached a port which marks the port as
broken in the case of /dev/bpf0 not existing.  A better solution would
be to patch configure to still build eth-bsd.c but I hesitate to do that
since building it anyways means it will just error out when running.

I've CC'ed the maintainer on this.

>How-To-Repeat:
Attempt to build net/libdnet in a jail.  You will get the same error
message as referenced in the thread above.

>Fix:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/libdnet/Makefile,v
retrieving revision 1.27
diff -u -r1.27 Makefile
--- Makefile	12 Mar 2007 17:51:53 -0000	1.27
+++ Makefile	21 Jun 2007 01:17:58 -0000
@@ -27,6 +27,10 @@
 MAN8=	dnet.8
 .endif
 
+.if !exists(/dev/bpf0)
+BROKEN=	Does not build properly without /dev/bpf0.
+.endif
+
 .include <bsd.port.pre.mk>
 
 .if !defined(LIBDNET_SLAVE)
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Jun 21 02:20:08 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

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

Adding to audit trail from misfiled PR ports/113899:

Date: Thu, 21 Jun 2007 04:44:05 +0000
From: "Jonatan B" <onatan@gmail.com>
 
 What does other bpf dependant ports do (libnet, tcpdump etc)?

Adding to audit trail from misfiled PR ports/113910:

From: Wesley Shields <wxs@atarininja.org>
To: Jonatan B <onatan@gmail.com>
 
 tcpdump only checks for /dev/bpf0 once and sets the V_GROUP variable
 accordingly.  I'm not sure what it's used for but it doesn't break the
 build when /dev/bpf0 doesn't exist.
 
 libpcap builds but the configure output contains:
 
 checking packet capture type... null
 
 This is because it can't find /dev/bpf0.
 
 Obviously the port won't work without it but it will at least build and
 install properly.
 
 libnet configure reports:
 
 checking link-layer packet interface type... configure: WARNING: could
 not find a link-layer packet interface
 configure: WARNING: link-layer packet injection will not be available
 
 This is fine because libnet will still allow you to do raw socket
 injection.  It doesn't check to see if raw socket access is allowed or
 not.
 
 The problem with honeyd is in the post-build target which assumes
 ./libs/eth-bsd.o exists.  I suppose it is possible to change the
 post-build target to not use .libs/eth-bsd.o if /dev/bpf0 does not
 exist, but I'm not entirely sure what that will do to the functionality
 of libdnet.
 
 -- WXS

From: Pav Lucistnik <pav@FreeBSD.org>
To: bug-followup@FreeBSD.org, onatan@gmail.com
Cc:  
Subject: Re: ports/113893: [UPDATE]: Mark net/libdnet as broken in a jail.
Date: Sun, 15 Jul 2007 23:40:09 +0200

 Jonatan, how should we resolve this PR?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=113893
 
 Should we go with the patch included?
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 Geography is only physics slowed down, with a few trees stuck on it...
   -- Terry Pratchett
 

From: "Jonatan B" <onatan@gmail.com>
To: bug-followup@freebsd.org, pav@freebsd.org
Cc:  
Subject: Re: ports/113893: [UPDATE]: Mark net/libdnet as broken in a jail.
Date: Mon, 16 Jul 2007 09:21:56 +0530

 On 7/16/07, Pav Lucistnik <pav@freebsd.org> wrote:
 > Jonatan, how should we resolve this PR?
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=113893
 >
 > Should we go with the patch included?
 
 Yes, please do.
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Mon Jul 16 07:13:06 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/113893: commit references a PR
Date: Mon, 16 Jul 2007 07:13:00 +0000 (UTC)

 miwi        2007-07-16 07:12:54 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/libdnet          Makefile 
   Log:
   - Marked BROKEN Does not build properly without /dev/bpf0.
   
   PR:             113893
   Submitted by:   Wesley Shields <wxs@atarininja.org>
   Approved by:    maintainer
   
   Revision  Changes    Path
   1.28      +4 -0      ports/net/libdnet/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: "Mars G Miro" <spry@anarchy.in.the.ph>
To: bug-followup@FreeBSD.org, wxs@atarininja.org, 
	"Pav Lucistnik" <pav@freebsd.org>, "Jonatan B" <onatan@gmail.com>
Cc:  
Subject: Re: ports/113893: [UPDATE]: Mark net/libdnet as broken in a jail.
Date: Mon, 31 Mar 2008 18:48:41 +0800

 Hiya,
 
    I just came across this. I do pkg builds all the time, and I own my
 buildboxens (all other users are trusted), my fix would be to just add
 a devfs ruleset to unhide the /dev/bpf0 on the jail, somethin like:
 
  root@firstcut:~# devfs -m /usr/jails/spryjail/dev/ rule show
 100 include 1
 200 include 2
 300 include 3
 root@firstcut:~# devfs -m /usr/jails/spryjail/dev rule add path 'bpf*' unhide
 root@firstcut:~# devfs -m /usr/jails/spryjail/dev/ rule show
 100 include 1
 200 include 2
 300 include 3
 400 path bpf* unhide
 root@firstcut:~# devfs -m /usr/jails/spryjail/dev rule apply 400
 root@firstcut:~# devfs -m /usr/jails/spryjail/dev/ rule show
 100 include 1
 200 include 2
 300 include 3
 400 path bpf* unhide
 root@firstcut:~# dir /usr/jails/spryjail/dev/bpf0
 total 1
 crw-------  1 root  wheel  -   0, 105 Mar 26 17:40 bpf0
 
 then go back to the jail and build libdnet. Of course, bpf0 shouldn't
 be on the jail for security reasons, but like I said, I own the box
 and want to get done w/ my pkg builds.
 
 Hope this is of any use to anyone encountering this problem ;-)
>Unformatted:
