]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
compatibility: match commands using fnmatch() instead of strcmp().
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Sat, 17 Dec 2011 00:43:04 +0000 (22:43 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 17 Dec 2011 22:03:44 +0000 (20:03 -0200)
module-init-tools modprobe.c use fnmatch() and not strcmp() to match
commands and softdeps, although the man page does not say so. Then use
the same function to provide compatibility.

libkmod/libkmod-module.c

index cb0ec3dc6a7778c4f443ac3446b3b11db37a3809..6a64750bade83aeab963be6a9540c6c4b860a3d8 100644 (file)
@@ -835,7 +835,7 @@ KMOD_EXPORT const char *kmod_module_get_install_commands(const struct kmod_modul
                kmod_list_foreach(l, ctx_install_commands) {
                        const char *modname = kmod_command_get_modname(l);
 
-                       if (strcmp(modname, mod->name) != 0)
+                       if (fnmatch(modname, mod->name, 0) != 0)
                                continue;
 
                        m->install_commands = kmod_command_get_command(l);
@@ -993,7 +993,7 @@ KMOD_EXPORT const char *kmod_module_get_remove_commands(const struct kmod_module
                kmod_list_foreach(l, ctx_remove_commands) {
                        const char *modname = kmod_command_get_modname(l);
 
-                       if (strcmp(modname, mod->name) != 0)
+                       if (fnmatch(modname, mod->name, 0) != 0)
                                continue;
 
                        m->remove_commands = kmod_command_get_command(l);