From a6bf2495f6738c6a06028678e652f271bca8fc47 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Fri, 16 Dec 2011 22:43:04 -0200 Subject: [PATCH] compatibility: match commands using fnmatch() instead of strcmp(). 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index cb0ec3dc..6a64750b 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -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); -- 2.47.2