]>
Commit | Line | Data |
---|---|---|
e5fd101c PS |
1 | autofs-5.0.4 - use intr option as hosts mount default |
2 | ||
3 | From: Ian Kent <raven@themaw.net> | |
4 | ||
5 | Use the "intr" option as default mount option for the hosts map | |
6 | unless explicily overridden. | |
7 | --- | |
8 | ||
9 | CHANGELOG | 1 + | |
10 | man/auto.master.5.in | 5 +++-- | |
11 | modules/parse_sun.c | 11 +++++++---- | |
12 | 3 files changed, 11 insertions(+), 6 deletions(-) | |
13 | ||
14 | ||
15 | diff --git a/CHANGELOG b/CHANGELOG | |
16 | index 8258e00..a42dd14 100644 | |
17 | --- a/CHANGELOG | |
18 | +++ b/CHANGELOG | |
19 | @@ -41,6 +41,7 @@ | |
20 | - reset flex scanner when setting buffer. | |
21 | - zero s_magic is valid. | |
22 | - use percent hack for master map keys. | |
23 | +- use intr option as hosts mount default. | |
24 | ||
25 | 4/11/2008 autofs-5.0.4 | |
26 | ----------------------- | |
27 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | |
28 | index aaa6324..7b7004f 100644 | |
29 | --- a/man/auto.master.5.in | |
30 | +++ b/man/auto.master.5.in | |
31 | @@ -208,8 +208,9 @@ For example, with an entry in the master map of | |
32 | accessing /net/myserver will mount exports from myserver on directories below | |
33 | /net/myserver. | |
34 | .P | |
35 | -NOTE: mounts done from a hosts map will be mounted with the "nosuid" and "nodev" options | |
36 | -unless the options "suid" and "dev" are explicitly given in the master map entry. | |
37 | +NOTE: mounts done from a hosts map will be mounted with the "nosuid,nodev,intr" options | |
38 | +unless overridden by explicily specifying the "suid", "dev" or "nointr" options in the | |
39 | +master map entry. | |
40 | .SH LDAP MAPS | |
41 | If the map type \fBldap\fP is specified the mapname is of the form | |
42 | \fB[//servername/]dn\fP, where the optional \fBservername\fP is | |
43 | diff --git a/modules/parse_sun.c b/modules/parse_sun.c | |
44 | index 65417e1..db36ae2 100644 | |
45 | --- a/modules/parse_sun.c | |
46 | +++ b/modules/parse_sun.c | |
47 | @@ -607,9 +607,10 @@ static int sun_mount(struct autofs_point *ap, const char *root, | |
48 | int len = strlen(options); | |
49 | int suid = strstr(options, "suid") ? 0 : 7; | |
50 | int dev = strstr(options, "dev") ? 0 : 6; | |
51 | + int nointr = strstr(options, "nointr") ? 0 : 5; | |
52 | ||
53 | - if (suid || dev) { | |
54 | - char *tmp = alloca(len + suid + dev + 1); | |
55 | + if (suid || dev || nointr) { | |
56 | + char *tmp = alloca(len + suid + dev + nointr + 1); | |
57 | if (!tmp) { | |
58 | error(ap->logopt, MODPREFIX | |
59 | "alloca failed for options"); | |
60 | @@ -623,10 +624,12 @@ static int sun_mount(struct autofs_point *ap, const char *root, | |
61 | strcat(tmp, ",nosuid"); | |
62 | if (dev) | |
63 | strcat(tmp, ",nodev"); | |
64 | + if (nointr) | |
65 | + strcat(tmp, ",intr"); | |
66 | options = tmp; | |
67 | } | |
68 | } else { | |
69 | - char *tmp = alloca(13); | |
70 | + char *tmp = alloca(18); | |
71 | if (!tmp) { | |
72 | error(ap->logopt, | |
73 | MODPREFIX "alloca failed for options"); | |
74 | @@ -634,7 +637,7 @@ static int sun_mount(struct autofs_point *ap, const char *root, | |
75 | return -1; | |
76 | return 1; | |
77 | } | |
78 | - strcpy(tmp, "nosuid,nodev"); | |
79 | + strcpy(tmp, "nosuid,nodev,intr"); | |
80 | options = tmp; | |
81 | } | |
82 | } |