1 |
|
|
2 |
/* init.c main program initalization |
/* init.c main program initalization |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
29 |
config = NULL; |
config = NULL; |
30 |
} |
} |
31 |
|
|
32 |
void ftpd_init(char *filename, int verbose) |
void ftpd_init(char *filename, |
33 |
|
int verbose) |
34 |
{ |
{ |
35 |
int result = TRUE; |
int result = TRUE; |
36 |
char *scratchfile; |
char *scratchfile; |
37 |
|
|
38 |
ftpd_preinit(); |
ftpd_preinit(); |
39 |
|
|
40 |
if (verbose) |
if (verbose) |
41 |
{ |
{ |
42 |
printf("Starting "PROGNAME" server. (Version "VERSTR")\n"); |
printf("Starting " PROGNAME " server. (Version " VERSTR ")\n"); |
43 |
printf("Copyright (C) 1999,2000 Beau Kuiper\n"); |
printf("Copyright (C) 1999,2000 Beau Kuiper\n"); |
44 |
printf("License under GPL. See the http://www.fsf.org for more info.\n\n"); |
printf |
45 |
|
("License under GPL. See the http://www.fsf.org for more info.\n\n"); |
46 |
|
|
47 |
printf("LOADING CONFIG FILE: %s\n", filename); |
printf("LOADING CONFIG FILE: %s\n", filename); |
48 |
} |
} |
49 |
|
|
50 |
config = ftpd_loadconfig(filename, FALSE, umask(0)); |
config = ftpd_loadconfig(filename, FALSE, umask(0)); |
51 |
if (config) |
if (config) |
52 |
result = ftpd_checkconfig(config); |
result = ftpd_checkconfig(config); |
53 |
if ((!config) || (!result)) |
if ((!config) || (!result)) |
63 |
} |
} |
64 |
|
|
65 |
result = getsectionid(config->configfile, "main"); |
result = getsectionid(config->configfile, "main"); |
66 |
loadstrfromconfig(config->configfile, result, "scratchfile", |
loadstrfromconfig(config->configfile, result, "scratchfile", |
67 |
&scratchfile, SCRATCHFILE); |
&scratchfile, SCRATCHFILE); |
68 |
if (scratchfile[0] != '/') |
if (scratchfile[0] != '/') |
69 |
ERRORMSGFATAL("Scratchfile is not a valid absolute filename"); |
ERRORMSGFATAL("Scratchfile is not a valid absolute filename"); |
70 |
|
|
71 |
shinfo_init(scratchfile); |
shinfo_init(scratchfile); |
72 |
|
|
73 |
ftpd_setnogroups(); |
ftpd_setnogroups(); |
74 |
} |
} |