|
Ian Kent |
cc58c1 |
autofs-5.0.6 - remove move mount code and configure option
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
From: Ian Kent <ikent@redhat.com>
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
The code to construct a multi-mount tree in a temporary location and then
|
|
Ian Kent |
cc58c1 |
move it into place is obsolete when using a kernel which includes the
|
|
Ian Kent |
cc58c1 |
vfs-automount infrastructure.
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
It is incompatible with systemd and cannot be used if systemd is being used.
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
So it's being removed.
|
|
Ian Kent |
cc58c1 |
---
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
autofs.spec | 2
|
|
Ian Kent |
cc58c1 |
configure | 18 ----
|
|
Ian Kent |
cc58c1 |
configure.in | 10 --
|
|
Ian Kent |
cc58c1 |
daemon/automount.c | 5 -
|
|
Ian Kent |
cc58c1 |
include/config.h.in | 3
|
|
Ian Kent |
cc58c1 |
modules/parse_sun.c | 195 +---------------------------------------------------
|
|
Ian Kent |
cc58c1 |
6 files changed, 7 insertions(+), 226 deletions(-)
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
--- autofs-5.0.6.orig/autofs.spec
|
|
Ian Kent |
cc58c1 |
+++ autofs-5.0.6/autofs.spec
|
|
Ian Kent |
cc58c1 |
@@ -74,7 +74,7 @@ echo %{version}-%{release} > .version
|
|
Ian Kent |
cc58c1 |
%endif
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
%build
|
|
Ian Kent |
cc58c1 |
-CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc --disable-mount-move %{?systemd_configure_arg:}
|
|
Ian Kent |
cc58c1 |
+CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc %{?systemd_configure_arg:}
|
|
Ian Kent |
cc58c1 |
CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
%install
|
|
Ian Kent |
cc58c1 |
--- autofs-5.0.6.orig/configure
|
|
Ian Kent |
cc58c1 |
+++ autofs-5.0.6/configure
|
|
Ian Kent |
cc58c1 |
@@ -719,7 +719,6 @@ with_openldap
|
|
Ian Kent |
cc58c1 |
with_sasl
|
|
Ian Kent |
cc58c1 |
enable_ext_env
|
|
Ian Kent |
cc58c1 |
enable_mount_locking
|
|
Ian Kent |
cc58c1 |
-enable_mount_move
|
|
Ian Kent |
cc58c1 |
enable_forced_shutdown
|
|
Ian Kent |
cc58c1 |
enable_ignore_busy
|
|
Ian Kent |
cc58c1 |
'
|
|
Ian Kent |
cc58c1 |
@@ -1343,7 +1342,6 @@ Optional Features:
|
|
Ian Kent |
cc58c1 |
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
|
|
Ian Kent |
cc58c1 |
--disable-ext-env disable search in environment for substitution variable
|
|
Ian Kent |
cc58c1 |
--disable-mount-locking disable use of locking when spawning mount command
|
|
Ian Kent |
cc58c1 |
- --disable-mount-move disable use of mount move when when preparing tree of mounts
|
|
Ian Kent |
cc58c1 |
--enable-force-shutdown enable USR1 signal to force unlink umount of any
|
|
Ian Kent |
cc58c1 |
busy mounts during shutdown
|
|
Ian Kent |
cc58c1 |
--enable-ignore-busy enable exit without umounting busy mounts during
|
|
Ian Kent |
cc58c1 |
@@ -5447,22 +5445,6 @@ $as_echo "#define ENABLE_MOUNT_LOCKING 1
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
fi
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#
|
|
Ian Kent |
cc58c1 |
-# Disable use of mount move
|
|
Ian Kent |
cc58c1 |
-#
|
|
Ian Kent |
cc58c1 |
-# Check whether --enable-mount-move was given.
|
|
Ian Kent |
cc58c1 |
-if test "${enable_mount_move+set}" = set; then :
|
|
Ian Kent |
cc58c1 |
- enableval=$enable_mount_move;
|
|
Ian Kent |
cc58c1 |
-else
|
|
Ian Kent |
cc58c1 |
- enableval=yes
|
|
Ian Kent |
cc58c1 |
-fi
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
-if test x$enable_mount_move = xyes -o x$enableval = xyes; then
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
-$as_echo "#define ENABLE_MOUNT_MOVE 1" >>confdefs.h
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
-fi
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
#
|
|
Ian Kent |
cc58c1 |
# Enable forced shutdown on USR1 signal (unlink umounts all mounts).
|
|
Ian Kent |
cc58c1 |
#
|
|
Ian Kent |
cc58c1 |
--- autofs-5.0.6.orig/configure.in
|
|
Ian Kent |
cc58c1 |
+++ autofs-5.0.6/configure.in
|
|
Ian Kent |
cc58c1 |
@@ -338,16 +338,6 @@ if test x$enable_mount_locking = xyes -o
|
|
Ian Kent |
cc58c1 |
fi
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
#
|
|
Ian Kent |
cc58c1 |
-# Disable use of mount move
|
|
Ian Kent |
cc58c1 |
-#
|
|
Ian Kent |
cc58c1 |
-AC_ARG_ENABLE(mount-move,
|
|
Ian Kent |
cc58c1 |
-[ --disable-mount-move disable use of mount move when when preparing tree of mounts],,
|
|
Ian Kent |
cc58c1 |
- enableval=yes)
|
|
Ian Kent |
cc58c1 |
-if test x$enable_mount_move = xyes -o x$enableval = xyes; then
|
|
Ian Kent |
cc58c1 |
- AC_DEFINE(ENABLE_MOUNT_MOVE, 1, [Disable use of mount move when preparing tree of mounts])
|
|
Ian Kent |
cc58c1 |
-fi
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
-#
|
|
Ian Kent |
cc58c1 |
# Enable forced shutdown on USR1 signal (unlink umounts all mounts).
|
|
Ian Kent |
cc58c1 |
#
|
|
Ian Kent |
cc58c1 |
AC_ARG_ENABLE(forced-shutdown,
|
|
Ian Kent |
cc58c1 |
--- autofs-5.0.6.orig/daemon/automount.c
|
|
Ian Kent |
cc58c1 |
+++ autofs-5.0.6/daemon/automount.c
|
|
Ian Kent |
cc58c1 |
@@ -1748,11 +1748,6 @@ static void show_build_info(void)
|
|
Ian Kent |
cc58c1 |
count = 22;
|
|
Ian Kent |
cc58c1 |
#endif
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#ifndef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
- printf("DISABLE_MOUNT_MOVE ");
|
|
Ian Kent |
cc58c1 |
- count = count + 19;
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
#ifdef ENABLE_FORCED_SHUTDOWN
|
|
Ian Kent |
cc58c1 |
printf("ENABLE_FORCED_SHUTDOWN ");
|
|
Ian Kent |
cc58c1 |
count = count + 23;
|
|
Ian Kent |
cc58c1 |
--- autofs-5.0.6.orig/include/config.h.in
|
|
Ian Kent |
cc58c1 |
+++ autofs-5.0.6/include/config.h.in
|
|
Ian Kent |
cc58c1 |
@@ -12,9 +12,6 @@
|
|
Ian Kent |
cc58c1 |
/* Disable use of locking when spawning mount command */
|
|
Ian Kent |
cc58c1 |
#undef ENABLE_MOUNT_LOCKING
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-/* Disable use of mount move when preparing tree of mounts */
|
|
Ian Kent |
cc58c1 |
-#undef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
/* define if you have E2FSCK */
|
|
Ian Kent |
cc58c1 |
#undef HAVE_E2FSCK
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
--- autofs-5.0.6.orig/modules/parse_sun.c
|
|
Ian Kent |
cc58c1 |
+++ autofs-5.0.6/modules/parse_sun.c
|
|
Ian Kent |
cc58c1 |
@@ -37,10 +37,6 @@
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
#define MODPREFIX "parse(sun): "
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#define MOUNT_MOVE_NONE 0x00
|
|
Ian Kent |
cc58c1 |
-#define MOUNT_MOVE_AUTOFS 0x01
|
|
Ian Kent |
cc58c1 |
-#define MOUNT_MOVE_OTHER 0x02
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
int parse_version = AUTOFS_PARSE_VERSION; /* Required by protocol */
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
static struct mount_mod *mount_nfs = NULL;
|
|
Ian Kent |
cc58c1 |
@@ -1047,86 +1043,6 @@ static int parse_mapent(const char *ent,
|
|
Ian Kent |
cc58c1 |
return (p - ent);
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#ifdef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
-static int move_mount(struct autofs_point *ap,
|
|
Ian Kent |
cc58c1 |
- const char *mm_tmp_root, const char *mm_root,
|
|
Ian Kent |
cc58c1 |
- unsigned int move)
|
|
Ian Kent |
cc58c1 |
-{
|
|
Ian Kent |
cc58c1 |
- char buf[MAX_ERR_BUF];
|
|
Ian Kent |
cc58c1 |
- int err;
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- if (move == MOUNT_MOVE_NONE)
|
|
Ian Kent |
cc58c1 |
- return 1;
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- err = mkdir_path(mm_root, 0555);
|
|
Ian Kent |
cc58c1 |
- if (err < 0 && errno != EEXIST) {
|
|
Ian Kent |
cc58c1 |
- error(ap->logopt,
|
|
Ian Kent |
cc58c1 |
- "failed to create move target mount point %s", mm_root);
|
|
Ian Kent |
cc58c1 |
- return 0;
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- if (move == MOUNT_MOVE_AUTOFS)
|
|
Ian Kent |
cc58c1 |
- err = mount(mm_tmp_root, mm_root, NULL, MS_MOVE, NULL);
|
|
Ian Kent |
cc58c1 |
- else
|
|
Ian Kent |
cc58c1 |
- err = spawn_mount(ap->logopt,
|
|
Ian Kent |
cc58c1 |
- "--move", mm_tmp_root, mm_root, NULL);
|
|
Ian Kent |
cc58c1 |
- if (err) {
|
|
Ian Kent |
cc58c1 |
- char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
|
|
Ian Kent |
cc58c1 |
- error(ap->logopt,
|
|
Ian Kent |
cc58c1 |
- "failed to move mount from %s to %s: %s",
|
|
Ian Kent |
cc58c1 |
- mm_tmp_root, mm_root, estr);
|
|
Ian Kent |
cc58c1 |
- return 0;
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- debug(ap->logopt,
|
|
Ian Kent |
cc58c1 |
- "moved mount tree from %s to %s", mm_tmp_root, mm_root);
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- return 1;
|
|
Ian Kent |
cc58c1 |
-}
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
-static void cleanup_multi_root(struct autofs_point *ap, const char *root,
|
|
Ian Kent |
cc58c1 |
- const char *path, unsigned int move)
|
|
Ian Kent |
cc58c1 |
-{
|
|
Ian Kent |
cc58c1 |
- if (move == MOUNT_MOVE_NONE)
|
|
Ian Kent |
cc58c1 |
- return;
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- if (move == MOUNT_MOVE_OTHER)
|
|
Ian Kent |
cc58c1 |
- spawn_umount(ap->logopt, root, NULL);
|
|
Ian Kent |
cc58c1 |
- else {
|
|
Ian Kent |
cc58c1 |
- struct ioctl_ops *ops = get_ioctl_ops();
|
|
Ian Kent |
cc58c1 |
- struct autofs_point *submount;
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- mounts_mutex_lock(ap);
|
|
Ian Kent |
cc58c1 |
- submount = __master_find_submount(ap, path);
|
|
Ian Kent |
cc58c1 |
- if (!submount) {
|
|
Ian Kent |
cc58c1 |
- mounts_mutex_unlock(ap);
|
|
Ian Kent |
cc58c1 |
- return;
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- alarm_delete(submount);
|
|
Ian Kent |
cc58c1 |
- st_remove_tasks(submount);
|
|
Ian Kent |
cc58c1 |
- st_wait_state(submount, ST_READY);
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- submount->parent->submnt_count--;
|
|
Ian Kent |
cc58c1 |
- list_del_init(&submount->mounts);
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- ops->catatonic(submount->logopt, submount->ioctlfd);
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- mounts_mutex_unlock(ap);
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- if (submount->thid) {
|
|
Ian Kent |
cc58c1 |
- pthread_cancel(submount->thid);
|
|
Ian Kent |
cc58c1 |
- close_mount_fds(submount);
|
|
Ian Kent |
cc58c1 |
- umount(root);
|
|
Ian Kent |
cc58c1 |
- destroy_logpri_fifo(submount);
|
|
Ian Kent |
cc58c1 |
- master_free_mapent_sources(submount->entry, 1);
|
|
Ian Kent |
cc58c1 |
- master_free_mapent(ap->entry);
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
- return;
|
|
Ian Kent |
cc58c1 |
-}
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
static void cleanup_multi_triggers(struct autofs_point *ap,
|
|
Ian Kent |
cc58c1 |
struct mapent *me, const char *root, int start,
|
|
Ian Kent |
cc58c1 |
const char *base)
|
|
Ian Kent |
cc58c1 |
@@ -1166,49 +1082,15 @@ static void cleanup_multi_triggers(struc
|
|
Ian Kent |
cc58c1 |
return;
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#ifdef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
-static int check_fstype_autofs_option(const char *options)
|
|
Ian Kent |
cc58c1 |
-{
|
|
Ian Kent |
cc58c1 |
- char *tok, *tokbuf;
|
|
Ian Kent |
cc58c1 |
- int found;
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- /*
|
|
Ian Kent |
cc58c1 |
- * Look for fstype= in options and return true if
|
|
Ian Kent |
cc58c1 |
- * the last occurrence is fstype=autofs.
|
|
Ian Kent |
cc58c1 |
- */
|
|
Ian Kent |
cc58c1 |
- found = 0;
|
|
Ian Kent |
cc58c1 |
- tokbuf = alloca(strlen(options) + 2);
|
|
Ian Kent |
cc58c1 |
- strcpy(tokbuf, options);
|
|
Ian Kent |
cc58c1 |
- tok = strtok_r(tokbuf, ",", &tokbuf);
|
|
Ian Kent |
cc58c1 |
- if (tok) {
|
|
Ian Kent |
cc58c1 |
- do {
|
|
Ian Kent |
cc58c1 |
- if (strstr(tok, "fstype=")) {
|
|
Ian Kent |
cc58c1 |
- if (strstr(tok, "autofs"))
|
|
Ian Kent |
cc58c1 |
- found = 1;
|
|
Ian Kent |
cc58c1 |
- else
|
|
Ian Kent |
cc58c1 |
- found = 0;
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
- } while ((tok = strtok_r(NULL, ",", &tokbuf)));
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- return found;
|
|
Ian Kent |
cc58c1 |
-}
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
static int mount_subtree(struct autofs_point *ap, struct mapent *me,
|
|
Ian Kent |
cc58c1 |
const char *name, char *loc, char *options, void *ctxt)
|
|
Ian Kent |
cc58c1 |
{
|
|
Ian Kent |
cc58c1 |
struct mapent *mm;
|
|
Ian Kent |
cc58c1 |
struct mapent *ro;
|
|
Ian Kent |
cc58c1 |
char *mm_root, *mm_base, *mm_key;
|
|
Ian Kent |
cc58c1 |
- const char *mnt_root, *target;
|
|
Ian Kent |
cc58c1 |
+ const char *mnt_root;
|
|
Ian Kent |
cc58c1 |
unsigned int mm_root_len, mnt_root_len;
|
|
Ian Kent |
cc58c1 |
int start, ret = 0, rv;
|
|
Ian Kent |
cc58c1 |
- unsigned int move = MOUNT_MOVE_NONE;
|
|
Ian Kent |
cc58c1 |
-#ifdef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
- char t_dir[] = "/tmp/autoXXXXXX";
|
|
Ian Kent |
cc58c1 |
- char *mnt_tmp_root = NULL;
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
rv = 0;
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
@@ -1227,26 +1109,12 @@ static int mount_subtree(struct autofs_p
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
mm_root_len = strlen(mm_root);
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#ifndef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
mnt_root = mm_root;
|
|
Ian Kent |
cc58c1 |
mnt_root_len = mm_root_len;
|
|
Ian Kent |
cc58c1 |
-#else
|
|
Ian Kent |
cc58c1 |
- if (ap->flags & MOUNT_FLAG_REMOUNT) {
|
|
Ian Kent |
cc58c1 |
- mnt_root = mm_root;
|
|
Ian Kent |
cc58c1 |
- mnt_root_len = mm_root_len;
|
|
Ian Kent |
cc58c1 |
- } else {
|
|
Ian Kent |
cc58c1 |
- mnt_root = mkdtemp(t_dir);
|
|
Ian Kent |
cc58c1 |
- if (!mnt_root)
|
|
Ian Kent |
cc58c1 |
- return 1;
|
|
Ian Kent |
cc58c1 |
- mnt_root_len = strlen(mnt_root);
|
|
Ian Kent |
cc58c1 |
- mnt_tmp_root = (char *) mnt_root;
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
if (me == me->multi) {
|
|
Ian Kent |
cc58c1 |
/* name = NULL */
|
|
Ian Kent |
cc58c1 |
/* destination = mm_root */
|
|
Ian Kent |
cc58c1 |
- target = mm_root;
|
|
Ian Kent |
cc58c1 |
mm_base = "/";
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
/* Mount root offset if it exists */
|
|
Ian Kent |
cc58c1 |
@@ -1263,18 +1131,10 @@ static int mount_subtree(struct autofs_p
|
|
Ian Kent |
cc58c1 |
warn(ap->logopt,
|
|
Ian Kent |
cc58c1 |
MODPREFIX "failed to parse root offset");
|
|
Ian Kent |
cc58c1 |
cache_delete_offset_list(me->mc, name);
|
|
Ian Kent |
cc58c1 |
- goto error_out;
|
|
Ian Kent |
cc58c1 |
+ return 1;
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
ro_len = strlen(ro_loc);
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#ifdef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
- if (!(ap->flags & MOUNT_FLAG_REMOUNT)) {
|
|
Ian Kent |
cc58c1 |
- move = MOUNT_MOVE_OTHER;
|
|
Ian Kent |
cc58c1 |
- if (check_fstype_autofs_option(myoptions))
|
|
Ian Kent |
cc58c1 |
- move = MOUNT_MOVE_AUTOFS;
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
tmp = alloca(mnt_root_len + 1);
|
|
Ian Kent |
cc58c1 |
strcpy(tmp, mnt_root);
|
|
Ian Kent |
cc58c1 |
tmp[mnt_root_len] = '/';
|
|
Ian Kent |
cc58c1 |
@@ -1293,44 +1153,25 @@ static int mount_subtree(struct autofs_p
|
|
Ian Kent |
cc58c1 |
error(ap->logopt, MODPREFIX
|
|
Ian Kent |
cc58c1 |
"failed to mount offset triggers");
|
|
Ian Kent |
cc58c1 |
cleanup_multi_triggers(ap, me, mnt_root, start, mm_base);
|
|
Ian Kent |
cc58c1 |
- cleanup_multi_root(ap, mnt_root, mm_root, move);
|
|
Ian Kent |
cc58c1 |
- goto error_out;
|
|
Ian Kent |
cc58c1 |
+ return 1;
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
} else if (rv <= 0) {
|
|
Ian Kent |
cc58c1 |
-#ifdef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
- move = MOUNT_MOVE_NONE;
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
ret = mount_multi_triggers(ap, me, mm_root, start, mm_base);
|
|
Ian Kent |
cc58c1 |
if (ret == -1) {
|
|
Ian Kent |
cc58c1 |
error(ap->logopt, MODPREFIX
|
|
Ian Kent |
cc58c1 |
"failed to mount offset triggers");
|
|
Ian Kent |
cc58c1 |
cleanup_multi_triggers(ap, me, mm_root, start, mm_base);
|
|
Ian Kent |
cc58c1 |
- goto error_out;
|
|
Ian Kent |
cc58c1 |
+ return 1;
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
} else {
|
|
Ian Kent |
cc58c1 |
int loclen = strlen(loc);
|
|
Ian Kent |
cc58c1 |
int namelen = strlen(name);
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#ifndef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
- /*
|
|
Ian Kent |
cc58c1 |
- * When using move mount to mount offsets or direct mounts
|
|
Ian Kent |
cc58c1 |
- * the base of the tree can be the base of the temporary
|
|
Ian Kent |
cc58c1 |
- * mount point it needs to be the full path when not moving
|
|
Ian Kent |
cc58c1 |
- * the mount after construction.
|
|
Ian Kent |
cc58c1 |
- */
|
|
Ian Kent |
cc58c1 |
mnt_root = name;
|
|
Ian Kent |
cc58c1 |
-#else
|
|
Ian Kent |
cc58c1 |
- if (!(ap->flags & MOUNT_FLAG_REMOUNT)) {
|
|
Ian Kent |
cc58c1 |
- move = MOUNT_MOVE_OTHER;
|
|
Ian Kent |
cc58c1 |
- if (check_fstype_autofs_option(options))
|
|
Ian Kent |
cc58c1 |
- move = MOUNT_MOVE_AUTOFS;
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
/* name = mm_root + mm_base */
|
|
Ian Kent |
cc58c1 |
/* destination = mm_root + mm_base = name */
|
|
Ian Kent |
cc58c1 |
- target = name;
|
|
Ian Kent |
cc58c1 |
mm_base = &me->key[start];
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
rv = sun_mount(ap, mnt_root, name, namelen, loc, loclen, options, ctxt);
|
|
Ian Kent |
cc58c1 |
@@ -1340,16 +1181,11 @@ static int mount_subtree(struct autofs_p
|
|
Ian Kent |
cc58c1 |
error(ap->logopt, MODPREFIX
|
|
Ian Kent |
cc58c1 |
"failed to mount offset triggers");
|
|
Ian Kent |
cc58c1 |
cleanup_multi_triggers(ap, me, mnt_root, start, mm_base);
|
|
Ian Kent |
cc58c1 |
- cleanup_multi_root(ap, mnt_root, mm_root, move);
|
|
Ian Kent |
cc58c1 |
- goto error_out;
|
|
Ian Kent |
cc58c1 |
+ return 1;
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
} else if (rv < 0) {
|
|
Ian Kent |
cc58c1 |
char *mm_root_base = alloca(strlen(mm_root) + strlen(mm_base) + 1);
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#ifdef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
- move = MOUNT_MOVE_NONE;
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
strcpy(mm_root_base, mm_root);
|
|
Ian Kent |
cc58c1 |
strcat(mm_root_base, mm_base);
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
@@ -1358,22 +1194,11 @@ static int mount_subtree(struct autofs_p
|
|
Ian Kent |
cc58c1 |
error(ap->logopt, MODPREFIX
|
|
Ian Kent |
cc58c1 |
"failed to mount offset triggers");
|
|
Ian Kent |
cc58c1 |
cleanup_multi_triggers(ap, me, mm_root, start, mm_base);
|
|
Ian Kent |
cc58c1 |
- goto error_out;
|
|
Ian Kent |
cc58c1 |
+ return 1;
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
-#ifdef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
- if (!move_mount(ap, mnt_root, target, move)) {
|
|
Ian Kent |
cc58c1 |
- cleanup_multi_triggers(ap, me, mnt_root, start, mm_base);
|
|
Ian Kent |
cc58c1 |
- cleanup_multi_root(ap, mnt_root, mm_root, move);
|
|
Ian Kent |
cc58c1 |
- goto error_out;
|
|
Ian Kent |
cc58c1 |
- }
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- if (mnt_tmp_root)
|
|
Ian Kent |
cc58c1 |
- rmdir(mnt_tmp_root);
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
/* Mount for base of tree failed */
|
|
Ian Kent |
cc58c1 |
if (rv > 0)
|
|
Ian Kent |
cc58c1 |
return rv;
|
|
Ian Kent |
cc58c1 |
@@ -1386,14 +1211,6 @@ static int mount_subtree(struct autofs_p
|
|
Ian Kent |
cc58c1 |
rv = 0;
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
return rv;
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
-error_out:
|
|
Ian Kent |
cc58c1 |
-#ifdef ENABLE_MOUNT_MOVE
|
|
Ian Kent |
cc58c1 |
- if (mnt_tmp_root)
|
|
Ian Kent |
cc58c1 |
- rmdir(mnt_tmp_root);
|
|
Ian Kent |
cc58c1 |
-#endif
|
|
Ian Kent |
cc58c1 |
-
|
|
Ian Kent |
cc58c1 |
- return 1;
|
|
Ian Kent |
cc58c1 |
}
|
|
Ian Kent |
cc58c1 |
|
|
Ian Kent |
cc58c1 |
/*
|