Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixing a problem with a NULL config_file pointer when accessing
[rsync/rsync.git]
/
clientserver.c
diff --git
a/clientserver.c
b/clientserver.c
index
a330111
..
7c15e3b
100644
(file)
--- a/
clientserver.c
+++ b/
clientserver.c
@@
-864,6
+864,17
@@
static void send_listing(int fd)
io_printf(fd,"@RSYNCD: EXIT\n");
}
io_printf(fd,"@RSYNCD: EXIT\n");
}
+static int load_config(int globals_only)
+{
+ if (!config_file) {
+ if (am_server && am_root <= 0)
+ config_file = RSYNCD_USERCONF;
+ else
+ config_file = RSYNCD_SYSCONF;
+ }
+ return lp_load(config_file, globals_only);
+}
+
/* this is called when a connection is established to a client
and we want to start talking. The setup of the system is done from
here */
/* this is called when a connection is established to a client
and we want to start talking. The setup of the system is done from
here */
@@
-879,7
+890,7
@@
int start_daemon(int f_in, int f_out)
* might cause log-file output to occur. This ensures that the
* "log file" param gets honored for the 2 non-forked use-cases
* (when rsync is run by init and run by a remote shell). */
* might cause log-file output to occur. This ensures that the
* "log file" param gets honored for the 2 non-forked use-cases
* (when rsync is run by init and run by a remote shell). */
- if (!l
p_load(config_file,
0))
+ if (!l
oad_config(
0))
exit_cleanup(RERR_SYNTAX);
addr = client_addr(f_in);
exit_cleanup(RERR_SYNTAX);
addr = client_addr(f_in);
@@
-988,13
+999,6
@@
static void become_daemon(void)
int daemon_main(void)
{
int daemon_main(void)
{
- if (!config_file) {
- if (am_server && am_root <= 0)
- config_file = RSYNCD_USERCONF;
- else
- config_file = RSYNCD_SYSCONF;
- }
-
if (is_a_socket(STDIN_FILENO)) {
int i;
if (is_a_socket(STDIN_FILENO)) {
int i;
@@
-1009,7
+1013,7
@@
int daemon_main(void)
return start_daemon(STDIN_FILENO, STDIN_FILENO);
}
return start_daemon(STDIN_FILENO, STDIN_FILENO);
}
- if (!l
p_load(config_file,
1)) {
+ if (!l
oad_config(
1)) {
fprintf(stderr, "Failed to parse config file: %s\n", config_file);
exit_cleanup(RERR_SYNTAX);
}
fprintf(stderr, "Failed to parse config file: %s\n", config_file);
exit_cleanup(RERR_SYNTAX);
}