modinfo: Fix failure with inaccessible current dir
commit43204cb0bb13f6e81976cfb43dc0cfeb66a1e247
authorAlan Jenkins <alan@alan-eeepc.jenkins>
Fri, 20 Feb 2009 13:50:56 +0000 (20 13:50 +0000)
committerAlan Jenkins <alan@alan-eeepc.jenkins>
Fri, 20 Feb 2009 13:50:56 +0000 (20 13:50 +0000)
treec6a25438e4d316ba1dc424f75dc0199b67f28fce
parent8ee828694ad8fd62e7f1706e754513a20c517d37
modinfo: Fix failure with inaccessible current dir

kerneltools bugzilla #6
<https://bugs.launchpad.net/module-init-tools/+bug/227198>

Originally report refers to "sudo modinfo fglrx"
on an NFS mount with root_sqaush.  To reproduce:

$ mkdir /tmp/noaccess
$ cd /tmp/noaccess
$ chmod a-x /tmp/noaccess
$ /sbin/modinfo fglrx
$ modinfo: could not open fglrx: Permission denied

As suggested by Martin Pitt on Launchpad, the fix
is to distinguish better between module names and
filenames.  If it contains "." or "/", it must be
a filename.  Otherwise, assume it is a module name.
Users can still do "modinfo ./fglrx" if thats what
they really want.

Signed-off-by: Alan Jenkins <alan@alan-eeepc.jenkins>
modinfo.c