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
Added even more no-OPTION overrides.
[rsync/rsync.git]
/
clientserver.c
diff --git
a/clientserver.c
b/clientserver.c
index
5baad1a
..
7c15e3b
100644
(file)
--- a/
clientserver.c
+++ b/
clientserver.c
@@
-3,7
+3,7
@@
*
* Copyright (C) 1998-2001 Andrew Tridgell <tridge@samba.org>
* Copyright (C) 2001-2002 Martin Pool <mbp@samba.org>
*
* Copyright (C) 1998-2001 Andrew Tridgell <tridge@samba.org>
* Copyright (C) 2001-2002 Martin Pool <mbp@samba.org>
- * Copyright (C) 2002-200
7
Wayne Davison
+ * Copyright (C) 2002-200
8
Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-120,6
+120,10
@@
int start_socket_client(char *host, int remote_argc, char *remote_argv[],
set_socket_options(fd, sockopts);
set_socket_options(fd, sockopts);
+#ifdef ICONV_CONST
+ setup_iconv();
+#endif
+
ret = start_inband_exchange(fd, fd, user, remote_argc, remote_argv);
return ret ? ret : client_run(fd, fd, -1, argc, argv);
ret = start_inband_exchange(fd, fd, user, remote_argc, remote_argv);
return ret ? ret : client_run(fd, fd, -1, argc, argv);
@@
-391,7
+395,7
@@
static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
pid_t pre_exec_pid = 0;
char *request = NULL;
pid_t pre_exec_pid = 0;
char *request = NULL;
-#ifdef ICONV_
CONST
+#ifdef ICONV_
OPTION
iconv_opt = lp_charset(i);
if (*iconv_opt)
setup_iconv();
iconv_opt = lp_charset(i);
if (*iconv_opt)
setup_iconv();
@@
-480,9
+484,6
@@
static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
/* TODO: Perhaps take a list of gids, and make them into the
* supplementary groups. */
/* TODO: Perhaps take a list of gids, and make them into the
* supplementary groups. */
- /* We do a push_dir() without actually calling chdir() in order
- * to make sure that the module's path is absolute. After this
- * check, module_dir will be set to an absolute path. */
module_dir = lp_path(i);
if (use_chroot) {
if ((p = strstr(module_dir, "/./")) != NULL) {
module_dir = lp_path(i);
if (use_chroot) {
if ((p = strstr(module_dir, "/./")) != NULL) {
@@
-492,6
+493,8
@@
static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
out_of_memory("rsync_module");
}
out_of_memory("rsync_module");
}
+ /* We do a push_dir() that doesn't actually call chdir()
+ * just to make a relative path absolute. */
strlcpy(line, curr_dir, sizeof line);
if (!push_dir(module_dir, 1))
goto chdir_failed;
strlcpy(line, curr_dir, sizeof line);
if (!push_dir(module_dir, 1))
goto chdir_failed;
@@
-807,6
+810,7
@@
static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
exit_cleanup(RERR_UNSUPPORTED);
}
exit_cleanup(RERR_UNSUPPORTED);
}
+#ifdef ICONV_OPTION
if (!iconv_opt) {
if (ic_send != (iconv_t)-1) {
iconv_close(ic_send);
if (!iconv_opt) {
if (ic_send != (iconv_t)-1) {
iconv_close(ic_send);
@@
-817,6
+821,7
@@
static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
ic_recv = (iconv_t)-1;
}
}
ic_recv = (iconv_t)-1;
}
}
+#endif
if (!numeric_ids
&& (use_chroot ? lp_numeric_ids(i) != False : lp_numeric_ids(i) == True))
if (!numeric_ids
&& (use_chroot ? lp_numeric_ids(i) != False : lp_numeric_ids(i) == True))
@@
-859,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 */
@@
-874,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);
@@
-983,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;
@@
-1004,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);
}