mirror of
https://github.com/sheumann/hush.git
synced 2024-10-29 20:27:40 +00:00
modprobe: add scanning of /lib/modules/uname -r
/modules.symbols
(by Yann E. MORIN)
This commit is contained in:
parent
a0319ba936
commit
f848305afc
@ -504,7 +504,7 @@ static struct dep_t *build_dep(void)
|
|||||||
|
|
||||||
/* Only 2.6 has a modules.alias file */
|
/* Only 2.6 has a modules.alias file */
|
||||||
if (ENABLE_FEATURE_2_6_MODULES) {
|
if (ENABLE_FEATURE_2_6_MODULES) {
|
||||||
/* Parse kernel-declared aliases */
|
/* Parse kernel-declared module aliases */
|
||||||
filename = xasprintf("/lib/modules/%s/modules.alias", un.release);
|
filename = xasprintf("/lib/modules/%s/modules.alias", un.release);
|
||||||
fd = open(filename, O_RDONLY);
|
fd = open(filename, O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
@ -518,6 +518,21 @@ static struct dep_t *build_dep(void)
|
|||||||
include_conf(&first, ¤t, buffer, sizeof(buffer), fd);
|
include_conf(&first, ¤t, buffer, sizeof(buffer), fd);
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Parse kernel-declared symbol aliases */
|
||||||
|
filename = xasprintf("/lib/modules/%s/modules.symbols", un.release);
|
||||||
|
fd = open(filename, O_RDONLY);
|
||||||
|
if (fd < 0) {
|
||||||
|
/* Ok, that didn't work. Fall back to looking in /lib/modules */
|
||||||
|
fd = open("/lib/modules/modules.symbols", O_RDONLY);
|
||||||
|
}
|
||||||
|
if (ENABLE_FEATURE_CLEAN_UP)
|
||||||
|
free(filename);
|
||||||
|
|
||||||
|
if (fd >= 0) {
|
||||||
|
include_conf(&first, ¤t, buffer, sizeof(buffer), fd);
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return first;
|
return first;
|
||||||
|
Loading…
Reference in New Issue
Block a user