Comment 1 for bug 812516

Jamie Strandboge (jdstrand) wrote :

This is the failing line in src/util.py:
for j in os.listdir(fd_path):

It dies with:
Traceback (most recent call last):
  File "./tmp/ufw/usr/sbin/ufw", line 111, in <module>
    res = ui.do_action(pr.action, "", "", pr.force)
  File "/home/jamie/ubuntu/sbuild/ufw/oneiric/test3/ufw-0.30.1/tmp/ufw/lib/python/ufw/frontend.py", line 587, in do_action
    res = self.get_show_listening()
  File "/home/jamie/ubuntu/sbuild/ufw/oneiric/test3/ufw-0.30.1/tmp/ufw/lib/python/ufw/frontend.py", line 271, in get_show_listening
    d = ufw.util.parse_netstat_output(self.backend.use_ipv6())
  File "/home/jamie/ubuntu/sbuild/ufw/oneiric/test3/ufw-0.30.1/tmp/ufw/lib/python/ufw/util.py", line 657, in parse_netstat_output
    netstat_output = get_netstat_output(v6)
  File "/home/jamie/ubuntu/sbuild/ufw/oneiric/test3/ufw-0.30.1/tmp/ufw/lib/python/ufw/util.py", line 875, in get_netstat_output
    inodes = _get_proc_inodes()
  File "/home/jamie/ubuntu/sbuild/ufw/oneiric/test3/ufw-0.30.1/tmp/ufw/lib/python/ufw/util.py", line 786, in _get_proc_inodes
    for j in os.listdir(fd_path):
OSError: [Errno 13] Permission denied: '/proc/1/fd'

Simply wrapping that in a 'try' in enough to fix the bug. I'm guessing this is a result of the following in fakeroot:
fakeroot (1.16-1) unstable; urgency=low

  * Patch from Jonathan Nieder to add access() support.
    closes: #629956.