On Wed, Jan 14, 2015 at 06:58:09PM +0100, Denys Vlasenko wrote:
> On Sun, Jan 11, 2015 at 10:02 PM, Isaac Dunham <[email protected]> wrote:
> > On Sun, Jan 11, 2015 at 05:39:19PM +0100, Denys Vlasenko wrote:
> >> On Sun, Jan 11, 2015 at 7:23 AM, Isaac Dunham <[email protected]> wrote:
> >> > filename2modname needs to do dir-stripping,
> >>
> >> Well, it was doing that.
> >>
> >> Which lead to "modprobe dir/dir/dir/file"
> >> work as if it was "modprobe file", and bug reports
> >> from users.
> >
> >
> >> So it was removed. Simply reinstating it would make
> >> _that_ bug to reappear.
> >>
> >> Looks like we need dir-stripping somewhere else,
> >> in a less generic code path.
> > No, I participated the thread on alpine-devel where the bug was found,
> > and have tested.
> >
> > The bug was that (for example)
> > modprobe dmi:1:svnMICRO_STARINTERNATIONAL1:pnU90/U100:1
> > died with
> > modprobe: malformed module name
> > 'dmi:1:svnMICRO_STARINTERNATIONAL1:pnU90/U100:1'
> > thanks to a little bit of code that checked whether a '/' was present
> > (before looking up the alias).
> > It did not get converted to 'U100:1'
> >
> > This becomes a real problem when
> > modprobe -a <list of modaliases>
> > is used in the init scripts, as no modules will be loaded.
> >
> > Additionally, if you check for filename2modname(), it is used many times
> > in full modutils but only once in modprobe-small.c in the
> > if (is_rmmod) block.
> > filename2modname() is only generic in modprobe.c, not modprobe-small.c--
> > and this bug only affects modprobe-small.
>
>
> I'm confused now.
>
> Is there a problem with current git? If yes, what exactly is not working?
There is no problem with modprobe-small and current git (as of Jan 14);
the following tests work:
./busybox modprobe usblp; ./busybox modprobe -r usblp
./busybox modprobe usblp; ./busybox rmmod usblp
./busybox modprobe dmi:1:svnMICRO_STARINTERNATIONAL1:pnU90/U100:1
./busybox modprobe -r dmi:1:svnMICRO_STARINTERNATIONAL1:pnU90/U100:1
However, I will mention this:
~/busybox$ grep -A 1 filename2modname modutils/modprobe-small.c
static char *filename2modname(const char *filename, char *modname)
{
--
filename2modname(bb_get_last_path_component_nostrip(pathname), name);
r = (strcmp(name, modname) == 0);
--
filename2modname(
bb_get_last_path_component_nostrip(info->pathname), modname);
These are all the occurences in modprobe-small, so calling
bb_get_last_path_component_nostrip() in filename2modname() makes sense
for modprobe-small.
I haven't tested full modutils yet.
HTH,
Isaac Dunham
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox