Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#22016 - [namcap] Cannot process the udev package

Attached to Project: Arch Linux
Opened by Dan McGee (toofishes) - Tuesday, 07 December 2010, 23:14 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Wednesday, 23 February 2011, 23:16 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Rémy Oudompheng (remyoudompheng)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Don't know why I didn't know this before, saving for posterity:

$ namcap /var/cache/pacman/pkg/udev-164-2-x86_64.pkg.tar.xz
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/site-packages/namcap.py", line 237, in <module>
process_realpackage(package, active_modules)
File "/usr/lib/python2.7/site-packages/namcap.py", line 118, in process_realpackage
pkgtar.extract(j, sandbox_directory)
File "/usr/lib/python2.7/tarfile.py", line 2083, in extract
self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
File "/usr/lib/python2.7/tarfile.py", line 2165, in _extract_member
self.makedev(tarinfo, targetpath)
File "/usr/lib/python2.7/tarfile.py", line 2232, in makedev
os.makedev(tarinfo.devmajor, tarinfo.devminor))
OSError: [Errno 1] Operation not permitted
This task depends upon

Closed by  Rémy Oudompheng (remyoudompheng)
Wednesday, 23 February 2011, 23:16 GMT
Reason for closing:  Fixed
Additional comments about closing:  The problem was worked around and fakeroot is no longer needed.
Comment by Stéphane Gaudreault (stephane) - Wednesday, 08 December 2010, 11:34 GMT
Confirm problem on x86_64 and i686.
Looks like a problem with the udev tarball.
Comment by Stéphane Gaudreault (stephane) - Wednesday, 08 December 2010, 12:03 GMT
Maybe it is not a problem with the tarball. Running namcap as root works. Some files (device nodes ?) have restrictive read permissions :

crw------- root/root 108,0 2010-12-08 06:55 lib/udev/devices/ppp
crw-rw-rw- root/root 10,229 2010-12-08 06:55 lib/udev/devices/fuse
crw-rw-rw- root/root 1,11 2010-12-08 06:55 lib/udev/devices/kmsg
crw-rw---- root/root 1,5 2010-12-08 06:55 lib/udev/devices/zero
crw-rw-rw- root/root 1,3 2010-12-08 06:55 lib/udev/devices/null
crw------- root/root 5,1 2010-12-08 06:55 lib/udev/devices/console
crw-rw-rw- root/root 10,200 2010-12-08 06:55 lib/udev/devices/net/tun

namcap should probably ask to be rerun as root instead of "crashing".
Comment by Dan McGee (toofishes) - Wednesday, 08 December 2010, 15:10 GMT
I know 100% what the problem is here, udev is not broken whatsoever. You don't need to concern yourself with it unless you are going to fix namcap to be smarter about extracting device nodes. :)

And no, running as root is a terrible idea, that is not a fix, thus the reason I filed this report for future reference.
Comment by Rémy Oudompheng (remyoudompheng) - Saturday, 22 January 2011, 16:30 GMT
namcap should be run under fakeroot when analyzing tarballs containing device files.

% fakeroot namcap /var/cache/pacman/pkg/udev-165-1-x86_64.pkg.tar.xz
udev W: Dependency included but already satisfied ('glibc')
udev W: Dependency included and not needed ('coreutils')
udev W: Dependency included and not needed ('util-linux')
udev W: Dependency included and not needed ('module-init-tools')
udev W: Dependency included and not needed ('pciutils')
udev E: File (lib/udev/devices/loop0) has root/disk permissions
udev W: File (lib/udev/devices/null) has the world writable bit set.
udev W: File (lib/udev/devices/fuse) has the world writable bit set.
udev W: File (lib/udev/devices/zero) does not have the world readable bit set.
udev W: File (lib/udev/devices/kmsg) has the world writable bit set.
udev W: File (lib/udev/devices/ppp) does not have the world readable bit set.
udev W: File (lib/udev/devices/console) does not have the world readable bit set.
udev W: File (lib/udev/devices/loop0) does not have the world readable bit set.
udev W: File (lib/udev/devices/net/tun) has the world writable bit set.
udev E: Symlink (lib/udev/devices/fd) points to non-existing /proc/self/fd
udev E: Symlink (lib/udev/devices/stdin) points to non-existing /proc/self/fd/0
udev E: Symlink (lib/udev/devices/stderr) points to non-existing /proc/self/fd/2
udev E: Symlink (lib/udev/devices/stdout) points to non-existing /proc/self/fd/1
udev E: Symlink (lib/udev/devices/core) points to non-existing /proc/kcore
Comment by Stéphane Gaudreault (stephane) - Sunday, 23 January 2011, 16:59 GMT
Is there a situation where we do not want to use fakeroot ? The attached patch fixed this issue for me.
Comment by Rémy Oudompheng (remyoudompheng) - Sunday, 23 January 2011, 17:49 GMT
I'd vote for this patch: namcap needs the same permissions as the package() function so it should be run under fakeroot.
Comment by Dan McGee (toofishes) - Sunday, 23 January 2011, 18:31 GMT
Don't use a full path to fakeroot (env is just an odd exception in this regard), and I'd also add a test to make sure fakeroot exists- if it doesn't, run it w/o fakeroot.
Comment by Kyle Keen (keenerd) - Saturday, 19 February 2011, 06:23 GMT
Updated with requested changes.
Comment by Rémy Oudompheng (remyoudompheng) - Saturday, 19 February 2011, 08:54 GMT
The current development version of pacman extracts files only when needed (for the moment only ELF files and scripts in the depends rule). It makes the issue we are discussing disappear.

Loading...