https://bugzilla.samba.org/show_bug.cgi?id=7424
           Summary: -x with sshfs
           Product: rsync
           Version: 3.0.7
          Platform: x64
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P3
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: bugs at dotcommie.net
         QAContact: rsync-qa at samba.org
When rsyncing a directory with a sshfs mount point causes rsync to exit with
code 23. If sshfs is mounted as unprivileged user and rsync is started as the
same user then there are no problems. However if rsync is run as root it gets a
Permission denied while reading mount point. In an attempt to force rsync to
skip this mount used -x option but did not help.
Not quite sure if this is a problem of sshfs/fuse or rsync.
/tmp/rsyncTest$ mkdir source
/tmp/rsyncTest$ echo "hello World" >> source/1
/tmp/rsyncTest$ mkdir source/sshfsMount
/tmp/rsyncTest$ sshfs anotherMachine:/some/dir source/sshfsMount/
/tmp/rsyncTest$ su -
/tmp/rsyncTest# cd /tmp/rsyncTest
/tmp/rsyncTest# rsync -avz source destination
sending incremental file list
rsync: readlink_stat("/tmp/rsyncTest/source/sshfsMount") failed:
Permission
denied (13)
created directory destination
source/
source/1
sent 131 bytes  received 35 bytes  332.00 bytes/sec
total size is 12  speedup is 0.07
rsync error: some files/attrs were not transferred (see previous errors) (code
23) at main.c(1060) [sender=3.0.7]
/tmp/rsyncTest# echo $?
23
/tmp/rsyncTest# rsync -avzx source destination
sending incremental file list
rsync: readlink_stat("/tmp/rsyncTest/source/sshfsMount") failed:
Permission
denied (13)
sent 76 bytes  received 13 bytes  178.00 bytes/sec
total size is 12  speedup is 0.13
rsync error: some files/attrs were not transferred (see previous errors) (code
23) at main.c(1060) [sender=3.0.7]
/tmp/rsyncTest# echo $?
23
$ rsync --version
rsync  version 3.0.7  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes
rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.
-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=7424
devzero at web.de changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |devzero at web.de
------- Comment #1 from devzero at web.de  2010-08-22 05:58 CST -------
did you try "--ignore-errors" or "--force" to check if this
makes a difference
?
be warned that this may be dangerous becaus because of this option files on the
receiving side may be deleted.
-x should not help here, you should better have a look at --exclude  and also
google for ' +rsync +"failed: Permissiondenied" ' as this
happens with other
fuse filesystems. see
http://forum.ubuntuusers.de/topic/rsync-hat-problem-mit-.gvfs-verzeichnis/?highlight=mod#post-1419788
for example
-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
https://bugzilla.samba.org/show_bug.cgi?id=7424 ------- Comment #2 from rsync at sanitarium.net 2011-02-28 18:43 CST ------- Perhaps you want the allow_other mount option on the sshfs mount point? Otherwise sshfs/fuse will not allow other users on the system to access the data in the mount regardless of permissions. This is important because sshfs/fuse doesn't support file ownership/group/permissions in the traditional UNIX style. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs at samba.org
2011-Jul-04  23:30 UTC
[Bug 7424] Extend -x to make use of information in /proc/mounts (when available)
https://bugzilla.samba.org/show_bug.cgi?id=7424
Wayne Davison <wayned at samba.org> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
            Version|3.0.7                       |3.1.0
            Summary|-x with sshfs               |Extend -x to make use of
                   |                            |information in /proc/mounts
                   |                            |(when available)
           Severity|minor                       |enhancement
--- Comment #3 from Wayne Davison <wayned at samba.org> 2011-07-04
23:30:54 UTC ---
Rsync has to stat a directory in order to be able to discover that it is on a
different device.  If a user is unable to stat the directory (which, as Kevin
indicates, is not possible if the fuse mount is only allowing one user to stat
the dir), then you'll see the stat error.  Your only option is to exclude
the
directory.
See the support/mnt-excl script for a way to generate a list of mount-point
exclusions relative to a given source directory.
Perhaps rsync should be extended to try to gather absolute mount-point
information via something like /proc/mounts (when -x is used) which would allow
it to use a combination of a list of mounts and the checking of mount-point
device numbers when deciding if a directory is a mount point or not.  I'll
transform this bug into an enhancement request for that.
-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Possibly Parallel Threads
- sshfs -o rellinks (module option) rejected by fuse
- Samba serving sshfs shares: can't delete files
- Bug+bugfix in sftp-server : failed to rename file on sshfs mount
- sshfs mounting on Centos 6.9
- [sshfs] sshfs mounted applications fail with "error loading shared libraries"