aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>1998-04-01 11:15:47 +0000
committerH. Peter Anvin <hpa@zytor.com>1998-04-01 11:15:47 +0000
commitb71338e3f424c1b37af3c2695810da9557043a4a (patch)
treea759f66314d18a3484f0d503f2c09c98787abf6e
parent17fa2145a79fe7e49f2f7d78dee8a7f28eaee861 (diff)
downloadautofs3-b71338e3f424c1b37af3c2695810da9557043a4a.tar.gz
autofs3-b71338e3f424c1b37af3c2695810da9557043a4a.tar.xz
autofs3-b71338e3f424c1b37af3c2695810da9557043a4a.zip
Add "-s" (sloppy) option to mount if it is supported.
-rw-r--r--NEWS2
-rw-r--r--README.options16
-rw-r--r--aclocal.m416
-rw-r--r--configure.in12
-rw-r--r--include/automount.h10
-rw-r--r--include/config.h.in3
-rw-r--r--modules/mount_ext2.c5
-rw-r--r--modules/mount_generic.c5
-rw-r--r--modules/mount_nfs.c4
9 files changed, 57 insertions, 16 deletions
diff --git a/NEWS b/NEWS
index 7e01e83..e8edb9b 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Since autofs-0.3.14:
* Recursive autofs mounts support by Richard Henderson. For
unmounting to work, kernel 2.1.92 or later is required.
* Automatic configuration of compile options using "configure".
+* If mount(8) supports the "-s" (sloppy) option, pass it. Have
+ "configure" test to see if it does or not.
Since autofs-0.3.13:
--------------------
diff --git a/README.options b/README.options
index 517587d..189c18b 100644
--- a/README.options
+++ b/README.options
@@ -31,18 +31,22 @@ Location of system binaries
The autofs daemon uses several system utilities, including mount,
umount, e2fsck and smbmount to do its job. "configure" will search
-for these binaries in the PATH and compile in the paths into the
-daemon and modules as needed.
+for these binaries and compile in the paths into the daemon and
+modules as needed.
-Sometimes the PATH of the compiling user isn't appropriate for this
-task, i.e. it contains binaries that shouldn't be used, or it doesn't
-contain all the needed binaries. If so, specify the
+By default it searches the following directories, in order:
+
+ /usr/bin:/bin:/usr/sbin:/sbin
+
+Sometimes this search path isn't appropriate; i.e. it contains
+binaries that shouldn't be used, or it doesn't contain all the needed
+binaries. If so, specify the
--with-path=<PATH>
option, for example:
- ./configure --with-path=/usr/bin:/bin:/usr/sbin:/sbin
+ ./configure --with-path=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Hesiod support
diff --git a/aclocal.m4 b/aclocal.m4
index c50de12..5e4e73c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -15,3 +15,19 @@ else
HAVE_$1=0
fi
AC_SUBST(HAVE_$1)])
+
+dnl --------------------------------------------------------------------------
+dnl AF_SLOPPY_MOUNT
+dnl
+dnl Check to see if mount(8) supports the sloppy (-s) option, and define
+dnl the cpp variable HAVE_SLOPPY_MOUNT if so. This requires that MOUNT is
+dnl already defined by a call to AF_PATH_INCLUDE or AC_PATH_PROGS.
+dnl --------------------------------------------------------------------------
+AC_DEFUN(AF_SLOPPY_MOUNT,
+[AC_MSG_CHECKING([if mount accepts the -s option])
+if "$MOUNT" -s > /dev/null 2>&1 ; then
+ AC_DEFINE(HAVE_SLOPPY_MOUNT)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi])
diff --git a/configure.in b/configure.in
index ab48130..175b783 100644
--- a/configure.in
+++ b/configure.in
@@ -17,7 +17,7 @@ AC_PREFIX_DEFAULT(/usr)
#
# The user can specify --with-path=PATH rather than relying on the default
#
-searchpath="${PATH}:/bin:/usr/bin:/sbin:/usr/sbin"
+searchpath="/usr/bin:/bin:/usr/sbin:/sbin"
AC_ARG_WITH(path,
--with-path=PATH look in PATH for binaries needed by the automounter,
if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
@@ -27,7 +27,9 @@ AC_ARG_WITH(path,
searchpath="${withval}"
fi
)
-echo "checking for binaries in... ${searchpath}"
+
+AC_MSG_CHECKING([for binaries in])
+AC_MSG_RESULT([$searchpath])
#
# Programs needed for various system functions or modules
@@ -39,6 +41,12 @@ AF_PATH_INCLUDE(SMBMOUNT, smbmount, , $searchpath)
AC_SUBST(HAVE_SMBMOUNT)
#
+# Newer mounts have the -s (sloppy) option to ignore unknown options,
+# good for portability
+#
+AF_SLOPPY_MOUNT()
+
+#
# glibc/libc 6 new libraries
#
AC_CHECK_LIB(nsl, yp_match, LIBNSL="-lnsl")
diff --git a/include/automount.h b/include/automount.h
index d3899ef..ca8c6e7 100644
--- a/include/automount.h
+++ b/include/automount.h
@@ -21,6 +21,16 @@
#error Failed to locate umount(8)!
#endif
+/* The -s (sloppy) option to mount is good, if we have it... */
+
+#ifdef HAVE_SLOPPY_MOUNT
+#define SLOPPYOPT "-s", /* For use in spawnl() lists */
+#define SLOPPY "-s " /* For use in strings */
+#else
+#define SLOPPYOPT
+#define SLOPPY
+#endif
+
/* Standard function used by daemon or modules */
int spawnl(int logpri, const char *prog, ...);
diff --git a/include/config.h.in b/include/config.h.in
index 70ce165..b65d6e7 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -17,3 +17,6 @@
#undef HAVE_E2FSCK
#undef PATH_E2FSCK
+/* Define this option if mount(8) supports the -s (sloppy) option */
+#undef HAVE_SLOPPY_MOUNT
+
diff --git a/modules/mount_ext2.c b/modules/mount_ext2.c
index 7b4e643..ec314d8 100644
--- a/modules/mount_ext2.c
+++ b/modules/mount_ext2.c
@@ -31,7 +31,6 @@
#define MODPREFIX "mount(ext2): "
int mount_version = AUTOFS_MOUNT_VERSION; /* Required by protocol */
-
int mount_init(void **context)
{
return 0;
@@ -66,10 +65,10 @@ int mount_mount(const char *root, const char *name, int name_len,
}
if ( options ) {
- syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s -o %s %s %s",
+ syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
fstype, options, what, fullpath);
err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", fstype,
- "-o", options, what, fullpath, NULL);
+ SLOPPYOPT "-o", options, what, fullpath, NULL);
} else {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s %s %s",
fstype, what, fullpath);
diff --git a/modules/mount_generic.c b/modules/mount_generic.c
index 8b7ce41..e0110d3 100644
--- a/modules/mount_generic.c
+++ b/modules/mount_generic.c
@@ -31,7 +31,6 @@
#define MODPREFIX "mount(generic): "
int mount_version = AUTOFS_MOUNT_VERSION; /* Required by protocol */
-
int mount_init(void **context)
{
return 0;
@@ -58,10 +57,10 @@ int mount_mount(const char *root, const char *name, int name_len,
}
if ( options ) {
- syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s -o %s %s %s",
+ syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
fstype, options, what, fullpath);
err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", fstype,
- "-o", options, what, fullpath, NULL);
+ SLOPPYOPT "-o", options, what, fullpath, NULL);
} else {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s %s %s",
fstype, what, fullpath);
diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
index a556841..a932171 100644
--- a/modules/mount_nfs.c
+++ b/modules/mount_nfs.c
@@ -145,10 +145,10 @@ int mount_mount(const char *root, const char *name, int name_len,
}
if ( options ) {
- syslog(LOG_DEBUG, MODPREFIX "calling mount -t nfs -o %s %s %s",
+ syslog(LOG_DEBUG, MODPREFIX "calling mount -t nfs " SLOPPY "-o %s %s %s",
options, what, fullpath);
err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", "nfs", "-o",
- options, what, fullpath, NULL);
+ SLOPPYOPT options, what, fullpath, NULL);
} else {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t nfs %s %s", what, fullpath);
err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", "nfs",