diff --git a/CHANGELOG b/CHANGELOG index d536280..05a1ad7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ - fix localhost replicated mounts not working. - add "condrestart" to RedHat init script. - add "@network" and .domain.name export check. +- fix display map name in mount entry for "-hosts" map. 4/1/2007 autofs-5.0.1 rc3 ------------------------- diff --git a/daemon/direct.c b/daemon/direct.c index aa1a501..0869858 100644 --- a/daemon/direct.c +++ b/daemon/direct.c @@ -698,7 +698,7 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me, int is_autof time_t timeout = ap->exp_timeout; struct stat st; int ioctlfd, cl_flags, status, ret; - const char *map_name; + const char *type, *map_name = NULL; if (is_mounted(_PROC_MOUNTS, me->key, MNTS_AUTOFS)) { if (ap->state != ST_READMAP) @@ -776,7 +776,15 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me, int is_autof "calling mount -t autofs " SLOPPY " -o %s automount %s", mp->options, me->key); - map_name = me->mc->map->argv[0]; + 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 = me->mc->map->argv[0]; ret = mount(map_name, me->key, "autofs", MS_MGC_VAL, mp->options); if (ret) {