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

Smb/cifs mount permission issue. #26

Closed
dcmwai opened this issue Jun 27, 2015 · 11 comments
Closed

Smb/cifs mount permission issue. #26

dcmwai opened this issue Jun 27, 2015 · 11 comments

Comments

@dcmwai
Copy link

dcmwai commented Jun 27, 2015

Hello there,

I've some strange permission problem on a smb/cifs mount drive
Slave drive is a smb mount drive which have uid an gid force.

I think there is something need to be done on the permission...

Thank You

Configuration and log below

https://gist.github.com/dcmwai/ae2f9d00258267db29ec

@deajan
Copy link
Owner

deajan commented Jun 27, 2015

I'm not sure if this is and osync bug or something between your configuration and rsync, and the logs won't be sufficient here.

Have you tried to set times and permissions on the files manually as the user running osync ?
If you cannot find the issue, can i get temporary access to that server to have some tests ?

@dcmwai
Copy link
Author

dcmwai commented Jun 28, 2015

I think that you cannot change the permission or xattr on that drive.
Can we somehow ignore the permission and also xattr?

I've partial debug log here.
https://gist.github.com/dcmwai/fe41361ccbb7ca783c49

not sure if that is helpful...

@deajan
Copy link
Owner

deajan commented Jun 29, 2015

Your last gist showed that you already disabled ACL and XATTR copy in configs.
But you MUST have the rights to change at least timestamps, which it seems you don't have either.
You must find where your problem lies, this isn't osync related think.

Have you tried to test changing perms as root ? If yes, grant your current user more rights on the folder / share via samba.
I think I've read your samba share is on ZFS, have you set xattr=sa ?

@dcmwai
Copy link
Author

dcmwai commented Jun 30, 2015

This is more complicated than I though...

This is related to:
owner
group
permission
dir time

local (ocfs2) ---> Remote (smb)
Limitation:
Smb don't take owner, group and permission
(Root)So when copy from local to remote, we cannot have owner group and permission set
--no-perms --no-owner --no-group
(User) don't have permission to change directory time
--omit-dir-times

local (ocfs2) <--- Remote (smb)
Limitation:
(Root)So when copy from local to remote, we need to have owner group and permission set
Without owner group and permission the files will belong to root and no on will be able to read it...

(User) don't have permission to change directory time
--omit-dir-times

I think we might have to define extra permission according to slave type...
Which is going complicated...

@dcmwai
Copy link
Author

dcmwai commented Jul 1, 2015

I've make an ugly patch.
I don't like it much.

I think you have a better way to do it.

@deajan
Copy link
Owner

deajan commented Jul 1, 2015

Usually smb allows setting owner, perms and timestamps, especially if you told me it works as root.
You should maybe check your permissions in smb.conf for that user.

Not using timestamps is a major drawback because rsync relies on timestamps to know which file is newer, this is definitly not the good way of doing.

@deajan
Copy link
Owner

deajan commented Jul 2, 2015

While it's not the best solution, why don't you run osync with sudo privileges, or even as root ?
See the documentation http://netpower.fr/projects/osync/osync_0.99RC4.html#toc-Subsection-2.3 , you may run osync as a standard user and allow this user to sudo certain commands like rsync.
This way, osync is basically run as your sync user but rsync has full root privleges.

@dcmwai
Copy link
Author

dcmwai commented Jul 3, 2015

Let me think again.
I need check where the limitation is...
When doing smb mount, there are some limit...

@deajan
Copy link
Owner

deajan commented Jul 12, 2015

Any updates ?
Btw, is there a way to get an RW access to that wiki so i can update some details ?

@dcmwai
Copy link
Author

dcmwai commented Jul 18, 2015

I switch that to dfs without sync...
I think there are some strange factor here..

  1. I'm runnig the script as users and cause changing the directory creation time error (users in linux cannot change time unless it is sudo)
  2. Because I mount the cifs as user A, the nas don't allow this user A sync or add other users access in the files/folder...

Under the above 2 restriction... (I think...)
we have to run it as root and a cifs users which have the access to change the cifs ACL.
But that it come another problem... The NAS and linux server don't have same uid/gid (because of how the nas handle it UID/GID) so that why I drop this idea and go to dfs...

Thank you for the help

P.s I still think it is good to have ignore users and group permission on the script.
But it is missing a feature on if running the osync as root, who files it should be after sync to local...

Thank again.

@dcmwai dcmwai closed this as completed Jul 18, 2015
@deajan
Copy link
Owner

deajan commented Jul 19, 2015

Well, thank you for your explanation.
There are things i don't understand like why do you sync to a NAS ?

Also, why don't you use osync the way it's designed, sync over ssh instead of over smb ?

Anyway, wish you good luck with your case.

As for the user / group permissions, not syncing them would be a great drawback for a sync software. What's your point ? If you cannot sync permissions, you cannot sync time changes which is needed for sync software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants