]>
Commit | Line | Data |
---|---|---|
3d551623 PG |
1 | diff --git a/CHANGELOG b/CHANGELOG |
2 | index 9c99966..92013ce 100644 | |
3 | --- a/CHANGELOG | |
4 | +++ b/CHANGELOG | |
5 | @@ -18,6 +18,7 @@ | |
6 | - add support for the "%" hack for case insensitive attribute schemas. | |
7 | - fix "nosymlink" option handling and add desription to man page. | |
8 | - fix don't fail on empty master map. | |
9 | +- if there's no "automount" entry in nsswitch.conf use "files" source. | |
10 | ||
11 | 18/06/2007 autofs-5.0.2 | |
12 | ----------------------- | |
13 | diff --git a/lib/nss_parse.y b/lib/nss_parse.y | |
14 | index 4f67f08..e559696 100644 | |
15 | --- a/lib/nss_parse.y | |
16 | +++ b/lib/nss_parse.y | |
17 | @@ -45,6 +45,8 @@ struct nss_action act[NSS_STATUS_MAX]; | |
18 | #define YYLTYPE_IS_TRIVIAL 0 | |
19 | #endif | |
20 | ||
21 | +unsigned int nss_automount_found; | |
22 | + | |
23 | extern int nss_lineno; | |
24 | extern int nss_lex(void); | |
25 | extern FILE *nss_in; | |
26 | @@ -183,10 +185,16 @@ int nsswitch_parse(struct list_head *list) | |
27 | ||
28 | nss_in = nsswitch; | |
29 | ||
30 | + nss_automount_found = 0; | |
31 | nss_list = list; | |
32 | status = nss_parse(); | |
33 | nss_list = NULL; | |
34 | ||
35 | + /* No "automount" nsswitch entry, use "files" */ | |
36 | + if (!nss_automount_found) | |
37 | + if (add_source(list, "files")) | |
38 | + status = 0; | |
39 | + | |
40 | pthread_cleanup_pop(1); | |
41 | pthread_cleanup_pop(1); | |
42 | ||
43 | diff --git a/lib/nss_tok.l b/lib/nss_tok.l | |
44 | index 71d83b0..f96b47f 100644 | |
45 | --- a/lib/nss_tok.l | |
46 | +++ b/lib/nss_tok.l | |
47 | @@ -56,6 +56,8 @@ int nss_wrap(void); | |
48 | #define YY_MAIN 0 | |
49 | #endif | |
50 | ||
51 | +extern unsigned int nss_automount_found; | |
52 | + | |
53 | %} | |
54 | ||
55 | %option nounput | |
56 | @@ -85,6 +87,7 @@ other [[:alnum:]@$%^&*()-+_":;?,<>./'{}~`]+ | |
57 | %% | |
58 | ||
59 | ^{automount}: { | |
60 | + nss_automount_found = 1; | |
61 | BEGIN(AUTOMOUNT); | |
62 | } | |
63 |