are --temp-dir and --daemon mode compatible options

Wayne Davison wayned at
Tue Aug 30 03:25:20 GMT 2005

On Mon, Aug 29, 2005 at 07:42:57PM -0400, Eddie Anzalone wrote:
> As far as I can tell, after version 2.6.4, the "--daemon" and
> "--temp-dir" options are not compatible anymore.

Yes.  There were some problems with users trying to give client options
to a daemon starting up that could really mess rsync up, so I made rsync
only allow know-to-be OK daemon options in conjunction with --daemon.  I
guess I just hadn't stopped to consider that --temp-dir might be useful
as a daemon option.  Are you expecting the option to specify a value
relative to the module's path?  Or should the person who started up the
daemon be able to specify an absolute path (when used in conjunction
with "use chroot = no")?

Attached is a one-line patch that enables --temp-dir in daemon mode.
The option is still santitized relative to the module's root.  It would
be simple to make only a client-specified value respect this non-chroot
sanitizing, but I'm thinking that it would be best to make rsync's
behavior the same regardless of the setting of "use chroot".  Note also
that the user can still override this by specifying their own --temp-dir

-------------- next part --------------
--- options.c	30 Aug 2005 02:59:30 -0000	1.274
+++ options.c	30 Aug 2005 03:10:44 -0000
@@ -530,6 +530,7 @@ static struct poptOption long_daemon_opt
   {"port",             0,  POPT_ARG_INT,    &rsync_port, 0, 0, 0 },
   {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
   {"server",           0,  POPT_ARG_NONE,   &am_server, 0, 0, 0 },
+  {"temp-dir",        'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
   {"verbose",         'v', POPT_ARG_NONE,   0, 'v', 0, 0 },
   {"help",            'h', POPT_ARG_NONE,   0, 'h', 0, 0 },
   {0,0,0,0, 0, 0, 0}

More information about the rsync mailing list