kmod/tools
Yauheni Kaliuta bb83f6ac68 depmod: module_is_higher_priority: fix modname length calculation
depmod_module_is_higher_priority checks module's path if it is under
module root directory and if so uses relative to the root path to
lookup the module in override and search lists.

Originally only relative path was used in the function, so the
variables with full path and and path length were changed:

       newpath += cfg->dirnamelen + 1;
       newlen -= cfg->dirnamelen + 1;
       oldpath += cfg->dirnamelen + 1;
       oldlen -= cfg->dirnamelen + 1;

Commit 7da6884e73 (depmod: implement
external directories support) changed the logic since it need the
full path to the module for comparations as well.

Unfortunately, it introduce a mistake in calculation of the relative
paths replacing '-=' with assignment to a new variable -- the
'cfg->dirnamelen + 1' value must be substracted all together. It
breaks, for example, overrides lookup.

Fix the calculation by putting braces around the value in the
subsctuction expression.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
2017-12-07 13:08:23 -08:00
..
.gitignore tools: Use test/kmod instead of kmod-nolib 2013-07-02 21:15:54 -03:00
COPYING Clarify what licences apply where 2014-10-09 01:26:34 -03:00
Makefile build-sys: add small redirecting Makefiles 2014-03-06 01:59:58 -03:00
depmod.c depmod: module_is_higher_priority: fix modname length calculation 2017-12-07 13:08:23 -08:00
insert.c tools: add basic versions of insert and remove 2015-03-07 12:09:51 -03:00
insmod.c insmod: fix wron fallthrough of -f 2015-11-20 19:26:33 -02:00
kmod.c tools: display features in --version 2015-06-08 22:38:02 -03:00
kmod.h tools: add basic versions of insert and remove 2015-03-07 12:09:51 -03:00
log.c Change default log level 2015-09-30 15:17:01 -03:00
log.h Add format attribute and fix issues 2013-04-21 16:17:12 -03:00
lsmod.c Fix spurious spaces in lsmod output 2015-04-16 08:46:43 -03:00
modinfo.c tools: display features in --version 2015-06-08 22:38:02 -03:00
modprobe.c modprobe: Update error message when path is missing 2015-09-30 15:16:59 -03:00
remove.c tools: add basic versions of insert and remove 2015-03-07 12:09:51 -03:00
rmmod.c tools: display features in --version 2015-06-08 22:38:02 -03:00
static-nodes.c static-nodes: indicate that creation of static nodes should only happen at boot 2014-10-28 16:49:46 -02:00