Subversion Repositories Tewi

Rev

Rev 402 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 nishi 1
/* $Id: config.c 416 2024-11-19 07:54:58Z nishi $ */
2
 
16 nishi 3
#define SOURCE
4
 
312 nishi 5
#include "../config.h"
4 nishi 6
 
7
#include <stdio.h>
7 nishi 8
#include <stdint.h>
4 nishi 9
#include <stdlib.h>
10
#include <string.h>
257 nishi 11
#include <sys/stat.h>
212 nishi 12
 
400 nishi 13
#ifdef NEED_DIRECT
14
#include <direct.h>
15
#endif
16
 
215 nishi 17
#if !defined(_MSC_VER) && !defined(__BORLANDC__)
12 nishi 18
#include <unistd.h>
212 nishi 19
#endif
4 nishi 20
 
359 nishi 21
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
240 nishi 22
#ifdef USE_WINSOCK1
23
#include <winsock.h>
24
#else
20 nishi 25
#include <winsock2.h>
26
#endif
240 nishi 27
#endif
20 nishi 28
 
4 nishi 29
#include <cm_string.h>
30
#include <cm_log.h>
31
 
312 nishi 32
#ifdef __OS2__
33
#include <types.h>
34
#include <netinet/in.h>
35
#include <tcpustd.h>
36
#endif
37
 
347 nishi 38
#ifdef __NETWARE__
349 nishi 39
#include <sys/socket.h>
347 nishi 40
#endif
312 nishi 41
#include "tw_config.h"
42
#include "tw_module.h"
43
 
6 nishi 44
struct tw_config config;
45
 
12 nishi 46
struct tw_config_entry* tw_vhost_match(const char* name, int port) {
47
	int i;
48
	for(i = 0; i < config.vhost_count; i++) {
13 nishi 49
		if(strcmp(config.vhosts[i].name, name) == 0 && (config.vhosts[i].port == -1 ? 1 : config.vhosts[i].port == port)) {
12 nishi 50
			return &config.vhosts[i];
51
		}
52
	}
53
	return &config.root;
54
}
55
 
22 nishi 56
bool tw_permission_allowed(const char* path, SOCKADDR addr, struct tw_http_request req, struct tw_config_entry* vhost) {
21 nishi 57
	int i;
58
	bool found = false;
59
	bool pathstart = false;
60
	bool perm = false;
61
again:
22 nishi 62
	for(i = 0; i < vhost->dir_count; i++) {
212 nishi 63
		char* noslash;
21 nishi 64
		struct tw_dir_entry* e = &vhost->dirs[i];
65
		pathstart = false;
22 nishi 66
		if(strlen(path) >= strlen(e->dir)) {
212 nishi 67
			int j;
21 nishi 68
			pathstart = true;
22 nishi 69
			for(j = 0; path[j] != 0 && e->dir[j] != 0; j++) {
70
				if(path[j] != e->dir[j]) {
21 nishi 71
					pathstart = false;
72
					break;
73
				}
74
			}
75
		}
212 nishi 76
		noslash = cm_strdup(e->dir);
21 nishi 77
		noslash[strlen(noslash) - 1] = 0;
22 nishi 78
		if(strcmp(e->dir, path) == 0 || strcmp(noslash, path) == 0 || pathstart) {
21 nishi 79
			found = true;
22 nishi 80
			if(strcmp(e->name, "all") == 0) {
21 nishi 81
				perm = e->type == TW_DIR_ALLOW;
82
			}
83
		}
84
		free(noslash);
85
	}
22 nishi 86
	if(!found && vhost != &config.root) {
21 nishi 87
		vhost = &config.root;
88
		goto again;
89
	}
90
	return perm;
91
}
92
 
7 nishi 93
void tw_config_init(void) {
94
	int i;
95
	for(i = 0; i < MAX_PORTS + 1; i++) {
96
		config.ports[i] = -1;
97
	}
12 nishi 98
	for(i = 0; i < MAX_VHOSTS; i++) {
156 nishi 99
#ifndef NO_SSL
12 nishi 100
		config.vhosts[i].sslkey = NULL;
101
		config.vhosts[i].sslcert = NULL;
156 nishi 102
#endif
19 nishi 103
		config.vhosts[i].root = NULL;
156 nishi 104
#ifdef HAS_CHROOT
105
		config.vhosts[i].chroot_path = NULL;
106
#endif
12 nishi 107
	}
156 nishi 108
#ifndef NO_SSL
12 nishi 109
	config.root.sslkey = NULL;
110
	config.root.sslcert = NULL;
156 nishi 111
#endif
19 nishi 112
	config.root.root = NULL;
21 nishi 113
	config.root.mime_count = 0;
114
	config.root.dir_count = 0;
22 nishi 115
	config.root.icon_count = 0;
24 nishi 116
	config.root.index_count = 0;
33 nishi 117
	config.root.readme_count = 0;
123 nishi 118
	config.root.hideport = 0;
156 nishi 119
#ifdef HAS_CHROOT
120
	config.root.chroot_path = NULL;
121
#endif
12 nishi 122
	config.vhost_count = 0;
18 nishi 123
	config.module_count = 0;
124
	config.extension = NULL;
17 nishi 125
	config.server_root = cm_strdup(PREFIX);
128 nishi 126
	config.server_admin = cm_strdup(SERVER_ADMIN);
156 nishi 127
	config.defined[0] = NULL;
187 nishi 128
#if defined(_PSP)
182 nishi 129
	strcpy(config.hostname, "psp");
187 nishi 130
#elif defined(__PPU__)
131
	strcpy(config.hostname, "ps3");
189 nishi 132
#elif defined(__ps2sdk__)
133
	strcpy(config.hostname, "ps2");
315 nishi 134
#elif defined(__NETWARE__)
135
	strcpy(config.hostname, "netware");
402 nishi 136
#elif defined(__amiga__)
137
	strcpy(config.hostname, "amiga");
182 nishi 138
#else
12 nishi 139
	gethostname(config.hostname, 1024);
182 nishi 140
#endif
161 nishi 141
#ifdef HAS_CHROOT
142
	tw_add_define("HAS_CHROOT");
143
#endif
174 nishi 144
#ifndef NO_SSL
145
	tw_add_define("HAS_SSL");
146
#endif
7 nishi 147
}
6 nishi 148
 
149
int tw_config_read(const char* path) {
4 nishi 150
	char cbuf[2];
6 nishi 151
	int ln = 0;
156 nishi 152
	int ifbr = 0;
153
	int ignore = -1;
253 nishi 154
	int portcount;
212 nishi 155
	FILE* f;
156
	cm_log("Config", "Reading %s", path);
157
	f = fopen(path, "r");
158
	cbuf[1] = 0;
6 nishi 159
	if(f != NULL) {
4 nishi 160
		char* line = malloc(1);
6 nishi 161
		int stop = 0;
12 nishi 162
		struct tw_config_entry* current = &config.root;
6 nishi 163
		char* vhost = NULL;
21 nishi 164
		char* dir = NULL;
212 nishi 165
		line[0] = 0;
6 nishi 166
		while(stop == 0) {
4 nishi 167
			int c = fread(cbuf, 1, 1, f);
6 nishi 168
			if(cbuf[0] == '\n' || c <= 0) {
212 nishi 169
				char* l = cm_trim(line);
6 nishi 170
				ln++;
171
				if(strlen(l) > 0 && l[0] != '#') {
5 nishi 172
					char** r = cm_split(l, " \t");
173
					int i;
156 nishi 174
					if(ignore != -1 && ifbr >= ignore) {
175
						if(cm_strcaseequ(r[0], "EndIf")) ifbr--;
176
						if(ifbr == 0) {
177
							ignore = -1;
178
						}
179
					} else if(cm_strcaseequ(r[0], "Include") || cm_strcaseequ(r[0], "IncludeOptional")) {
6 nishi 180
						for(i = 1; r[i] != NULL; i++) {
181
							if(tw_config_read(r[i]) != 0 && cm_strcaseequ(r[0], "Include")) {
182
								stop = 1;
183
								break;
5 nishi 184
							}
185
						}
156 nishi 186
					} else if(cm_strcaseequ(r[0], "Define")) {
187
						if(r[1] == NULL) {
188
							cm_log("Config", "Missing name at line %d", ln);
189
							stop = 1;
190
						} else {
191
							tw_add_define(r[1]);
192
						}
193
					} else if(cm_strcaseequ(r[0], "Undefine")) {
194
						if(r[1] == NULL) {
195
							cm_log("Config", "Missing name at line %d", ln);
196
							stop = 1;
197
						} else {
198
							tw_delete_define(r[1]);
199
						}
21 nishi 200
					} else if(cm_strcaseequ(r[0], "BeginDirectory")) {
201
						if(dir != NULL) {
202
							cm_log("Config", "Already in directory section at line %d", ln);
203
							stop = 1;
204
						} else {
205
							if(r[1] == NULL) {
206
								cm_log("Config", "Missing directory at line %d", ln);
207
								stop = 1;
208
							} else {
209
								dir = cm_strcat(r[1], r[1][strlen(r[1]) - 1] == '/' ? "" : "/");
210
							}
211
						}
212
					} else if(cm_strcaseequ(r[0], "EndDirectory")) {
213
						if(dir == NULL) {
214
							cm_log("Config", "Not in directory section at line %d", ln);
215
							stop = 1;
216
						} else {
217
							free(dir);
218
							dir = NULL;
219
						}
220
					} else if(cm_strcaseequ(r[0], "Allow")) {
221
						if(dir == NULL) {
222
							cm_log("Config", "Not in directory section at line %d", ln);
223
							stop = 1;
224
						} else {
225
							if(r[1] == NULL) {
226
								cm_log("Config", "Missing argument at line %d", ln);
227
								stop = 1;
228
							} else {
229
								struct tw_dir_entry* e = &current->dirs[current->dir_count++];
230
								e->name = cm_strdup(r[1]);
231
								e->dir = cm_strdup(dir);
232
								e->type = TW_DIR_ALLOW;
233
							}
234
						}
235
					} else if(cm_strcaseequ(r[0], "Deny")) {
236
						if(dir == NULL) {
237
							cm_log("Config", "Not in directory section at line %d", ln);
238
							stop = 1;
239
						} else {
240
							if(r[1] == NULL) {
241
								cm_log("Config", "Missing argument at line %d", ln);
242
								stop = 1;
243
							} else {
244
								struct tw_dir_entry* e = &current->dirs[current->dir_count++];
245
								e->name = cm_strdup(r[1]);
246
								e->dir = cm_strdup(dir);
247
								e->type = TW_DIR_DENY;
248
							}
249
						}
6 nishi 250
					} else if(cm_strcaseequ(r[0], "BeginVirtualHost")) {
251
						if(vhost != NULL) {
12 nishi 252
							cm_log("Config", "Already in virtual host section at line %d", ln);
6 nishi 253
							stop = 1;
254
						} else {
255
							if(r[1] == NULL) {
12 nishi 256
								cm_log("Config", "Missing virtual host at line %d", ln);
6 nishi 257
								stop = 1;
258
							} else {
212 nishi 259
								int i;
6 nishi 260
								vhost = cm_strdup(r[1]);
12 nishi 261
								current = &config.vhosts[config.vhost_count++];
21 nishi 262
								current->dir_count = 0;
263
								current->mime_count = 0;
22 nishi 264
								current->icon_count = 0;
24 nishi 265
								current->index_count = 0;
33 nishi 266
								current->readme_count = 0;
123 nishi 267
								current->hideport = -1;
12 nishi 268
								current->name = cm_strdup(vhost);
13 nishi 269
								current->port = -1;
12 nishi 270
								for(i = 0; vhost[i] != 0; i++) {
271
									if(vhost[i] == ':') {
272
										current->name[i] = 0;
273
										current->port = atoi(current->name + i + 1);
274
										break;
275
									}
276
								}
6 nishi 277
							}
278
						}
279
					} else if(cm_strcaseequ(r[0], "EndVirtualHost")) {
280
						if(vhost == NULL) {
12 nishi 281
							cm_log("Config", "Not in virtual host section at line %d", ln);
6 nishi 282
							stop = 1;
283
						} else {
284
							free(vhost);
285
							vhost = NULL;
12 nishi 286
							current = &config.root;
6 nishi 287
						}
174 nishi 288
					} else if(cm_strcaseequ(r[0], "Listen")
289
#ifndef NO_SSL
290
						  || cm_strcaseequ(r[0], "ListenSSL")
291
#endif
292
					) {
7 nishi 293
						for(i = 1; r[i] != NULL; i++) {
215 nishi 294
#if defined(_MSC_VER) || defined(__BORLANDC__)
212 nishi 295
							uint32_t port = atoi(r[i]);
296
#else
7 nishi 297
							uint64_t port = atoi(r[i]);
212 nishi 298
#endif
299
							int j;
7 nishi 300
							cm_log("Config", "Going to listen at port %d%s", (int)port, cm_strcaseequ(r[0], "ListenSSL") ? " with SSL" : "");
215 nishi 301
#if defined(_MSC_VER) || defined(__BORLANDC__)
212 nishi 302
							if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1UL << 31);
303
#else
304
							if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1ULL << 31);
305
#endif
7 nishi 306
							for(j = 0; config.ports[j] != -1; j++)
307
								;
308
							config.ports[j] = port;
309
						}
123 nishi 310
					} else if(cm_strcaseequ(r[0], "HidePort")) {
311
						current->hideport = 1;
312
					} else if(cm_strcaseequ(r[0], "ShowPort")) {
313
						current->hideport = 0;
156 nishi 314
#ifndef NO_SSL
12 nishi 315
					} else if(cm_strcaseequ(r[0], "SSLKey")) {
316
						if(r[1] == NULL) {
317
							cm_log("Config", "Missing path at line %d", ln);
318
							stop = 1;
319
						} else {
320
							if(current->sslkey != NULL) free(current->sslkey);
321
							current->sslkey = cm_strdup(r[1]);
322
						}
323
					} else if(cm_strcaseequ(r[0], "SSLCertificate")) {
324
						if(r[1] == NULL) {
325
							cm_log("Config", "Missing path at line %d", ln);
326
							stop = 1;
327
						} else {
328
							if(current->sslcert != NULL) free(current->sslcert);
329
							current->sslcert = cm_strdup(r[1]);
330
						}
156 nishi 331
#endif
161 nishi 332
#ifdef HAS_CHROOT
333
					} else if(cm_strcaseequ(r[0], "ChrootDirectory")) {
334
						if(r[1] == NULL) {
335
							cm_log("Config", "Missing path at line %d", ln);
336
							stop = 1;
337
						} else {
338
							if(current->chroot_path != NULL) free(current->chroot_path);
339
							current->chroot_path = cm_strdup(r[1]);
340
						}
341
#endif
156 nishi 342
					} else if(cm_strcaseequ(r[0], "ForceLog")) {
343
						if(r[1] == NULL) {
344
							cm_log("Config", "Missing log at line %d", ln);
345
							stop = 1;
346
						} else {
347
							cm_force_log(r[1]);
348
						}
349
					} else if(cm_strcaseequ(r[0], "EndIf")) {
350
						if(ifbr == 0) {
351
							cm_log("Config", "Missing BeginIf at line %d", ln);
352
							stop = 1;
353
						}
354
						ifbr--;
355
					} else if(cm_strcaseequ(r[0], "BeginIf") || cm_strcaseequ(r[0], "BeginIfNot")) {
356
						if(r[1] == NULL) {
357
							cm_log("Config", "Missing condition type at line %d", ln);
358
						} else {
212 nishi 359
							bool ign = false;
156 nishi 360
							ifbr++;
361
							if(cm_strcaseequ(r[1], "False")) {
362
								ign = true;
363
							} else if(cm_strcaseequ(r[1], "True")) {
364
							} else if(cm_strcaseequ(r[1], "Defined")) {
365
								if(r[2] == NULL) {
366
									cm_log("Config", "Missing name at line %d", ln);
367
									stop = 1;
368
								} else {
369
									int i;
370
									bool fndit = false;
371
									for(i = 0; config.defined[i] != NULL; i++) {
372
										if(strcmp(config.defined[i], r[2]) == 0) {
373
											fndit = true;
374
											break;
375
										}
376
									}
377
									if(!fndit) {
378
										ign = true;
379
									}
380
								}
381
							} else {
382
								cm_log("Config", "Unknown condition type at line %d", ln);
383
								stop = 1;
384
							}
385
							if(cm_strcaseequ(r[0], "BeginIfNot")) ign = !ign;
386
							if(ign) {
387
								ignore = ifbr - 1;
388
							}
389
						}
61 nishi 390
					} else if(cm_strcaseequ(r[0], "ServerRoot")) {
391
						if(r[1] == NULL) {
392
							cm_log("Config", "Missing path at line %d", ln);
393
							stop = 1;
394
						} else {
416 nishi 395
#ifndef WINCE
61 nishi 396
							chdir(r[1]);
416 nishi 397
#endif
127 nishi 398
							free(config.server_root);
399
							config.server_root = cm_strdup(r[1]);
61 nishi 400
						}
128 nishi 401
					} else if(cm_strcaseequ(r[0], "ServerAdmin")) {
402
						if(r[1] == NULL) {
403
							cm_log("Config", "Missing email at line %d", ln);
404
							stop = 1;
405
						} else {
406
							free(config.server_admin);
407
							config.server_admin = cm_strdup(r[1]);
408
						}
19 nishi 409
					} else if(cm_strcaseequ(r[0], "DocumentRoot")) {
410
						if(r[1] == NULL) {
411
							cm_log("Config", "Missing path at line %d", ln);
412
							stop = 1;
413
						} else {
414
							if(current->root != NULL) free(current->root);
21 nishi 415
							current->root = cm_strdup(strcmp(r[1], "/") == 0 ? "" : r[1]);
19 nishi 416
						}
21 nishi 417
					} else if(cm_strcaseequ(r[0], "MIMEType")) {
418
						if(r[1] == NULL) {
419
							cm_log("Config", "Missing extension at line %d", ln);
420
							stop = 1;
22 nishi 421
						} else if(r[2] == NULL) {
21 nishi 422
							cm_log("Config", "Missing MIME at line %d", ln);
423
							stop = 1;
424
						} else {
425
							struct tw_mime_entry* e = &current->mimes[current->mime_count++];
426
							e->ext = cm_strdup(r[1]);
427
							e->mime = cm_strdup(r[2]);
428
						}
257 nishi 429
					} else if(cm_strcaseequ(r[0], "MIMEFile")) {
430
						if(r[1] == NULL) {
431
							cm_log("Config", "Missing path at line %d", ln);
432
							stop = 1;
433
						} else {
434
							FILE* mimefile = fopen(r[1], "r");
435
							if(mimefile == NULL) {
436
								cm_log("Config", "Could not load the file at line %d", ln);
437
								stop = 1;
438
							} else {
439
								char* line = malloc(1);
440
								int i;
441
								struct stat st;
442
								char* buf;
443
								int incr = 0;
444
								stat(r[1], &st);
445
 
446
								buf = malloc(st.st_size + 1);
447
								fread(buf, st.st_size, 1, mimefile);
448
 
449
								for(i = 0;; i++) {
450
									if(buf[i] == '\n' || buf[i] == 0) {
451
										char oldc = buf[i];
452
										char* line;
453
										buf[i] = 0;
454
 
455
										line = buf + incr;
456
 
457
										if(strlen(line) > 0 && line[0] != '#') {
458
											int j;
459
											for(j = 0; line[j] != 0; j++) {
460
												if(line[j] == ' ' || line[j] == '\t') {
461
													line[j] = 0;
462
													j++;
463
													for(; line[j] != 0; j++) {
464
														if(line[j] != ' ' && line[j] != '\t') {
465
															char* name = line;
466
															char* mimes = line + j;
467
															int k = 0;
468
															int incr2 = 0;
469
															for(k = 0;; k++) {
470
																if(mimes[k] == ' ' || mimes[k] == 0) {
471
																	char oldc2 = mimes[k];
472
																	struct tw_mime_entry* e;
473
																	mimes[k] = 0;
474
 
475
																	e = &current->mimes[current->mime_count++];
476
																	e->ext = cm_strcat(".", mimes + incr2);
477
																	e->mime = cm_strdup(name);
478
																	if(current->mime_count == MAX_MIME) {
479
																		cm_log("Config", "Too many MIME types, cannot handle");
480
																		stop = 1;
481
																		break;
482
																	}
483
 
484
																	incr2 = k + 1;
485
																	if(oldc2 == 0) break;
486
																}
487
															}
488
															break;
489
														}
490
													}
491
													break;
492
												}
493
												if(stop) break;
494
											}
495
										}
496
 
497
										incr = i + 1;
498
										if(oldc == 0) break;
499
									}
500
								}
501
 
502
								free(buf);
503
 
504
								fclose(mimefile);
505
							}
506
						}
22 nishi 507
					} else if(cm_strcaseequ(r[0], "Icon")) {
508
						if(r[1] == NULL) {
509
							cm_log("Config", "Missing MIME at line %d", ln);
510
							stop = 1;
511
						} else if(r[2] == NULL) {
512
							cm_log("Config", "Missing path at line %d", ln);
513
							stop = 1;
514
						} else {
515
							struct tw_icon_entry* e = &current->icons[current->icon_count++];
516
							e->mime = cm_strdup(r[1]);
517
							e->icon = cm_strdup(r[2]);
518
						}
17 nishi 519
					} else if(cm_strcaseequ(r[0], "LoadModule")) {
520
						for(i = 1; r[i] != NULL; i++) {
521
							void* mod = tw_module_load(r[i]);
522
							if(mod != NULL) {
18 nishi 523
								config.modules[config.module_count++] = mod;
17 nishi 524
								if(tw_module_init(mod) != 0) {
525
									stop = 1;
526
									break;
527
								}
528
							} else {
127 nishi 529
								cm_log("Config", "Could not load the module at line %d", ln);
17 nishi 530
								stop = 1;
531
								break;
532
							}
533
						}
24 nishi 534
					} else if(cm_strcaseequ(r[0], "DirectoryIndex")) {
535
						for(i = 1; r[i] != NULL; i++) {
536
							current->indexes[current->index_count++] = cm_strdup(r[i]);
537
						}
178 nishi 538
					} else if(cm_strcaseequ(r[0], "ReadmeFile") || cm_strcaseequ(r[0], "Readme")) {
182 nishi 539
						if(cm_strcaseequ(r[0], "Readme")) {
178 nishi 540
							cm_force_log("NOTE: Readme directive is deprecated.");
541
						}
33 nishi 542
						for(i = 1; r[i] != NULL; i++) {
543
							current->readmes[current->readme_count++] = cm_strdup(r[i]);
544
						}
6 nishi 545
					} else {
39 nishi 546
						stop = 1;
6 nishi 547
						if(r[0] != NULL) {
39 nishi 548
							int argc;
212 nishi 549
							int i;
550
							bool called = false;
551
							struct tw_tool tools;
39 nishi 552
							for(argc = 0; r[argc] != NULL; argc++)
553
								;
554
							stop = 0;
555
							tw_init_tools(&tools);
556
							for(i = 0; i < config.module_count; i++) {
557
								tw_mod_config_t mod_config = (tw_mod_config_t)tw_module_symbol(config.modules[i], "mod_config");
558
								int resp;
559
								if(mod_config != NULL && (resp = mod_config(&tools, r, argc)) == TW_CONFIG_PARSED) {
560
									called = true;
561
									break;
562
								}
563
								if(resp == TW_CONFIG_ERROR) {
564
									stop = 1;
565
									called = true;
566
									break;
567
								}
568
							}
569
							if(!called) {
570
								cm_log("Config", "Unknown directive `%s' at line %d", r[0], ln);
571
								stop = 1;
572
							}
6 nishi 573
						}
5 nishi 574
					}
575
					for(i = 0; r[i] != NULL; i++) free(r[i]);
576
					free(r);
4 nishi 577
				}
578
				free(l);
579
				free(line);
580
				line = malloc(1);
581
				line[0] = 0;
582
				if(c <= 0) break;
6 nishi 583
			} else if(cbuf[0] != '\r') {
4 nishi 584
				char* tmp = line;
585
				line = cm_strcat(tmp, cbuf);
586
				free(tmp);
587
			}
588
		}
589
		free(line);
590
		fclose(f);
255 nishi 591
		for(portcount = 0; config.ports[portcount] != -1; portcount++)
592
			;
593
		if(portcount == 0) {
253 nishi 594
			return 1;
255 nishi 595
		} else {
253 nishi 596
			return stop;
597
		}
6 nishi 598
	} else {
5 nishi 599
		cm_log("Config", "Could not open the file");
4 nishi 600
		return 1;
601
	}
602
}