Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help with strange rsync issue
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1347

PostPosted: Wed Jun 13, 2018 7:59 pm    Post subject: Help with strange rsync issue Reply with quote

Hello

This is a weird one. I'm dealing with a Windows server via cygwin to rsync files to a remote gentoo server. For the most part, everything is working fine, but on occasion I'm seeing weird permission issues, and I can't wrap my head around what's wrong.

First off, here is the rsync command from the windows server:
Code:
C:\cygwin64\bin\rsync -e C:\cygwin64\bin\ssh -rltgouvD --exclude='RECYCLER' --exclude='System Volume Information' --delete '/cygdrive/f/' "backup@backupserver:/var/backup/acme/Acme\ Files/" > File.txt


So the user on the gentoo server is 'backup'. Important to note.

Now, here is the error I'm receiving from the windows server (from the cygwin shell)...
Code:

rsync: recv_generator: mkdir "/var/backup/acme/Acme Files/Client Files/2017/17-24 Acme/QBA/7- Photos/Garage Concrete/October/20171012" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***


There are some other errors with other files - like..
Code:
default_perms_for_dir: sys_acl_get_file(Client Files/2017/17-27 Acme/QBA/1- TEST/22 - Test package/S-3 Faucet Alternate, ACL_TYPE_DEFAULT): Permission denied, falling back on umask
rsync: mkstemp "/var/backup/acme/Acme Files/Client Files/2017/17-27 Acme/QBA/1- TEST/22 - Test package/S-3 Faucet Alternate/.4903sp.pdf.umkG5k" failed: Permission denied (13)

Now, let's look at the directory on the gentoo box...

Code:
backupserver /var/backup/acme/Acme Files/Client Files/2017/17-24 Acme/QBA/7- Photos/Garage Concrete/October
ls -al

total 16
drwxr-xr-x 5 backup backup   152 Oct 26  2017 .
d---r-x--- 3 backup backup    72 Oct 13  2017 ..
drwxr-xr-x 2 backup backup    48 Jun 13 08:52 20171012
drwxr-xr-x 2 backup backup    48 Oct 19  2017 20171019
drwxr-xr-x 2 backup backup    48 Feb  7 16:51 Concrete
----r-x--- 1 backup backup 15360 Oct 26  2017 Thumbs.db

backupserver /var/backup/acme/Acme Files/Client Files/2017/17-24 Acme/QBA/7- Photos/Garage Concrete/October 
ls -al 20171012

total 0
drwxr-xr-x 2 backup backup  48 Jun 13 08:52 .
drwxr-xr-x 5 backup backup 152 Oct 26  2017 ..


As you can see.. 20171012 is owned by backup and there are no files there. Yet, it's able to write files into the /October directory. These are all created via rsync (I did not create these directories, etc).

Next, let's look at that directory/files on the windows server via cygwin..

Code:
administrator@Acme /cygdrive/f/Client Files/2017/17-24 Acme/QBA/7- Photos/Garage Concrete/October
$ ls -al
total 16
d---rwx---+ 1 User1 Domain Users     0 Oct 26  2017 .
d---rwx---+ 1 User1 Domain Users     0 Oct 13  2017 ..
d---rwx---+ 1 User1 Domain Users     0 Oct 13  2017 20171012
d---rwx---+ 1 User1 Domain Users     0 Oct 19  2017 20171019
d---rwx---+ 1 User2 Domain Users     0 Feb  7 16:51 Concrete
----rwx---+ 1 User2 Domain Users 15360 Oct 26  2017 Thumbs.db

$ ls -1l 20171012
total 7020
d---rwx---+ 1 User1 Domain Users       0 Oct 13  2017 .
d---rwx---+ 1 User1 Domain Users       0 Oct 26  2017 ..
----rwx---+ 1 User1 Domain Users 7158184 Oct 12  2017 IMG_20171012_105628969.jpg
----rwx---+ 1 User1 Domain Users   26112 Feb  7 16:50 Thumbs.db


All the files that are rsync'd to the gentoo server are a user in the Domain Users group.

Based on what I'm seeing.. backup is rsync'ing via SSH and writing to a backup owned directory.. not sure why the permission denied?

Any ideas?

As I mentioned, there are a ton of files that get there no problem.

Thanks!
hanji
_________________
Server Admin Blog - Uno-Code.com | Gentoo Hosting at Rackspace!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 12485

PostPosted: Thu Jun 14, 2018 1:46 am    Post subject: Re: Help with strange rsync issue Reply with quote

hanj wrote:
Code:
rsync: recv_generator: mkdir "/var/backup/acme/Acme Files/Client Files/2017/17-24 Acme/QBA/7- Photos/Garage Concrete/October/20171012" failed: Permission denied (13)
Now, let's look at the directory on the gentoo box...
Code:
backupserver /var/backup/acme/Acme Files/Client Files/2017/17-24 Acme/QBA/7- Photos/Garage Concrete/October
ls -al

total 16
drwxr-xr-x 5 backup backup   152 Oct 26  2017 .
d---r-x--- 3 backup backup    72 Oct 13  2017 ..
I think your problem is the strange permissions on ...
Code:
$ mkdir test
$ cd test/
$ mkdir -m070 x
$ mkdir -m070 x/y
mkdir: cannot create directory 'x/y': Permission denied
When the process uid and the directory owner uid match, the system uses the owner's permission bits, even if less precise bits (group or other) are more permissive.

If I am right, you need to figure out why the permissions are set to 050, fix it, and modify whatever set them that way so that it does not reapply them. The strange permissions might be a consequence of using rsync under Windows, which has a different ACL model. If so, you may need to instruct rsync to ignore the original permissions and use a value of your choosing.
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1347

PostPosted: Thu Jun 14, 2018 1:57 am    Post subject: Re: Help with strange rsync issue Reply with quote

Hu wrote:
hanj wrote:
Code:
rsync: recv_generator: mkdir "/var/backup/acme/Acme Files/Client Files/2017/17-24 Acme/QBA/7- Photos/Garage Concrete/October/20171012" failed: Permission denied (13)
Now, let's look at the directory on the gentoo box...
Code:
backupserver /var/backup/acme/Acme Files/Client Files/2017/17-24 Acme/QBA/7- Photos/Garage Concrete/October
ls -al

total 16
drwxr-xr-x 5 backup backup   152 Oct 26  2017 .
d---r-x--- 3 backup backup    72 Oct 13  2017 ..
I think your problem is the strange permissions on ...
Code:
$ mkdir test
$ cd test/
$ mkdir -m070 x
$ mkdir -m070 x/y
mkdir: cannot create directory 'x/y': Permission denied
When the process uid and the directory owner uid match, the system uses the owner's permission bits, even if less precise bits (group or other) are more permissive.

If I am right, you need to figure out why the permissions are set to 050, fix it, and modify whatever set them that way so that it does not reapply them. The strange permissions might be a consequence of using rsync under Windows, which has a different ACL model. If so, you may need to instruct rsync to ignore the original permissions and use a value of your choosing.


So I need to figure out the issue on the Windows server. What is the best to ignore original perms and use my values via rsync?

Thanks so much!
hanji
_________________
Server Admin Blog - Uno-Code.com | Gentoo Hosting at Rackspace!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum