Deleted Added
full compact
conf.c (51292) conf.c (52894)
1/*
2 * Copyright (c) 1997-1999 Erez Zadok
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 24 unchanged lines hidden (view full) ---

33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * %W% (Berkeley) %G%
40 *
1/*
2 * Copyright (c) 1997-1999 Erez Zadok
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 24 unchanged lines hidden (view full) ---

33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * %W% (Berkeley) %G%
40 *
41 * $Id: conf.c,v 1.4 1999/02/04 07:24:15 ezk Exp $
41 * $Id: conf.c,v 1.5 1999/09/30 21:01:30 ezk Exp $
42 *
43 */
44
45/*
46 * Functions to handle the configuration file.
47 */
48
49#ifdef HAVE_CONFIG_H

--- 27 unchanged lines hidden (view full) ---

77 */
78static int gopt_arch(const char *val);
79static int gopt_auto_dir(const char *val);
80static int gopt_browsable_dirs(const char *val);
81static int gopt_cache_duration(const char *val);
82static int gopt_cluster(const char *val);
83static int gopt_debug_options(const char *val);
84static int gopt_dismount_interval(const char *val);
42 *
43 */
44
45/*
46 * Functions to handle the configuration file.
47 */
48
49#ifdef HAVE_CONFIG_H

--- 27 unchanged lines hidden (view full) ---

77 */
78static int gopt_arch(const char *val);
79static int gopt_auto_dir(const char *val);
80static int gopt_browsable_dirs(const char *val);
81static int gopt_cache_duration(const char *val);
82static int gopt_cluster(const char *val);
83static int gopt_debug_options(const char *val);
84static int gopt_dismount_interval(const char *val);
85static int gopt_full_os(const char *val);
85static int gopt_fully_qualified_hosts(const char *val);
86static int gopt_hesiod_base(const char *val);
87static int gopt_karch(const char *val);
88static int gopt_ldap_base(const char *val);
89static int gopt_ldap_cache_maxmem(const char *val);
90static int gopt_ldap_cache_seconds(const char *val);
91static int gopt_ldap_hostports(const char *val);
92static int gopt_local_domain(const char *val);

--- 13 unchanged lines hidden (view full) ---

106static int gopt_plock(const char *val);
107static int gopt_print_pid(const char *val);
108static int gopt_print_version(const char *val);
109static int gopt_restart_mounts(const char *val);
110static int gopt_search_path(const char *val);
111static int gopt_selectors_on_default(const char *val);
112static int gopt_show_statfs_entries(const char *val);
113static int gopt_unmount_on_exit(const char *val);
86static int gopt_fully_qualified_hosts(const char *val);
87static int gopt_hesiod_base(const char *val);
88static int gopt_karch(const char *val);
89static int gopt_ldap_base(const char *val);
90static int gopt_ldap_cache_maxmem(const char *val);
91static int gopt_ldap_cache_seconds(const char *val);
92static int gopt_ldap_hostports(const char *val);
93static int gopt_local_domain(const char *val);

--- 13 unchanged lines hidden (view full) ---

107static int gopt_plock(const char *val);
108static int gopt_print_pid(const char *val);
109static int gopt_print_version(const char *val);
110static int gopt_restart_mounts(const char *val);
111static int gopt_search_path(const char *val);
112static int gopt_selectors_on_default(const char *val);
113static int gopt_show_statfs_entries(const char *val);
114static int gopt_unmount_on_exit(const char *val);
115static int gopt_vendor(const char *val);
114static int process_global_option(const char *key, const char *val);
115static int process_regular_map(cf_map_t *cfm);
116static int process_regular_option(const char *section, const char *key, const char *val, cf_map_t *cfm);
117static int ropt_browsable_dirs(const char *val, cf_map_t *cfm);
118static int ropt_map_name(const char *val, cf_map_t *cfm);
119static int ropt_map_options(const char *val, cf_map_t *cfm);
120static int ropt_map_type(const char *val, cf_map_t *cfm);
121static int ropt_mount_type(const char *val, cf_map_t *cfm);

--- 10 unchanged lines hidden (view full) ---

132 {"arch", gopt_arch},
133 {"auto_dir", gopt_auto_dir},
134 {"browsable_dirs", gopt_browsable_dirs},
135 {"cache_duration", gopt_cache_duration},
136 {"cluster", gopt_cluster},
137 {"debug_options", gopt_debug_options},
138 {"dismount_interval", gopt_dismount_interval},
139 {"fully_qualified_hosts", gopt_fully_qualified_hosts},
116static int process_global_option(const char *key, const char *val);
117static int process_regular_map(cf_map_t *cfm);
118static int process_regular_option(const char *section, const char *key, const char *val, cf_map_t *cfm);
119static int ropt_browsable_dirs(const char *val, cf_map_t *cfm);
120static int ropt_map_name(const char *val, cf_map_t *cfm);
121static int ropt_map_options(const char *val, cf_map_t *cfm);
122static int ropt_map_type(const char *val, cf_map_t *cfm);
123static int ropt_mount_type(const char *val, cf_map_t *cfm);

--- 10 unchanged lines hidden (view full) ---

134 {"arch", gopt_arch},
135 {"auto_dir", gopt_auto_dir},
136 {"browsable_dirs", gopt_browsable_dirs},
137 {"cache_duration", gopt_cache_duration},
138 {"cluster", gopt_cluster},
139 {"debug_options", gopt_debug_options},
140 {"dismount_interval", gopt_dismount_interval},
141 {"fully_qualified_hosts", gopt_fully_qualified_hosts},
142 {"full_os", gopt_full_os},
140 {"hesiod_base", gopt_hesiod_base},
141 {"karch", gopt_karch},
142 {"ldap_base", gopt_ldap_base},
143 {"ldap_cache_maxmem", gopt_ldap_cache_maxmem},
144 {"ldap_cache_seconds", gopt_ldap_cache_seconds},
145 {"ldap_hostports", gopt_ldap_hostports},
146 {"local_domain", gopt_local_domain},
147 {"log_file", gopt_log_file},

--- 12 unchanged lines hidden (view full) ---

160 {"plock", gopt_plock},
161 {"print_pid", gopt_print_pid},
162 {"print_version", gopt_print_version},
163 {"restart_mounts", gopt_restart_mounts},
164 {"search_path", gopt_search_path},
165 {"selectors_on_default", gopt_selectors_on_default},
166 {"show_statfs_entries", gopt_show_statfs_entries},
167 {"unmount_on_exit", gopt_unmount_on_exit},
143 {"hesiod_base", gopt_hesiod_base},
144 {"karch", gopt_karch},
145 {"ldap_base", gopt_ldap_base},
146 {"ldap_cache_maxmem", gopt_ldap_cache_maxmem},
147 {"ldap_cache_seconds", gopt_ldap_cache_seconds},
148 {"ldap_hostports", gopt_ldap_hostports},
149 {"local_domain", gopt_local_domain},
150 {"log_file", gopt_log_file},

--- 12 unchanged lines hidden (view full) ---

163 {"plock", gopt_plock},
164 {"print_pid", gopt_print_pid},
165 {"print_version", gopt_print_version},
166 {"restart_mounts", gopt_restart_mounts},
167 {"search_path", gopt_search_path},
168 {"selectors_on_default", gopt_selectors_on_default},
169 {"show_statfs_entries", gopt_show_statfs_entries},
170 {"unmount_on_exit", gopt_unmount_on_exit},
171 {"vendor", gopt_vendor},
168 {NULL, NULL}
169};
170
171
172/*
173 * Reset a map.
174 */
175static void

--- 209 unchanged lines hidden (view full) ---

385 gopt.am_timeo_w = atoi(val);
386 if (gopt.am_timeo_w <= 0)
387 gopt.am_timeo_w = AM_TTL_W;
388 return 0;
389}
390
391
392static int
172 {NULL, NULL}
173};
174
175
176/*
177 * Reset a map.
178 */
179static void

--- 209 unchanged lines hidden (view full) ---

389 gopt.am_timeo_w = atoi(val);
390 if (gopt.am_timeo_w <= 0)
391 gopt.am_timeo_w = AM_TTL_W;
392 return 0;
393}
394
395
396static int
397gopt_full_os(const char *val)
398{
399 gopt.op_sys_full = strdup((char *)val);
400 return 0;
401}
402
403
404static int
393gopt_fully_qualified_hosts(const char *val)
394{
395 if (STREQ(val, "yes")) {
396 gopt.flags |= CFM_FULLY_QUALIFIED_HOSTS;
397 return 0;
398 } else if (STREQ(val, "no")) {
399 gopt.flags &= ~CFM_FULLY_QUALIFIED_HOSTS;
400 return 0;

--- 361 unchanged lines hidden (view full) ---

762 return 0;
763 }
764
765 fprintf(stderr, "conf: unknown value to unmount_on_exit \"%s\"\n", val);
766 return 1; /* unknown value */
767}
768
769
405gopt_fully_qualified_hosts(const char *val)
406{
407 if (STREQ(val, "yes")) {
408 gopt.flags |= CFM_FULLY_QUALIFIED_HOSTS;
409 return 0;
410 } else if (STREQ(val, "no")) {
411 gopt.flags &= ~CFM_FULLY_QUALIFIED_HOSTS;
412 return 0;

--- 361 unchanged lines hidden (view full) ---

774 return 0;
775 }
776
777 fprintf(stderr, "conf: unknown value to unmount_on_exit \"%s\"\n", val);
778 return 1; /* unknown value */
779}
780
781
782static int
783gopt_vendor(const char *val)
784{
785 gopt.op_sys_vendor = strdup((char *)val);
786 return 0;
787}
788
789
770/*
771 * Collect one entry for a regular map
772 */
773static int
774process_regular_option(const char *section, const char *key, const char *val, cf_map_t *cfm)
775{
776 /* ensure that val is valid */
777 if (!section || section[0] == '\0' ||

--- 174 unchanged lines hidden ---
790/*
791 * Collect one entry for a regular map
792 */
793static int
794process_regular_option(const char *section, const char *key, const char *val, cf_map_t *cfm)
795{
796 /* ensure that val is valid */
797 if (!section || section[0] == '\0' ||

--- 174 unchanged lines hidden ---