unchanged: --- a/CHANGELOG +++ b/CHANGELOG @@ -47,6 +47,7 @@ - remove ability to use multiple indirect mount entries in master map. - expand export access checks to include missing syntax options. - make "-hosts" module try to be sensitive to exports list changes. +- change mount "device" from "automount" to the map name. 1/9/2006 autofs-5.0.1 rc2 ------------------------- diff -u b/daemon/direct.c b/daemon/direct.c --- b/daemon/direct.c +++ b/daemon/direct.c @@ -357,6 +357,7 @@ struct stat st; int status, ret, ioctlfd, cl_flags; struct list_head list; + const char *map_name; INIT_LIST_HEAD(&list); @@ -448,7 +449,9 @@ me->dir_created = 1; } - ret = mount("automount", me->key, "autofs", MS_MGC_VAL, mp->options); + map_name = me->mc->map->argv[0]; + + ret = mount(map_name, me->key, "autofs", MS_MGC_VAL, mp->options); if (ret) { crit(ap->logopt, "failed to mount autofs path %s", me->key); goto out_err; @@ -695,6 +698,7 @@ time_t timeout = ap->exp_timeout; struct stat st; int ioctlfd, cl_flags, status, ret; + const char *map_name; if (is_mounted(_PROC_MOUNTS, me->key, MNTS_AUTOFS)) { if (ap->state != ST_READMAP) @@ -772,7 +776,9 @@ "calling mount -t autofs " SLOPPY " -o %s automount %s", mp->options, me->key); - ret = mount("automount", me->key, "autofs", MS_MGC_VAL, mp->options); + map_name = me->mc->map->argv[0]; + + ret = mount(map_name, me->key, "autofs", MS_MGC_VAL, mp->options); if (ret) { crit(ap->logopt, "failed to mount autofs path %s", me->key); goto out_err; unchanged: --- a/daemon/indirect.c +++ b/daemon/indirect.c @@ -147,6 +147,7 @@ static int do_mount_autofs_indirect(stru { time_t timeout = ap->exp_timeout; char *options = NULL; + const char *type, *map_name = NULL; struct stat st; struct mnt_list *mnts; int cl_flags, ret; @@ -183,7 +184,17 @@ static int do_mount_autofs_indirect(stru ap->dir_created = 1; } - ret = mount("automount", ap->path, "autofs", MS_MGC_VAL, options); + type = ap->entry->maps->type; + if (type && !strcmp(ap->entry->maps->type, "hosts")) { + char *tmp = alloca(7); + if (tmp) { + strcpy(tmp, "-hosts"); + map_name = (const char *) tmp; + } + } else + map_name = ap->entry->maps->argv[0]; + + ret = mount(map_name, ap->path, "autofs", MS_MGC_VAL, options); if (ret) { crit(ap->logopt, "failed to mount autofs path %s", ap->path); goto out_rmdir; unchanged: --- a/include/automount.h +++ b/include/automount.h @@ -131,6 +131,7 @@ struct mapent_cache { unsigned int size; pthread_mutex_t ino_index_mutex; struct list_head *ino_index; + struct map_source *map; struct mapent **hash; }; unchanged: --- a/lib/cache.c +++ b/lib/cache.c @@ -207,6 +207,8 @@ struct mapent_cache *cache_init(struct m INIT_LIST_HEAD(&mc->ino_index[i]); } + mc->map = map; + cache_unlock(mc); return mc;