summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1a016bf)
starts so we know the syslog facility for the "starting" message
extern char *config_file;
extern int remote_version;
extern char *config_file;
extern int remote_version;
- if (!lp_load(config_file)) {
+ if (!lp_load(config_file, 0)) {
+ extern char *config_file;
if (is_a_socket(STDIN_FILENO)) {
/* we are running via inetd */
if (is_a_socket(STDIN_FILENO)) {
/* we are running via inetd */
+ if (!lp_load(config_file, 1)) {
+ fprintf(stderr,"failed to load config file %s\n", config_file);
+ exit_cleanup(1);
+ }
+
+ log_open();
+
rprintf(FINFO,"rsyncd version %s starting\n",VERSION);
start_accept_loop(rsync_port, start_daemon);
rprintf(FINFO,"rsyncd version %s starting\n",VERSION);
start_accept_loop(rsync_port, start_daemon);
***************************************************************************/
static void init_globals(void)
{
***************************************************************************/
static void init_globals(void)
{
+ memset(&Globals, 0, sizeof(Globals));
#ifdef LOG_DAEMON
Globals.syslog_facility = LOG_DAEMON;
#endif
#ifdef LOG_DAEMON
Globals.syslog_facility = LOG_DAEMON;
#endif
Load the services array from the services file. Return True on success,
False on failure.
***************************************************************************/
Load the services array from the services file. Return True on success,
False on failure.
***************************************************************************/
-BOOL lp_load(char *pszFname)
+BOOL lp_load(char *pszFname, int globals_only)
- pstring n2;
- BOOL bRetval;
+ pstring n2;
+ BOOL bRetval;
- bInGlobalSection = True;
+ bInGlobalSection = True;
- /* We get sections first, so have to start 'behind' to make up */
- iServiceIndex = -1;
- bRetval = pm_process(n2, do_section, do_parameter);
+ /* We get sections first, so have to start 'behind' to make up */
+ iServiceIndex = -1;
+ bRetval = pm_process(n2, globals_only?NULL:do_section, do_parameter);
break;
case '[': /* Section Header. */
break;
case '[': /* Section Header. */
- if( !Section( InFile, sfunc ) )
- return( False );
- c = EatWhitespace( InFile );
- break;
+ if (!sfunc) return True;
+ if( !Section( InFile, sfunc ) )
+ return( False );
+ c = EatWhitespace( InFile );
+ break;
case '\\': /* Bogus backslash. */
c = EatWhitespace( InFile );
case '\\': /* Bogus backslash. */
c = EatWhitespace( InFile );
} /* pm_process */
/* -------------------------------------------------------------------------- */
} /* pm_process */
/* -------------------------------------------------------------------------- */