Re: Bug: Loosing Group Permissions in Archive Mode with Sticky Bit and ACL Mask

2018-06-15 Thread Phillip Kuhrt via rsync
Hello,

I currently try to copy a directory locally between two ext4 filesystems
while preserving permissions and ACLs using the -aAX options. Under some
conditions, rsync does not copy the posix permissions completely, it
changes the group::rwx to a group::--- permission. The latest rsync
available on Debian Jessie is 3.1.1, but the changelog for 3.1.2 and 3.1.3
did not seem to mention such a bug being fixed.

As far as I tried, this bug stops occurring when I:
* remove the sticky bit from skel/subdir ("chmod -t")
* remove the rwx mask from skel/subdir ("setfacl -x m::"), which setfacl
creates when adding the user object permission


Here an example:

// OS: Debian GNU/Linux 8 (jessie)
// apt list: rsync/oldstable,now 3.1.1-3+deb8u1 amd64 [installed,automatic]

// long command:
// 1. remove skel3/
// 2. recreate skel3/ from skel/ using rsync
// 3. diff the acls on the subfolder

// first: without sticky bit
root@:/etc# rm skel3 -r ; rsync -aAX skel/ skel3 ; diff -y <(getfacl
skel/subdir/) <(getfacl skel3/subdir)
# file: skel/subdir/| # file:
skel3/subdir
# owner: skeluser   # owner:
skeluser
# group: skelgroup  # group:
skelgroup
user::rwx   user::rwx
user:skeluser:rwx
user:skeluser:rwx
group::rwx  group::rwx
mask::rwx   mask::rwx
other::---  other::---
default:user::rwx
default:user::rwx
default:user:skeluser:rwx
default:user:skeluser:rwx
default:group::---
default:group::---
default:mask::rwx
default:mask::rwx
default:other::---
default:other::---

// then: with sticky bit
root@:/etc# chmod +t skel/subdir/
root@:/etc# rm skel3 -r ; rsync -aAX skel/ skel3 ; diff -y <(getfacl
skel/subdir/) <(getfacl skel3/subdir)
# file: skel/subdir/| # file:
skel3/subdir
# owner: skeluser   # owner:
skeluser
# group: skelgroup  # group:
skelgroup
# flags: --t# flags: --t
user::rwx   user::rwx
user:skeluser:rwx
user:skeluser:rwx
group::rwx| group::---
mask::rwx   mask::rwx
other::---  other::---
default:user::rwx
default:user::rwx
default:user:skeluser:rwx
default:user:skeluser:rwx
default:group::---
default:group::---
default:mask::rwx
default:mask::rwx
default:other::---
default:other::---

// directory above:
root@:/etc# getfacl skel
# file: skel
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

Best regards
Phillip Kuhrt
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Group Permissions?

2004-01-23 Thread donkey
We were successfully using rsync (via rsh) between two boxes where the command 
was run by the user that owned the destination directory. We had to change our 
destination directory to one that user does not own, but is within the same 
group as the owner and the directory is set with group write and execute 
permissions. Rsync now gives errors like failed to set times on ...
The files are still copied, but they seem to have somewhat randomly assigned 
persmissions and some of the files are owned by the user calling rsync and some 
are owned by the owner of the directory. 

Any help would be appreciated.




--
This message was sent using BOO.net's Webmail.
http://www.boo.net/
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Group Permissions?

2004-01-23 Thread Wayne Davison
On Fri, Jan 23, 2004 at 11:08:05AM -0500, [EMAIL PROTECTED] wrote:
 some of the files are owned by the user calling rsync and some are
 owned by the owner of the directory. 

The only way you can have inconsistent ownership (without having root
involved) is for you to have ommitted 'chown'ed the entire tree to the
new user that is running rsync.  This is needed to give that user full
permissions to be able to change things (merely being able to write a
file does not give you any permissions to change the permissions, for
instance, and on some OSes, not even the permission to set an arbitrary
timestamp).  So, either run chown -R new-user /dest/path as root, or
remove the tree as the old-user and recopy it as the new-user.

..wayne..
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Group Permissions?

2004-01-23 Thread donkey
Does this mean that rsync requires that the destination directory be owned by 
the user calling rsync and that it is not sufficient for the user to have write 
permissions to that directory?

 The only way you can have inconsistent ownership (without having root
 involved) is for you to have ommitted 'chown'ed the entire tree to the
 new user that is running rsync.  This is needed to give that user full
 permissions to be able to change things (merely being able to write a
 file does not give you any permissions to change the permissions, for
 instance, and on some OSes, not even the permission to set an arbitrary
 timestamp).  So, either run chown -R new-user /dest/path as root, or
 remove the tree as the old-user and recopy it as the new-user.
 
 ..wayne..
 




--
This message was sent using BOO.net's Webmail.
http://www.boo.net/
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Group Permissions?

2004-01-23 Thread Wayne Davison
On Fri, Jan 23, 2004 at 11:49:56AM -0500, [EMAIL PROTECTED] wrote:
 Does this mean that rsync requires that the destination directory be
 owned by the user calling rsync and that it is not sufficient for the
 user to have write permissions to that directory?

It depends on what you're trying to do and what OS you're running.  If
you're just putting files into a directory, you don't need to own it.
However, changes to the directory information (such as a mode change)
requires that rsync have permissions to make the change, and that
typically means owning the directory (or being root).  Similar errors
could be reported for files when the content doesn't change (i.e. the
file isn't being recopied).  Keep in mind that you'd get the same kind
of error from cp -p if you don't own the file, so this is not an
rsync-specific thing.

..wayne..
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Group Permissions?

2004-01-23 Thread jw schultz
On Fri, Jan 23, 2004 at 09:09:44AM -0800, Wayne Davison wrote:
 On Fri, Jan 23, 2004 at 11:49:56AM -0500, [EMAIL PROTECTED] wrote:
  Does this mean that rsync requires that the destination directory be
  owned by the user calling rsync and that it is not sufficient for the
  user to have write permissions to that directory?
 
 It depends on what you're trying to do and what OS you're running.  If
 you're just putting files into a directory, you don't need to own it.
 However, changes to the directory information (such as a mode change)
 requires that rsync have permissions to make the change, and that
 typically means owning the directory (or being root).  Similar errors
 could be reported for files when the content doesn't change (i.e. the
 file isn't being recopied).  Keep in mind that you'd get the same kind
 of error from cp -p if you don't own the file, so this is not an
 rsync-specific thing.

It would be possible to be specific if you told us what OS
and filesystem types are involved although specific info may
be lacking for some combinations.

-- 

J.W. SchultzPegasystems Technologies
email address:  [EMAIL PROTECTED]

Remember Cernan and Schmitt
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html