Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server terminates if user cannot chown #5

Open
dansan opened this issue Aug 18, 2016 · 0 comments
Open

server terminates if user cannot chown #5

dansan opened this issue Aug 18, 2016 · 0 comments
Labels

Comments

@dansan
Copy link
Owner

dansan commented Aug 18, 2016

When zrsyncd is run as non-root user, and the UID of a source file/dir differs, it tries a chmod, fails, displays a traceback and quits:

2016-08-19 01:30:52 zrsyncd.cmp_node:504  DEBUG [24971] does not exist: u'/tmp/mytarget'
2016-08-19 01:30:52 zrsyncd.mkdir:627  DEBUG [24971] mkdir(u'/tmp/mytarget'); chown(); utime()
2016-08-19 01:30:52 zrsyncd.chown:623  DEBUG [24971] chown(u'/tmp/mytarget', 2311, 5001)
Process sync_server:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/home/daniel/.zrsync/zrsync/zrsync/zrsyncd.py", line 699, in run
    reply["tree_diff"] = self.sync_tree(src_tree, request["no_delete"])
  File "/home/daniel/.zrsync/zrsync/zrsync/zrsyncd.py", line 475, in sync_tree
    res = self.cmp_node(node)
  File "/home/daniel/.zrsync/zrsync/zrsync/zrsyncd.py", line 513, in cmp_node
    node["st_atime"], node["st_mtime"])
  File "/home/daniel/.zrsync/zrsync/zrsync/zrsyncd.py", line 629, in mkdir
    self.chown(dirname, uid, gid)
  File "/home/daniel/.zrsync/zrsync/zrsync/zrsyncd.py", line 624, in chown
    os.lchown(name, uid, gid)
OSError: [Errno 1] Operation not permitted: '/tmp/mytarget'

zrsyncd should instead send a note back to the client, which should display a warning.

@dansan dansan added the bug label Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant