Commit Graph

11 Commits

Author SHA1 Message Date
Wayne Davison
26c87bb630 Changed the arg-splitting code so that it can handle a literal
backslash prior to whitespace without treating it as escaped
whitespace (e.g. if we receive "foo\\ bar", it is two args,
while "foo\ bar" and "foo\\\ bar" are each just one).
2005-06-23 15:58:57 +00:00
Wayne Davison
b21456102a Changed the code to use the single long-option hash from cull_options. 2005-06-17 23:23:00 +00:00
Wayne Davison
85fbfa10a8 - Improved some comments (some taken from the new cull-options output).
- Made the user-config sections easier to find.
- Default to running a fully-specified rsync executable so that there
  are not PATH surprises.
- A few minor tweaks to the arg-checking code to make it clearer without
  actually changing its logic.
2005-06-17 16:48:02 +00:00
Wayne Davison
1524815ed3 - Make sure that the command contained the '.' arg at the end of the
options.
- Fixed the expanding of wildcards for a restriction of '/'.
2005-06-17 05:14:15 +00:00
Wayne Davison
985af7035e - Be restrictive on matching the --sender option so that the user
can't fool us into thinking we're the sender by using a filename
  of --sender (or similar ploy).
- Make sure that our '..' check can't be fooled by sly backslashing.
- Tweaked some comments.
2005-06-17 04:50:22 +00:00
Wayne Davison
2e5a7629c0 If SUBDIR is specified as a non-absolute path, make it absolute. 2005-06-17 01:17:44 +00:00
Wayne Davison
70318468df - Made it easy to configure the path of the rsync executable.
- Fully parse all legal options that might come from a stock rsync and
  validate/restrict any option's args (previously we rejected options
  with args).
- Made it easy to disable specific options.
- Properly handle a multi-arg copy's multiple args.
- Make sure that the restricted dir actually exists and we can chdir
  to it.
- Just reject any dangerous args that have .. in them instead of trying
  to munge them.
- We don't treat single-or double-quotes specially, just backslash-
  escaped characters.
- Turn on strict mode.
- Use the array-arg version of exec() so that we don't spawn a shell.
- Use File::Glob to glob wildcards in args.
- Tweaked the log-file format so that it logs the modified command
  without any "OK" suffix.
2005-06-16 19:30:53 +00:00
Wayne Davison
a234bca4ef Reject any --remove-* options when read-only, just in case there
are new ones added in the future.
2005-04-24 16:19:16 +00:00
Wayne Davison
8b806ed347 Disallow --remove-sent-files with a read-only server. 2005-02-20 01:04:12 +00:00
Wayne Davison
106a8ad918 - Allow multiple source paths to be specified (and checked).
- Allow spaces and a few other extra chars in file names.
- For safety, disallow any option that takes an arg.  This should
  be improved in the future because it blocks options such as
  --block-size=N, but without this rule the user could specify
  something like --files-from=FILE or --backup-dir=DIR and have
  it affect files outside the desired SUBDIR restriction.
- Switched to SSH_CONNECTION from the deprecated SSH_CLIENT.
- Strip "::ffff:" from the start of an IP from SSH_CONNECTION.
2005-01-12 19:20:07 +00:00
Wayne Davison
44a82a175d This is Joe Smith's rrsync (restricted rsync) perl script. 2005-01-12 18:48:26 +00:00