]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
insmod: do support -f
authorPhilippe De Swert <philippe.deswert@jollamobile.com>
Wed, 7 Oct 2015 15:36:58 +0000 (18:36 +0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Sun, 25 Oct 2015 15:57:17 +0000 (13:57 -0200)
The -f switch is accepted by insmod, but silently ignored. This
causes the user to wonder why things don't work. As insmod is
most often used with "evil" modules, -f is almost default and
thus needs to work.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
tools/insmod.c

index 8e72e11ffe78b7edf87ef005211a6e1b2801437e..045fd2c320497e3497c5b61ab7bc6f4e9dcde83f 100644 (file)
@@ -71,6 +71,7 @@ static int do_insmod(int argc, char *argv[])
        size_t optslen = 0;
        int i, err;
        const char *null_config = NULL;
+       unsigned int flags = 0;
 
        for (;;) {
                int c, idx = 0;
@@ -81,7 +82,8 @@ static int do_insmod(int argc, char *argv[])
                case 'p':
                case 's':
                case 'f':
-                       /* ignored, for compatibility only */
+                       flags |= KMOD_PROBE_FORCE_MODVERSION;
+                       flags |= KMOD_PROBE_FORCE_VERMAGIC;
                        break;
                case 'h':
                        help();
@@ -142,7 +144,7 @@ static int do_insmod(int argc, char *argv[])
                goto end;
        }
 
-       err = kmod_module_insert_module(mod, 0, opts);
+       err = kmod_module_insert_module(mod, flags, opts);
        if (err < 0) {
                ERR("could not insert module %s: %s\n", filename,
                    mod_strerror(-err));