diff options
author | Kotresh HR <khiremat@redhat.com> | 2015-03-25 23:39:16 +0530 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2015-03-30 06:57:16 -0700 |
commit | 624938999bf925af710e9f73c75040416f68b756 (patch) | |
tree | 8581ab7d9e49d068cf2306d7bb454df3a24305dd | |
parent | 86fa9298ea9d04766c0a693192e6660ad4b02165 (diff) |
geo-rep: Add support for acls
This patch adds support for ACLS. When it sees SETXATTR
in Changelog, it adds the file to data queue. rsync/tar+ssh
will take care of syncing ACLS. User set ACLS will be
synced to Slave.
This requires "system.posix_acl_access" to go through when
client-pid is equal GF_CLIENT_PID_GSYNCD in fuse layer.
New config interface is introduced, sync-acls
Which can be set using geo-rep config(Default is True)
gluster volume geo-replication <VOLUME> <SLAVEHOST>::<SLAVEVOL> \
config sync-acls false
Change-Id: I7eb3523fa72b8fed830efc98138891244e830d65
BUG: 1187021
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/10001
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
-rw-r--r-- | geo-replication/syncdaemon/configinterface.py.in | 4 | ||||
-rw-r--r-- | geo-replication/syncdaemon/gsyncd.py | 1 | ||||
-rw-r--r-- | geo-replication/syncdaemon/master.py | 6 | ||||
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 3 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 4 | ||||
-rw-r--r-- | xlators/mount/fuse/src/fuse-helpers.c | 2 |
7 files changed, 17 insertions, 7 deletions
diff --git a/geo-replication/syncdaemon/configinterface.py.in b/geo-replication/syncdaemon/configinterface.py.in index 0ffff70e0bb..1c174b5b760 100644 --- a/geo-replication/syncdaemon/configinterface.py.in +++ b/geo-replication/syncdaemon/configinterface.py.in @@ -42,6 +42,10 @@ CONFIGS = ( "gluster_params", "aux-gfid-mount xlator-option=\*-dht.assert-no-child-down=true", "aux-gfid-mount"), + ("peersrx .", + "gluster_params", + "aux-gfid-mount", + "aux-gfid-mount acl"), ("peersrx . .", "ssh_command_tar", "", diff --git a/geo-replication/syncdaemon/gsyncd.py b/geo-replication/syncdaemon/gsyncd.py index 1542810bcd7..0aefe7e2c44 100644 --- a/geo-replication/syncdaemon/gsyncd.py +++ b/geo-replication/syncdaemon/gsyncd.py @@ -232,6 +232,7 @@ def main_i(): op.add_option('--isolated-slave', default=False, action='store_true') op.add_option('--use-rsync-xattrs', default=False, action='store_true') op.add_option('--sync-xattrs', default=True, action='store_true') + op.add_option('--sync-acls', default=True, action='store_true') op.add_option('--pause-on-start', default=False, action='store_true') op.add_option('-L', '--log-level', metavar='LVL') op.add_option('-r', '--remote-gsyncd', metavar='CMD', diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index e60624391a1..721ad9c3635 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -1001,9 +1001,9 @@ class GMasterChangelogMixin(GMasterCommon): else: meta_gfid.add((os.path.join(pfx, ec[0]), )) elif ec[1] == 'SETXATTR': - # To sync xattr use rsync/tar, --xattrs switch - # to rsync and tar - if boolify(gconf.sync_xattrs): + # To sync xattr/acls use rsync/tar, --xattrs and --acls + # switch to rsync and tar + if boolify(gconf.sync_xattrs) or boolify(gconf.sync_acls): datas.add(os.path.join(pfx, ec[0])) else: logging.warn('got invalid changelog type: %s' % (et)) diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 10c6406e283..a1281012264 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -831,6 +831,7 @@ class SlaveRemote(object): '--stats', '--numeric-ids', '--no-implied-dirs'] + \ gconf.rsync_options.split() + \ (boolify(gconf.sync_xattrs) and ['--xattrs'] or []) + \ + (boolify(gconf.sync_acls) and ['--acls'] or []) + \ ['.'] + list(args) po = Popen(argv, stdin=subprocess.PIPE, stderr=subprocess.PIPE) for f in files: @@ -854,10 +855,12 @@ class SlaveRemote(object): (host, rdir) = slaveurl.split(':') tar_cmd = ["tar"] + \ (boolify(gconf.sync_xattrs) and ['--xattrs'] or []) + \ + (boolify(gconf.sync_acls) and ['--acls'] or []) + \ ["-cf", "-", "--files-from", "-"] ssh_cmd = gconf.ssh_command_tar.split() + \ [host, "tar"] + \ (boolify(gconf.sync_xattrs) and ['--xattrs'] or []) + \ + (boolify(gconf.sync_acls) and ['--acls'] or []) + \ ["--overwrite", "-xf", "-", "-C", rdir] p0 = Popen(tar_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 8dff3d9e419..4e02b5bbf18 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -5025,7 +5025,7 @@ create_conf_file (glusterd_conf_t *conf, char *conf_path) /* gluster-params */ runinit_gsyncd_setrx (&runner, conf_path); runner_add_args (&runner, "gluster-params", - "aux-gfid-mount", + "aux-gfid-mount acl", ".", ".", NULL); RUN_GSYNCD_CMD; @@ -5148,7 +5148,7 @@ create_conf_file (glusterd_conf_t *conf, char *conf_path) /* gluster-params */ runinit_gsyncd_setrx (&runner, conf_path); runner_add_args (&runner, "gluster-params", - "aux-gfid-mount", + "aux-gfid-mount acl", ".", NULL); RUN_GSYNCD_CMD; diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index abe35e0c26f..dc4293dcc07 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -640,7 +640,7 @@ configure_syncdaemon (glusterd_conf_t *conf) /* gluster-params */ runinit_gsyncd_setrx (&runner, conf); runner_add_args (&runner, "gluster-params", - "aux-gfid-mount", + "aux-gfid-mount acl", ".", ".", NULL); RUN_GSYNCD_CMD; @@ -764,7 +764,7 @@ configure_syncdaemon (glusterd_conf_t *conf) /* gluster-params */ runinit_gsyncd_setrx (&runner, conf); runner_add_args (&runner, "gluster-params", - "aux-gfid-mount", + "aux-gfid-mount acl", ".", NULL); RUN_GSYNCD_CMD; diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c index ca3a08e773f..7fc41383c36 100644 --- a/xlators/mount/fuse/src/fuse-helpers.c +++ b/xlators/mount/fuse/src/fuse-helpers.c @@ -600,6 +600,8 @@ fuse_ignore_xattr_set (fuse_private_t *priv, char *key) key, FNM_PERIOD) == 0) || (fnmatch ("*.glusterfs.volume-mark.*", key, FNM_PERIOD) == 0) + || (fnmatch ("system.posix_acl_access", + key, FNM_PERIOD) == 0) || (fnmatch ("glusterfs.gfid.newfile", key, FNM_PERIOD) == 0))) ret = -1; |