autofs-5.1.4 - remove autofs4 module load code From: Ian Kent The autofs kernel module has finally been renamed from autofs4 to autofs so autoloading works so there is no need for manual loading. The module load function has been commented out in the source for a long time so there should not be any adverse affects from removing it. Signed-off-by: Ian Kent --- CHANGELOG | 1 + configure | 61 --------------------------------------------------- configure.in | 1 - daemon/automount.c | 8 ------- daemon/module.c | 35 ----------------------------- include/automount.h | 7 ------ include/config.h.in | 6 ----- 7 files changed, 1 insertion(+), 118 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1a9296f5..0a56df5a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -42,6 +42,7 @@ xx/xx/2018 autofs-5.1.5 - fix possible NULL pointer dereference in get_defaults_entry(). - better handle hesiod support not built in. - fix indent in automount(8) man page. +- remove autofs4 module load code. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/configure b/configure index 827921ba..2116668a 100755 --- a/configure +++ b/configure @@ -659,8 +659,6 @@ PATH_YACC YACC PATH_LEX LEX -HAVE_MODPROBE -MODPROBE HAVE_E4FSCK E4FSCK HAVE_E3FSCK @@ -4155,65 +4153,6 @@ else HAVE_E4FSCK=0 fi -for ac_prog in modprobe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MODPROBE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MODPROBE in - [\\/]* | ?:[\\/]*) - ac_cv_path_MODPROBE="$MODPROBE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $searchpath -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MODPROBE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -MODPROBE=$ac_cv_path_MODPROBE -if test -n "$MODPROBE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MODPROBE" >&5 -$as_echo "$MODPROBE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MODPROBE" && break -done - -if test -n "$MODPROBE"; then - -$as_echo "#define HAVE_MODPROBE 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define PATH_MODPROBE "$MODPROBE" -_ACEOF - - HAVE_MODPROBE=1 -else - HAVE_MODPROBE=0 -fi - for ac_prog in flex lex do diff --git a/configure.in b/configure.in index 4b0a81f2..dbee99f4 100644 --- a/configure.in +++ b/configure.in @@ -161,7 +161,6 @@ AF_PATH_INCLUDE(UMOUNT, umount, /bin/umount, $searchpath) AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath) AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath) AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath) -AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath) AF_CHECK_PROG(LEX, flex lex, , $searchpath) AF_CHECK_PROG(YACC, bison, , $searchpath) diff --git a/daemon/automount.c b/daemon/automount.c index 05ec8a62..2c0def54 100644 --- a/daemon/automount.c +++ b/daemon/automount.c @@ -2336,14 +2336,6 @@ int main(int argc, char *argv[]) exit(exit_code); } -#if 0 - if (!load_autofs4_module()) { - fprintf(stderr, "%s: can't load %s filesystem module.\n", - program, FS_MODULE_NAME); - exit(1); - } -#endif - /* Don't need the kernel module just to look at the configured maps */ if (!dumpmaps && (!query_kproto_ver() || get_kver_major() < 5)) { fprintf(stderr, diff --git a/daemon/module.c b/daemon/module.c index b1a94f56..be96a82b 100644 --- a/daemon/module.c +++ b/daemon/module.c @@ -19,41 +19,6 @@ #include "automount.h" #include "nsswitch.h" -int load_autofs4_module(void) -{ - FILE *fp; - char buf[PATH_MAX]; - int ret; - - /* - * Check if module already loaded or compiled in. - * If both autofs v3 and v4 are coplied in and - * the v3 module registers first or the v4 module - * is an older version we will catch it at mount - * time. - */ - fp = open_fopen_r("/proc/filesystems"); - if (!fp) { - logerr("cannot open /proc/filesystems"); - return 0; - } - - while (fgets(buf, sizeof(buf), fp)) { - if (strstr(buf, "autofs")) { - fclose(fp); - return 1; - } - } - fclose(fp); - - ret = spawnl(LOGOPT_NONE, PATH_MODPROBE, PATH_MODPROBE, - "-q", FS_MODULE_NAME, NULL); - if (ret) - return 0; - - return 1; -} - int open_lookup(const char *name, const char *err_prefix, const char *mapfmt, int argc, const char *const *argv, struct lookup_mod **lookup) { diff --git a/include/automount.h b/include/automount.h index 417dacbb..eccd16aa 100644 --- a/include/automount.h +++ b/include/automount.h @@ -52,17 +52,10 @@ #error Failed to locate umount(8)! #endif -#ifndef HAVE_MODPROBE -#error Failed to locate modprobe(8)! -#endif - #ifndef HAVE_LINUX_PROCFS #error Failed to verify existence of procfs filesystem! #endif -#define FS_MODULE_NAME "autofs4" -int load_autofs4_module(void); - /* The -s (sloppy) option to mount is good, if we have it... */ #ifdef HAVE_SLOPPY_MOUNT diff --git a/include/config.h.in b/include/config.h.in index 991a2bda..a4879494 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -48,9 +48,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* define if you have MODPROBE */ -#undef HAVE_MODPROBE - /* define if you have MOUNT */ #undef HAVE_MOUNT @@ -129,9 +126,6 @@ /* define if you have LEX */ #undef PATH_LEX -/* define if you have MODPROBE */ -#undef PATH_MODPROBE - /* define if you have MOUNT */ #undef PATH_MOUNT