From nobody@FreeBSD.org  Thu Sep  6 05:16:18 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A79D4106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Sep 2012 05:16:18 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 935188FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Sep 2012 05:16:18 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q865GIdg026360
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 6 Sep 2012 05:16:18 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q865GIcC026334;
	Thu, 6 Sep 2012 05:16:18 GMT
	(envelope-from nobody)
Message-Id: <201209060516.q865GIcC026334@red.freebsd.org>
Date: Thu, 6 Sep 2012 05:16:18 GMT
From: Rajkumar <rajkumars@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Py-PF gives IOError: [Errno 13] Permission denied while trying to get_ruleset
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         171367
>Category:       ports
>Synopsis:       security/py-PF gives IOError: [Errno 13] Permission denied while trying to get_ruleset
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sbz
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 06 05:20:02 UTC 2012
>Closed-Date:    
>Last-Modified:  Mon Apr 21 19:14:04 UTC 2014
>Originator:     Rajkumar
>Release:        9.0-STABLE
>Organization:
>Environment:
FreeBSD freebsd9 9.0-STABLE FreeBSD 9.0-STABLE #2 r232865M: Wed Mar 14 12:57:33 IST 2012     root@freebsd9:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
While trying to run py-PF port in FreeBSD-9 I am getting a permission error. The sequence of commands is as follows:

freebsd9# python
Python 2.7.2 (default, Mar 12 2012, 14:37:14)
[GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9
Type "help", "copyright", "credits" or "license" for more information.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->sbz 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Sep 10 08:50:45 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171367 
State-Changed-From-To: open->feedback 
State-Changed-By: sbz 
State-Changed-When: Mon Apr 21 19:14:03 UTC 2014 
State-Changed-Why:  
I just commit the new version 0.0.8 of security/py-PF. I start debugging 
the permission denied issue by reimplementing the ioctl call in C. Do 
you still have this issue with the new version ? Also I would like to 
know if you have a kernel with CAPABILITY_MODE enabled. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171367 
>Unformatted:
 >>> import PF
 >>> filter = PF.PacketFilter()
 >>> filter.get_ruleset()
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.7/site-packages/PF/PacketFilter.py", line 558, in get_ruleset
     rs.append(*self._get_rules(path, d, clear))
   File "/usr/local/lib/python2.7/site-packages/PF/PacketFilter.py", line 532, in _get_rules
     ioctl(dev, DIOCGETRULES, pr.asBuffer())
 IOError: [Errno 13] Permission denied
 
