* [PATCH] avoid calling mount during configure
@ 2013-04-21 9:12 Martin von Gagern
2013-04-21 9:53 ` Michael Tokarev
0 siblings, 1 reply; 4+ messages in thread
From: Martin von Gagern @ 2013-04-21 9:12 UTC (permalink / raw)
To: autofs
[-- Attachment #1: Type: text/plain, Size: 742 bytes --]
Hi!
The configure script unconditionally calls "mount -s" in an attempt to
figure out whether the command supports that option or not. This can
cause trouble in cases where the configure script is executed in some
kind of restricted environment, e.g. a sandbox or small chroot. For
these cases, it would be nice to have a way to avoid that
auto-detection, and instead specify explicitely whether or not the mount
command can be expected to support the -s option.
The attached patch does just that. I wrote it for Gentoo, but in such a
way that it should maintain current behaviour as the default, and allow
overriding in both directions. I would welcome inclusion of this option
into future builds of autofs.
Greetings,
Martin von Gagern
[-- Attachment #2: gentoo453778a.patch --]
[-- Type: text/x-patch, Size: 1565 bytes --]
Add an option --enable-sloppy-mount or --disable-sloppy-mount to force
or prevent the use of the -s option to mount, thus avoiding the
autodetection. This can be useful in setups where executing mount
might be undesirable, particularly in packaging environments.
2013-04-04 Martin von Gagern
References:
* https://bugs.gentoo.org/453778
Index: autofs-5.0.7/aclocal.m4
===================================================================
--- autofs-5.0.7.orig/aclocal.m4
+++ autofs-5.0.7/aclocal.m4
@@ -66,7 +66,7 @@ AC_DEFUN(AF_SLOPPY_MOUNT,
[if test -n "$MOUNT" ; then
AC_MSG_CHECKING([if mount accepts the -s option])
if "$MOUNT" -s > /dev/null 2>&1 ; then
- AC_DEFINE(HAVE_SLOPPY_MOUNT, 1, [define if the mount command supports the -s option])
+ enable_sloppy_mount=yes
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
Index: autofs-5.0.7/configure.in
===================================================================
--- autofs-5.0.7.orig/configure.in
+++ autofs-5.0.7/configure.in
@@ -157,7 +157,15 @@ AC_SUBST(sssldir)
# Newer mounts have the -s (sloppy) option to ignore unknown options,
# good for portability
#
-AF_SLOPPY_MOUNT()
+AC_ARG_ENABLE(sloppy-mount,
+[ --enable-sloppy-mount enable the use of the -s option to mount],,
+ enable_sloppy_mount=auto)
+if test x$enable_sloppy_mount = xauto; then
+ AF_SLOPPY_MOUNT()
+fi
+if test x$enable_sloppy_mount = xyes; then
+ AC_DEFINE(HAVE_SLOPPY_MOUNT, 1, [define if the mount command supports the -s option])
+fi
# LDAP SASL auth needs libxml and Kerberos
AF_CHECK_LIBXML()
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] avoid calling mount during configure
2013-04-21 9:12 [PATCH] avoid calling mount during configure Martin von Gagern
@ 2013-04-21 9:53 ` Michael Tokarev
2013-04-21 18:29 ` Martin von Gagern
2013-04-22 1:10 ` Ian Kent
0 siblings, 2 replies; 4+ messages in thread
From: Michael Tokarev @ 2013-04-21 9:53 UTC (permalink / raw)
To: Martin von Gagern; +Cc: autofs
21.04.2013 13:12, Martin von Gagern wrote:
> Hi!
>
> The configure script unconditionally calls "mount -s" in an attempt to
> figure out whether the command supports that option or not. This can
The support for old mount command, together with pre-2.2-something kernel,
should be just dropped from automount, together with all these configure
checks, instead of inventing even more workarounds. In my opinion anyway.
/mjt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] avoid calling mount during configure
2013-04-21 9:53 ` Michael Tokarev
@ 2013-04-21 18:29 ` Martin von Gagern
2013-04-22 1:10 ` Ian Kent
1 sibling, 0 replies; 4+ messages in thread
From: Martin von Gagern @ 2013-04-21 18:29 UTC (permalink / raw)
To: autofs; +Cc: Michael Tokarev
[-- Attachment #1: Type: text/plain, Size: 767 bytes --]
On 21.04.2013 11:53, Michael Tokarev wrote:
> 21.04.2013 13:12, Martin von Gagern wrote:
>> The configure script unconditionally calls "mount -s" in an attempt to
>> figure out whether the command supports that option or not. This can
>
> The support for old mount command, together with pre-2.2-something kernel,
> should be just dropped from automount, together with all these configure
> checks, instead of inventing even more workarounds. In my opinion anyway.
I hadn't been aware that the -s option has been around for as long as it
apparently has. Dropping old legacy is fine by me, as long as there is a
way to avoid running mount. Do you need a patch for that approach as
well, or can I leave that to the maintainers?
Greetings,
Martin
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] avoid calling mount during configure
2013-04-21 9:53 ` Michael Tokarev
2013-04-21 18:29 ` Martin von Gagern
@ 2013-04-22 1:10 ` Ian Kent
1 sibling, 0 replies; 4+ messages in thread
From: Ian Kent @ 2013-04-22 1:10 UTC (permalink / raw)
To: Michael Tokarev; +Cc: Martin von Gagern, autofs
On Sun, 2013-04-21 at 13:53 +0400, Michael Tokarev wrote:
> 21.04.2013 13:12, Martin von Gagern wrote:
> > Hi!
> >
> > The configure script unconditionally calls "mount -s" in an attempt to
> > figure out whether the command supports that option or not. This can
>
> The support for old mount command, together with pre-2.2-something kernel,
> should be just dropped from automount, together with all these configure
> checks, instead of inventing even more workarounds. In my opinion anyway.
That may be old but every time the sloppy option hasn't worked properly
in mount(8) I get hit with problems.
So I'm not going to drop it.
Ian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-22 1:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-21 9:12 [PATCH] avoid calling mount during configure Martin von Gagern
2013-04-21 9:53 ` Michael Tokarev
2013-04-21 18:29 ` Martin von Gagern
2013-04-22 1:10 ` Ian Kent
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.