Commit Graph

236 Commits

Author SHA1 Message Date
Wayne Davison
523dad4bb3 Use seteuid() (if available) when using setuid(). 2009-12-12 17:26:05 -08:00
Wayne Davison
855983b434 Make sure daemon's io_timeout is used as a maximum value. 2009-12-12 17:24:39 -08:00
Wayne Davison
445640e803 Update the copyright year. 2009-01-17 13:41:35 -08:00
Wayne Davison
3082dffbe2 Fixed a bunch of "warn_unused_result" compiler warnings. 2008-11-09 18:55:14 -08:00
Wayne Davison
fe62d30de8 Fix the %P logfile escape inside a chroot. 2008-09-26 21:19:51 -07:00
Wayne Davison
1c3e6e8b26 Moved the setting of the socket options before the connect(). 2008-04-15 08:34:17 -07:00
Wayne Davison
29a89172f7 Improved the chdir() code:
- Renamed push_dir() to change_dir() and revised it a little so that it
  can chdir() to a relative path without an intervening chdir() back to
  the staring path.
- Renamed push_pathname() to change_pathname() and revised it to take
  different args and to only call path_is_daemon_excluded() on a new
  path (not a revisit of a file's already-checked path).
- Fixed change_pathname() to set the right pathname value when a chdir()
  call fails.
- Set orig_dir once outside of the change_pathname() function.
- Got rid of pop_dir().
2008-03-30 15:44:46 -07:00
Wayne Davison
f5aeb6ff9b Added XFLG_DIR2WILD3 flag that the daemon uses to transform any
config-file dir/ exclude rule into a dir/*** rule.
2008-03-22 14:02:34 -07:00
Wayne Davison
819bfe4599 Changed the name of the server_filter_list to be
daemon_filter_list, for improved clarity.
2008-03-20 10:42:43 -07:00
Wayne Davison
d4c5cb2b01 A couple more changes for dealing with "checker" warnings. 2008-03-17 10:50:11 -07:00
Wayne Davison
aa0e6b9977 Attempting to silence some more "checker" warnings. 2008-03-17 07:35:19 -07:00
Wayne Davison
18f3cb6957 Changed stat() call to do_stat(). 2008-03-16 21:44:33 -07:00
Wayne Davison
53936ef935 Fixed the use of --protect-args (-s) with a daemon. 2008-03-15 11:56:18 -07:00
Wayne Davison
cbbd8e2e8b The --fake-super option conflicts with -XX (which copies internal
rsync xattrs literally).
2008-03-07 15:23:39 -08:00
Wayne Davison
d1c06c2180 Fixing a problem with a NULL config_file pointer when accessing
a single-use daemon without no --config option specified.  Added
a test to ensure that this doesn't break in the future.
2008-03-03 18:33:11 -08:00
Wayne Davison
d3d07a5e86 Include 2008 in the copyright years. 2008-03-01 12:01:41 -08:00
Wayne Davison
5b3aa8028b Added missing init_iconv() call when initiating a daemon transfer. 2008-02-27 07:19:13 -08:00
Wayne Davison
15dbffc215 Fixed a compilation problem when iconv support is disabled. 2008-02-18 16:48:20 -08:00
Wayne Davison
beef86d0dd A few minor changes, including better push_dir()/pop_dir() verbosity. 2008-02-15 22:19:43 -08:00
Wayne Davison
2fe1feea75 Added a way to specify where the chroot should occur in the module's
path, which allows a daemon admin to have chroot protection and still
have files that are outside the transfer area (such as libraries).
2008-02-15 19:01:35 -08:00
Wayne Davison
0b52f94da7 Some daemon security improvements, including the new parameters
"charset" and "numeric ids".
2008-02-15 17:39:21 -08:00
Wayne Davison
d348d5fd5f Add a trailing slash to a modname arg that has no path information.
This ensures that the user gets a "skipping" message if they didn't
specify -r or -d.  (A trailing-slash was already being added to a
lone modname for --list-only transfers.)
2008-02-09 22:07:03 -08:00
Wayne Davison
3e8fe565ed A daemon needs to call setup_iconv() after parsing the options
it receives.
2008-02-06 16:13:37 -08:00
Wayne Davison
62a6b8df72 Made read_arg_from_pipe() handle EINTR. 2008-01-02 17:20:44 -08:00
Wayne Davison
9585b27678 Add a new daemon security option: "munge symlinks". 2007-11-27 07:34:59 -08:00
Wayne Davison
5223b786ca A daemon needs to set dry_run with --only-write-batch. 2007-11-22 11:19:34 -08:00
Wayne Davison
e844a4a8a8 When listing a bare module name w/o -r, make sure we list the
contents of the module's root directory.
2007-10-27 02:19:49 +00:00
Wayne Davison
65f6b6b0ef Got rid of a useless list_only tweak. 2007-10-07 03:52:17 +00:00
Wayne Davison
dd589118d0 - Set config_file to a default filename if it is NULL.
- Changed create_pid_file() to fail if the pidfile already exists,
  which makes the daemon exit with an error.
- Output errors about a failure to open the config file or the lock
  file to (a still open) stderr.
- We now notice (and complain) if fork() fails.
2007-10-01 02:25:54 +00:00
Wayne Davison
a1d2685b08 - Moved become_daemon() here from socket.c and made it static.
- Call lp_load() before we call become_daemon().
- Output an error to stderr if we fail to open/parse the config file.
- Added a create_pid_file() static function and call it earlier in
  the startup sequence.
2007-09-30 06:57:07 +00:00
Wayne Davison
19531e1f74 Got rid of some unneeded externs. 2007-09-23 02:03:20 +00:00
Wayne Davison
1b42f628f4 Moved inline functions from rsync.h into ifuncs.h. 2007-09-22 16:52:58 +00:00
Wayne Davison
0b515981fc Changed print_child_argv() to take its prefix message as an arg. 2007-09-16 21:41:42 +00:00
Wayne Davison
7909e65f83 - Made start_socket_client() and start_inband_exchange() take a variable
number of remote args.
- We now exchange a "VERSION.SUBVERSION" value in the initial @RSYNCD
  message.  This is backward compatible with pre-protocol 30 rsyncs,
  and fixes a problem where rsync daemons weren't checking if they were
  speaking a compatible pre-release protocol.
- Moved the protocol-handling code (which was in two places) into a new
  function:  exchange_protocols().
- Protocol 30 now sends/receives the daemon args using NULLs as a separator
  rather than a newline.
- Moved the arg-reading code into a new function in io.c:  read_args().
2007-09-09 07:53:05 +00:00
Wayne Davison
8e41b68e8f Tweaking the license text a bit more. 2007-07-10 13:55:49 +00:00
Wayne Davison
4fd842f98d Switching to GPL 3. 2007-07-07 05:33:14 +00:00
Wayne Davison
33cbd577ad If a module's path is not absolute, make it absolute. 2007-07-02 22:02:14 +00:00
Wayne Davison
332cf6df7c The --iconv option has now made it to the trunk. 2007-04-26 05:53:13 +00:00
Wayne Davison
9439c0cb5a Adding the --fake-super option. 2007-04-24 07:32:44 +00:00
Wayne Davison
875a13b42c No need to reset quiet, since we tell parse_arguments() that it
should prevent quiet from getting set.
2007-04-23 18:40:00 +00:00
Wayne Davison
2a40b503c0 Make sure that the am_server variable is non-zero after parsing the
options we received over the socket.  (Thanks, Matt!)
2007-02-16 01:20:29 +00:00
Wayne Davison
ba2133d6ad Further modifications to the copyright comment section. 2007-02-04 14:54:58 +00:00
Wayne Davison
3162ea6f67 Set ignore_errors variable based on lp_ignore_errors(module_id). 2006-12-25 17:49:19 +00:00
Wayne Davison
d02363609a If the pre-xfer exec failed with -1, output the strerror()
from the waitpid() call.
2006-12-06 16:56:19 +00:00
Wayne Davison
9d33e6f7cf Use rwrite() to output the err_msg string. 2006-11-19 04:37:52 +00:00
Wayne Davison
4a19c3b254 Added "const" to appropriate char pointers. 2006-11-19 00:23:21 +00:00
Wayne Davison
2dc7b8bd0e Got rid of type-casting into isFOO() and toFOO() functions by
using static inline functions that take a signed char pointer.
2006-11-09 02:39:29 +00:00
Wayne Davison
9ce7fc3887 Obey the new --no-motd option. 2006-10-24 00:36:42 +00:00
Wayne Davison
6f3684ffb5 Call push_dir() with its new boolean arg. 2006-10-08 20:57:01 +00:00
Wayne Davison
503114a782 Added the RSYNC_PID environment variable for the pre-/post-xfer
commands so that the pre-xfer command has a unique ID it can
use to cache information for the post-xfer command.
2006-09-09 17:59:02 +00:00