Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

Implement support for --chmod and --chown rsync flags (supersedes PR #46) #49

Merged
merged 6 commits into from
Jul 5, 2017

Commits on Jul 5, 2017

  1. Implement support for --chmod and --chown rsync flags.

    By default, afl-sync behaves the same as before, running rsync in
    archive mode (-a) and trasferring local permissions and owner/group.
    However, --chmod PERMS and --chown USER:GROUP can now be specified,
    which passes these flags to rsync, enabling the user to specify the
    permissions, owner and group of the remote files.
    
    This is useful when ensuring the remote storage dir is readable and/or
    writable on the server for all processes that need to access it.
    
    The new flags are only supported when pushing and in the push phase of
    syncing, not pulling. The support for the flags was implemented by
    the introduction of a new parameter for AflRsync, which represents the
    options for rsync, both its get and put modes.
    dkasak committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    46bad96 View commit details
    Browse the repository at this point in the history
  2. Fix typo in help message.

    dkasak committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    239658c View commit details
    Browse the repository at this point in the history
  3. Prevent local globbing when --chown is passed to rsync.

    rsync seems to internally convert --chown=foo:bar to --usermap=*:foo
    --groupmap=*:bar. Due to a bug[*], it passes this to a shell at some
    point without properly escaping it. The shell then globs the wildcard,
    which is not correct and likely makes the shell complain about
    nonexistent matches. A workaround is to pass --protect-args to rsync
    which makes makes it work as intended but may have other consequences.
    
    [*] https://bugzilla.samba.org/show_bug.cgi?id=10705
    dkasak committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    0926bbb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b9c661f View commit details
    Browse the repository at this point in the history
  5. Fix tests.

    dkasak committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    4da8426 View commit details
    Browse the repository at this point in the history
  6. Remove duplicate assertion.

    dkasak committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    8da548c View commit details
    Browse the repository at this point in the history