1 diff --git a/CHANGELOG b/CHANGELOG
2 index c486a7b..0fcdfd4 100644
6 - add authentication option for using an external credential cache.
7 - expand support for the "%" hack.
8 - fix to quoting for exports gathered by hosts map.
9 +- use mount option "nosuid" for "-hosts" map unless "suid" is explicily specified.
11 18/06/2007 autofs-5.0.2
12 -----------------------
13 diff --git a/man/auto.master.5.in b/man/auto.master.5.in
14 index d488960..56aaa5d 100644
15 --- a/man/auto.master.5.in
16 +++ b/man/auto.master.5.in
17 @@ -195,6 +195,9 @@ For example, with an entry in the master map of
19 accessing /net/myserver will mount exports from myserver on directories below
22 +NOTE: mounts done from a hosts map will be mounted with the "nosuid" option
23 +unless the "suid" option is explicitly given in the master map entry.
25 If the map type \fBldap\fP is specified the mapname is of the form
26 \fB[//servername/]dn\fP, where the optional \fBservername\fP is
27 diff --git a/modules/parse_sun.c b/modules/parse_sun.c
28 index 186e567..9a97329 100644
29 --- a/modules/parse_sun.c
30 +++ b/modules/parse_sun.c
31 @@ -496,6 +496,7 @@ static int sun_mount(struct autofs_point *ap, const char *root,
39 @@ -585,6 +586,36 @@ static int sun_mount(struct autofs_point *ap, const char *root,
40 mountpoint = alloca(namelen + 1);
41 sprintf(mountpoint, "%.*s", namelen, name);
43 + type = ap->entry->maps->type;
44 + if (type && !strcmp(type, "hosts")) {
46 + if (!strstr(options, "suid")) {
47 + char *tmp = alloca(strlen(options) + 8);
49 + error(ap->logopt, MODPREFIX
50 + "alloca failed for options");
55 + strcpy(tmp, options);
56 + strcat(tmp, ",nosuid");
60 + char *tmp = alloca(7);
63 + MODPREFIX "alloca failed for options");
68 + strcpy(tmp, "nosuid");
73 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
74 if (!strcmp(fstype, "nfs")) {
75 what = alloca(loclen + 1);
76 diff --git a/samples/auto.master b/samples/auto.master
77 index d4796a3..4995976 100644
78 --- a/samples/auto.master
79 +++ b/samples/auto.master
81 # For details of the format look at autofs(5).
85 +# NOTE: mounts done from a hosts map will be mounted with the
86 +# "nosuid" option unless the "suid" option is explicitly
91 # Include central master map if it can be found using