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

ACLs not working with "mfsmount -o mfsacl /mnt/lizardfs" #394

Closed
tyler274 opened this issue Mar 6, 2016 · 19 comments
Closed

ACLs not working with "mfsmount -o mfsacl /mnt/lizardfs" #394

tyler274 opened this issue Mar 6, 2016 · 19 comments

Comments

@tyler274
Copy link

tyler274 commented Mar 6, 2016

mounted system with "mfsmount -o mfsacl /mnt/lizardfs"

If I make a directory as root /mnt/lizardfs/testdir and use "setfacl -Rm u:tyler274:rwx /mnt/lizardfs/testdir" I am still unable to touch a file to the directory.

@richard-scott
Copy link

I had to do this to get non-root users to be able to write to my mount point:

echo "* / rw,maproot=0:0" >/etc/mfs/mfsexports.cfg

See if that helps?

@tyler274
Copy link
Author

tyler274 commented Mar 7, 2016

@richard-scott Didn't seem to change anything. all users can write to /mnt/lizardfs but if for example, root creates a folder named "testacl" at "/mnt/lizardfs/testdir" and I run "setfacl -Rm u:tyler274:rwx /mnt/lizardfs/testdir" I am still unable to touch a file to testdir due to permissions denied.

@richard-scott
Copy link

Did you mount the volume with the "mfsacl" flag?

@tyler274
Copy link
Author

tyler274 commented Mar 7, 2016

@richard-scott the specific command used was "mfsmount -o mfsacl /mnt/lizardfs"

@richard-scott
Copy link

lol, my bad. I missed that one ;-)
BTW do you have SELinux enabled?

@tyler274
Copy link
Author

tyler274 commented Mar 7, 2016

@richard-scott Don't believe I do, running latest Arch and haven't gone through any steps to enable it.

@4Dolio
Copy link

4Dolio commented Mar 7, 2016

Cant find it atm, but there is an export option to ignoregid i think. Look for and try that...

@tyler274
Copy link
Author

tyler274 commented Mar 7, 2016

@4Dolio issues #265 and #295

just adding the ignoregid value such that my mfsexports.cfg file is

# mfsexports.cfg(5)
# Allow everything but "meta".
127.0.0.1                       /       rw,alldirs,maproot=0,ignoregid

# Allow "meta".
127.0.0.1                       .       rw

I unmounted the cluster with umount /mnt/lizardfs
Restarted the master server with systemctl restart lizardfs-master
remounted with mfsmount -o mfsacl,mfsdebug /mnt/lizardfs

checked that the acls are there with getfacl /mnt/lizardfs/testacl/
which returns

user::rwx
user:tyler274:rwx
group::r-x
mask::rwx
other::r-x

attempting to touch a file (testfile) to that directory from my user shows

getattr (1)
lookup (1,test)
getattr (15484)
lookup (15484,testfile)
status: ENOENT (No such file or directory)
lookup (15484,testfile)
status: ENOENT (No such file or directory)

and on the user end a permission denied error.

@4Dolio
Copy link

4Dolio commented Mar 8, 2016

Yes per issue #265 what you have done should be working. The only difference i see is that my mfsexports.cfg has rw,alldirs,ignoregid,maproot=0 so my ignoregid and maproot are inverted compared to yours, but I can't imagine that should matter.

Some tests with my 2.6.0 seem to work fine:
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ sudo mkdir acl_test_dir
normaluser@lfs-us-courses7:/lfs-us-courses/shares/courses/ACL_Tests$ ls -la .
drwxr-xr-x 2 root root 0 Mar 7 18:55 acl_test_dir
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ touch acl_test_dir/basic_acl
touch: cannot touch acl_test_dir/basic_acl: Permission denied
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ setfacl -Rm u:normaluser:rwx acl_test_dir/
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ touch acl_test_dir/add_owner_acl
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ setfacl -b acl_test_dir/
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ touch acl_test_dir/add_group_acl
touch: cannot touch acl_test_dir/add_group_acl: Permission denied
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ sudo setfacl -Rm g:1182:rwx acl_test_dir/ normaluser is member of 1182
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ touch acl_test_dir/add_group_acl
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ rm acl_test_dir/add_group_acl
normaluser@lfs-debian-client:/LizardFS/ACL_Tests$ setfacl -b acl_test_dir/

@richard-scott
Copy link

What Linux Distro are you using?
How did you install the Lizard Packages?

@tyler274
Copy link
Author

tyler274 commented Mar 9, 2016

@richard-scott
Copy link

ah, Arch Linux, don't know what distro yet ;-(
I looked at it once, but Debian installed easier and it was more stable for my needs.
I thought you may have installed packages for Debian from here, and that is not the best source for the .debs.

@pbeza
Copy link
Member

pbeza commented Aug 20, 2019

Note that -o mfsacl is now deprecated. ACL support is enabled by default. If you still have any problem with this issue, please reopen it.

@pbeza pbeza closed this as completed Aug 20, 2019
@baby-gnu
Copy link

Hello.

I'm testing on Ubuntu with lizardfs 3.12.0+dfsg-1 and I still have ACL issue.

I'm testing with the command sudo -u foo ls /mnt/test-lizard:

  • Doing setfacl -m user:foo:rx /mnt/test-lizard fail
  • Doing chown foo /mnt/test-lizard works

This should be reopened.

Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic

@pbeza
Copy link
Member

pbeza commented Oct 28, 2019

@baby-gnu ACLs were fixed in #816 after releasing 3.12. Fix will be released in 3.13.

Are you able test this patch?

@baby-gnu
Copy link

@pbeza thanks, I'm doing a rough backport to 3.12 to test on my test machine.

@baby-gnu
Copy link

It's not working with the following patch

--- a/src/mount/fuse/main.cc
+++ b/src/mount/fuse/main.cc
@@ -111,6 +111,13 @@
 		(void)conn;
 #endif
 
+#if FUSE_VERSION >= 30
+	fuse_conn_info_opts *conn_opts = (fuse_conn_info_opts *)userdata;
+	fuse_apply_conn_info_opts(conn_opts, conn);
+	conn->want |= FUSE_CAP_POSIX_ACL;
+	conn->want &= ~FUSE_CAP_ATOMIC_O_TRUNC;
+#endif
+
 	int *piped = (int*)userdata;
 	if (piped[1]>=0) {
 		char s = 0;

Because the libfuse is 2.9.7 and not 3 :-/

@pbeza
Copy link
Member

pbeza commented Oct 28, 2019

AFAIR I had really hard time trying to solve this problem for FUSE 2.9. AFAIK supporting ACL in FUSE < 3 is/was supported by applying this and this patch to Linux kernel (it was written by our ex-developer @lalek ~5 years ago)...

Maybe it's worth trying to backport/install fuse3?

@baby-gnu
Copy link

@pbeza thanks for all the informations.

It was an experiment to fix Samba SYSVOL replication.

I think we will wait for fuse3 to arrive in the next Ubuntu (since our work is based on that) but I note that buster can use it ;-)

Regards.

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

No branches or pull requests

5 participants