summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/resource.py
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-04-13 10:52:14 -0400
committerKotresh HR <khiremat@redhat.com>2018-04-13 11:05:58 -0400
commita723362d87a81da5d97cc879cc1d24a48351ca84 (patch)
treed5a013ffa377e6e7330a8859ca463c21f987cc0d /geo-replication/syncdaemon/resource.py
parentc3e1a2e861045a99b9148a0ba5d60777d86f861d (diff)
geo-rep: Fix syncing of symlink
Problem: If symlink is created on master pointing to current directory (e.g symlink -> ".") with non root uid or gid, geo-rep worker crashes with ENOTSUP. Cause: Geo-rep creates the symlink on slave and fixes the uid and gid using chown cmd. os.chown dereferences the symlink which is pointing to ".gfid" which is not supported. Note that geo-rep operates on aux-gfid-mount (e.g. "/mnt/.gfid/<gfid-of-symlink-file>"). Solution: The uid or gid change is acutally on symlink file. So use os.lchown, i.e, don't deference. BUG: 1567209 Change-Id: I63575fc589d71f987bef1d350c030987738c78ad updates: bz#1567209 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
-rw-r--r--geo-replication/syncdaemon/resource.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 8f17e00fb2d..a75d0ddfccd 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -687,7 +687,7 @@ class Server(object):
# UID:0 and GID:0, and then call chown to set UID/GID
if uid != 0 or gid != 0:
path = os.path.join(pfx, gfid)
- cmd_ret = errno_wrap(os.chown, [path, uid, gid], [ENOENT],
+ cmd_ret = errno_wrap(os.lchown, [path, uid, gid], [ENOENT],
[ESTALE, EINVAL])
collect_failure(e, cmd_ret)